Skip to content

Commit

Permalink
Cast to string before passing input globs to slash
Browse files Browse the repository at this point in the history
If a number is passed as a positional argument, yargs interprets
it as a JS Number, and slash tries to call .replace() on it, which
fails. This ensures slash only gets strings passed to it.

Refs #360 (comment)
  • Loading branch information
RyanZim committed Dec 3, 2020
1 parent 453aaec commit 4b9b66d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Expand Up @@ -63,7 +63,10 @@ Promise.resolve()
}

if (input && input.length) {
return globber(input.map(slash), { dot: argv.includeDotfiles })
return globber(
input.map((i) => slash(String(i))),
{ dot: argv.includeDotfiles }
)
}

if (argv.replace || argv.dir) {
Expand Down

0 comments on commit 4b9b66d

Please sign in to comment.