-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
fs: add support for minimatch overrides #52789
Conversation
@@ -200,6 +202,7 @@ class Glob { | |||
optimizationLevel: 2, | |||
platform: process.platform, | |||
nocaseMagicOnly: true, | |||
...overrides, |
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.
Can you add a test?
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
@@ -1082,6 +1082,8 @@ added: v22.0.0 | |||
* `cwd` {string} current working directory. **Default:** `process.cwd()` | |||
* `exclude` {Function} Function to filter out files/directories. Return | |||
`true` to exclude the item, `false` to include it. **Default:** `undefined`. | |||
* `overrides` {Object} override the default `minimatch` behavior with |
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.
Opinion only, I don't think Node.js
should expose API like this.
It means this API will always be tie to minimatch
and will becomes a resistance on enhancement or provide node
vendor-ed one.
If folks want to expose minimatch's API details to Node.js users, why is there |
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.
minimatch options are not necessarily bound to our semver release cycle, and are not tested individually.
if we want to support additional options, we should add them one by one - with individual tests and documentation for each of these options
I also am not sure this is the ask in #52779 - see #52779 (comment) |
I believe it more like to ask support for glob string or array in the exclude option. |
Yes, that sounds like a better idea. |
This PR adds an additional
overrides
parameter to theoptions
argument offs.glob
. This allows users to override the defaultminimatch
glob options.Fixes #52779