From 4b9b66d5338b925ec6b52e2fd4bb1e5901038fbc Mon Sep 17 00:00:00 2001 From: Ryan Zimmerman Date: Thu, 3 Dec 2020 12:54:07 -0500 Subject: [PATCH] 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 https://github.com/postcss/postcss-cli/issues/360#issuecomment-738157557 --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 47a6e5a..0bab158 100644 --- a/index.js +++ b/index.js @@ -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) {