Uh oh!
There was an error while loading. Please reload this page.
path: add exclude option to matchesGlob method - #59061
Conversation
Add support for exclude patterns in path.matchesGlob() to provide consistency with fs.glob(). The exclude option accepts strings, arrays, or functions to filter out matching paths. Fixes: nodejs#59015
This pull request has been marked as stale due to 210 days of inactivity. |
Is an Happy to rewrite this on top of the current matcher cache if a collaborator thinks it is worth having, and equally happy to close it if in-memory path matching should stay minimal and |
This PR enhances the path.matchesGlob() method by adding comprehensive exclude pattern support to provide feature parity with fs.glob() and improve developer experience when filtering paths.
In the current implementation, path.matchesGlob() lacks advanced filtering capabilities, making it difficult for developers to exclude specific paths or directory trees without writing complex, error-prone manual exclusion logic. This limitation creates inconsistency between path matching utilities and forces code duplication across projects.
The updated implementation now includes:
This change resolves#59015 by providing the requested exclude functionality that allows developers to efficiently filter paths without manually implementing complex exclusion patterns, bringing path.matchesGlob() to feature parity with other Node.js glob utilities.