fs: apply function exclude to glob results#63049
fs: apply function exclude to glob results#63049Kelpy2004 wants to merge 1 commit intonodejs:mainfrom
Conversation
4882cfd to
de11752
Compare
|
I pushed an update that adds coverage for The currently visible GitHub Actions runs are all Local validation:
|
|
@mcollina when you have a moment, could you please take a look at this The GitHub Actions runs are currently waiting for maintainer approval on this forked PR, so a review/CI approval would be appreciated. Happy to adjust the patch if you prefer a different shape before merge. |
de11752 to
88d0ea5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63049 +/- ##
==========================================
+ Coverage 89.66% 89.69% +0.03%
==========================================
Files 706 712 +6
Lines 219370 221268 +1898
Branches 42065 42397 +332
==========================================
+ Hits 196694 198464 +1770
- Misses 14586 14627 +41
- Partials 8090 8177 +87
🚀 New features to boost your workflow:
|
Signed-off-by: Aryan Katiyar <aryankatiyar613@gmail.com>
88d0ea5 to
f8c0188
Compare
Function-form
excludecallbacks were applied while queuing subpatterns, but some terminal result paths were added directly to the result set. That meant files matched by terminal**or terminal child patterns could bypass anexclude(path)callback that matched the full relative path.For example,
globSync('**', { cwd, exclude: (path) => path === 'a/skip.txt' })could still includea/skip.txt.This routes result additions through a shared helper that applies function-form excludes before recording sync and async glob results, while preserving the existing array-exclude filtering in
ResultSet.Added coverage for:
fs.globSync()fs.glob()fs.promises.glob()**resultsValidation performed locally:
node --check lib/internal/fs/glob.jsnode --check test/parallel/test-fs-glob.mjsI could not run the patched Node test binary because this sparse checkout does not include a built local
nodeexecutable.