-
Notifications
You must be signed in to change notification settings - Fork 294
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
optimisedGlob a full drop-in-replacement of globby #2381
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 87dc93f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
I left some comments about possible optimization, but they are optional, of course.
@@ -219,7 +238,12 @@ export async function optimisedGlob(globOrGlobs, providedOptions = {}) { | |||
options.onlyDirectories = true; | |||
} | |||
|
|||
const globs = Array.isArray(globOrGlobs) ? Array.from(new Set(globOrGlobs)) : [globOrGlobs]; | |||
const regularGlobs = Array.isArray(globOrGlobs) ? toUniqueArray(globOrGlobs) : [globOrGlobs]; |
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.
Did you mean to use ensureArray here?
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.
Also, toUniqueArray here seems not necessary as we do it anyway on L246.
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.
Thanks. Fixed 👍
3ef0b28
to
87dc93f
Compare
Make optimisedGlob a full drop-in-replacement of globby by also supporting
ignore:string[]
option