-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
fs: add support for URL
for fs.glob
's cwd
option
#58182
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58182 +/- ##
=======================================
Coverage 90.14% 90.14%
=======================================
Files 630 630
Lines 186784 186785 +1
Branches 36653 36654 +1
=======================================
+ Hits 168377 168379 +2
- Misses 11205 11210 +5
+ Partials 7202 7196 -6
🚀 New features to boost your workflow:
|
@@ -268,7 +269,7 @@ class Glob { | |||
constructor(pattern, options = kEmptyObject) { | |||
validateObject(options, 'options'); | |||
const { exclude, cwd, withFileTypes } = options; | |||
this.#root = cwd ?? '.'; |
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.
Nit: These additions make optimizations extremely hard. We should avoid adding them.
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.
You're commenting on a deleted line, it's not very clear what you mean
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.
Adding a URL support to input field
For the sake of consistency, all the Node.js APIs that take a path also accept
URL
instances.