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
path: add matchesGlob
method
#52881
base: main
Are you sure you want to change the base?
path: add matchesGlob
method
#52881
Conversation
"Label PRs / label" appears to have crashed, so I manually labeled the PR. @nodejs/actions https://github.com/nodejs/node/actions/runs/8992208708/job/24701514516
|
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.
Imlementation LGTM. not sure about the naming though
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
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.
Please make it experimental.
Co-authored-by: Moshe Atlow <moshe@atlow.co.il>
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.
LGTM. (fix the missing import)
Failed to start CI⚠ Something was pushed to the Pull Request branch since the last approving review. ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/9017575572 |
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.
In the context of patterns, in the JS ecosystem, match()
typically returns a match object (e.g., String.prototype.match
). This should probably be matchesGlob()
instead if it returns a boolean.
c64cebc
to
448fc30
Compare
Fixes #52779
This PR adds
path.matchesGlob(path, pattern)
, which checks whether a glob (pattern
) matches the input path (path
).