Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add parentPath to Dirent #1058

Merged
merged 3 commits into from
Sep 17, 2024
Merged

Conversation

SoulKa
Copy link
Contributor

@SoulKa SoulKa commented Sep 5, 2024

Changes

  • Add missing parentPath property to Dirent which is equal to the path property

The parentPath property will replace the path property on Dirent in future node versions (see Docs).

References #735

@G-Rath G-Rath changed the title #735 - add parentPath property to Dirent fix: add parentPath to Dirnet Sep 16, 2024
@G-Rath G-Rath changed the title fix: add parentPath to Dirnet fix: add parentPath to Dirent Sep 16, 2024
Copy link
Collaborator

@G-Rath G-Rath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - would you mind adding a test to assert that parentPath has the same value as path?

it'd also be great if you could double check that we're using parentPath everywhere ourselves (I'm not sure if we do actually use Dirent#path)

@SoulKa SoulKa requested a review from G-Rath September 17, 2024 07:26
@SoulKa
Copy link
Contributor Author

SoulKa commented Sep 17, 2024

I fixed the tests that were broken due to the new parentPath property. You can see in the diff that the property is tested now. Is that enough or do we need new tests? I also changed the one occurrence where Dirent#path was used.

Initially, I wanted to make Dirent#path a getter and act as redirect to Dirent#parentPath, however this also changes the behavior on the property detection. So we will have to keep two separate properties instead of making one a getter.

Copy link
Collaborator

@G-Rath G-Rath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@G-Rath G-Rath merged commit 9156c84 into streamich:master Sep 17, 2024
9 of 10 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 17, 2024
## [4.11.2](v4.11.1...v4.11.2) (2024-09-17)

### Bug Fixes

* add `parentPath` to `Dirent` ([#1058](#1058)) ([9156c84](9156c84)), closes [#735](#735) [#735](#735)
Copy link

🎉 This PR is included in version 4.11.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@SoulKa SoulKa deleted the dirent.parentPath branch September 17, 2024 21:06
BadIdeaException pushed a commit to BadIdeaException/memfs that referenced this pull request Oct 2, 2024
* streamich#735 - add parentPath property to Dirent

* streamich#735 - fix tests for parentPath property

* streamich#735 - use Dirent parentPath instead of path in Volume
BadIdeaException pushed a commit to BadIdeaException/memfs that referenced this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants