We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 457f595 commit 00b5cdaCopy full SHA for 00b5cda
lib/index.js
@@ -31,11 +31,7 @@ const getPathInfo = (cmd, {
31
if (isWindows) {
32
const pathExtExe = optPathExt ||
33
['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)
34
- const pathExt = pathExtExe.split(optDelimiter).reduce((acc, item) => {
35
- acc.push(item)
36
- acc.push(item.toLowerCase())
37
- return acc
38
- }, [])
+ const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()])
39
if (cmd.includes('.') && pathExt[0] !== '') {
40
pathExt.unshift('')
41
}
0 commit comments