feat: support URLs in cwd option
#493
Open
+17
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Hi! Every big glob library (
glob,globby,tinyglobby) except this one supportsURLs in thecwdoption, so for consistency I'm proposing adding it here too.Since
globbyuses this library, adding support for this here would meanglobbycould drop its custom handling ofURLs, and as such it could drop one whole dependency inglobby!!I've made sure the implementation is the same as what
globbydoes.What changes did you make? (Give an overview)
I've changed the
Optionsinterface'scwdproperty tostring | URL, and changed the settings handler to convert theURLto a string if applicable.I've also enabled
esModuleInteropin thetsconfig.json, since due to anfdirupdate, it looks like typescript does not compile without this option enabled.Doing this required me to change the

snap-shot-itimport to a default import: