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

fsPromises.glob doesn't call exclude with dirent when called withFileTypes: true #53821

Closed
targos opened this issue Jul 12, 2024 · 3 comments
Closed
Assignees
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. repro-exists Issues with reproductions.

Comments

@targos
Copy link
Member

targos commented Jul 12, 2024

Version

22.4.0

Platform

Darwin Targos-MBP.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020 arm64

Subsystem

fs

What steps will reproduce the bug?

mkdir -p a/b
node -e "Array.fromAsync(require('fs/promises').glob('a/**', { withFileTypes: true, exclude: console.log }))"

How often does it reproduce? Is there a required condition?

Always reproduces when withFileTypes is true.

What is the expected behavior? Why is that the expected behavior?

It should log a Dirent for the b directory.

What do you see instead?

It only prints "b"

Additional information

fs.globSync is not affected:

$ node -e "require('fs').globSync('a/**', { withFileTypes: true, exclude: console.log })"       
Dirent {
  name: 'b',
  parentPath: '/tmp/a',
  path: '/tmp/a',
  [Symbol(type)]: 2
}
@targos targos added the fs Issues and PRs related to the fs subsystem / file system. label Jul 12, 2024
@RedYetiDev RedYetiDev added the repro-exists Issues with reproductions. label Jul 12, 2024
@RedYetiDev RedYetiDev self-assigned this Jul 12, 2024
@RedYetiDev
Copy link
Member

RedYetiDev commented Jul 12, 2024

I'm able to reproduce with the snippet you provided.

@RedYetiDev
Copy link
Member

Fixed by #53823

@RedYetiDev
Copy link
Member

Fixed by #53823

Closing, as the PR has landed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. repro-exists Issues with reproductions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants