feat: support URL
s in cwd
option
#493
Open
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 supportsURL
s in thecwd
option, so for consistency I'm proposing adding it here too.Since
globby
uses this library, adding support for this here would meanglobby
could drop its custom handling ofURL
s, and as such it could drop one whole dependency inglobby
!!I've made sure the implementation is the same as what
globby
does.What changes did you make? (Give an overview)
I've changed the
Options
interface'scwd
property tostring | URL
, and changed the settings handler to convert theURL
to a string if applicable.I've also enabled
esModuleInterop
in thetsconfig.json
, since due to anfdir
update, it looks like typescript does not compile without this option enabled.Doing this required me to change the

snap-shot-it
import to a default import: