-
-
Notifications
You must be signed in to change notification settings - Fork 131
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: don't include filename in path
when calling readdir
with withFileTypes: true
#1024
Conversation
Looks like a good start, just needs the Windows tests fixed |
I removed the overly long commit description from the one commit :) |
@G-Rath my bad i forgot that string replace isn`t inplace. I have switched to my windows machine and this passes all tests so it should now work. |
okay last try... sorry for the careless editing. Now everything should be fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Whoops didn't see there were new pushes - no worries about the repeated failing of CI. I'm happy to keep approving the workflow runs until it passes 😛 |
path
when calling readdir
with withFileTypes: true
path
when calling readdir
with withFileTypes: true
path
when calling readdir
with withFileTypes: true
## [4.8.2](v4.8.1...v4.8.2) (2024-04-14) ### Bug Fixes * don't include filename in `path` when calling `readdir` with `withFileTypes: true` ([#1024](#1024)) ([711c4bd](711c4bd))
This solves issue #1007 and is in large part the solution of @zzzzBuv though with some tests changed for conformance with node and readdir recursive fix.
src/dirent.path is only the path of the parent dir and dirent.name is either the filename+extension or the directory name. This is now reflected in readdir. Because readdir constructs the filenames from the readdir we join(path,name).
I had to change the test with readdir({withFileType: true}) because they were out of spec with node.
To test for conformance i used a simple script (node version v21.7.2)
in the following file structure
it results in the following log:
as i can see the test reflect that.
Resolves #1007