picomatch
picomatch copied to clipboard
TypeError when searching for prototype Object method
If you search for one of the protoype Object methods or properties, it'll throw an error because of an optimization in parse
:
input = REPLACEMENTS[input] || input;
Sample code:
> const pm = require('picomatch')
> pm('toString')
Thrown:
TypeError: output.startsWith is not a function
at Object.exports.removePrefix (/path/to/node_modules/picomatch/lib/utils.js:48:14)
at parse (/path/to/node_modules/picomatch/lib/parse.js:130:17)
at Function.picomatch.makeRe (/path/to/node_modules/picomatch/lib/picomatch.js:291:14)
at picomatch (/path/to/node_modules/picomatch/lib/picomatch.js:55:17)