Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const parts = []
for (let i = 0; i < pathArr.length; i++) {
let p = pathArr[i]
while (p[p.length - 1] === '\\' && pathArr[i + 1] !== undefined) {
p = p.slice(0, -1) + '.'
p += pathArr[++i]
}
parts.push(p)
}
PathCache.set(path, parts)
return parts
}
if (isNum(path)) {
return [path as number]
}
return []
}