Skip to content

Commit 4b9b66d

Browse files
committed
Cast to string before passing input globs to slash
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 postcss#360 (comment)
1 parent 453aaec commit 4b9b66d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ Promise.resolve()
6363
}
6464

6565
if (input && input.length) {
66-
return globber(input.map(slash), { dot: argv.includeDotfiles })
66+
return globber(
67+
input.map((i) => slash(String(i))),
68+
{ dot: argv.includeDotfiles }
69+
)
6770
}
6871

6972
if (argv.replace || argv.dir) {

0 commit comments

Comments
 (0)