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: fs.readdir/readdirSync should support withFileTypes #24062
Conversation
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.
Question for future us, can we run all of node's fs
specific tests but put the fixtures in an ASAR file to see this mismatch in support in CI?
Sounds pretty doable imo - i'll toss it on the backlog |
Release Notes Persisted
|
I have automatically backported this PR to "10-x-y", please check out #24106 |
I have automatically backported this PR to "8-x-y", please check out #24107 |
I have automatically backported this PR to "9-x-y", please check out #24108 |
Please check this issue electron/asar#103 (comment) It's still not working in electron 10.1.1 |
Description of Change
Closes #19074.
Fixes an inconsistency between the Node.js implementations of
fs.readdir
andfs.readdirSync
where we did not supportwithFileTypes
under asar. When{ withFileTypes: true }
is passed as an option to either of the above methods, the methods should returnfs.Dirent[]
.This fixes the issue by using existing data we already have through
archive.stat
to appropriately returnfs.Dirent[]
when this option is passed.cc @zcbenz @jkleinsc @MarshallOfSound
Checklist
npm test
passesRelease Notes
Notes: Fixes an issue where
withFileTypes
was not supported as an option tofs.readdir
orfs.readdirSync
under asar.