fix: Handle Windows path separators (#675) @Larsluph

This commit is contained in:
Rémi Marseault 2023-02-22 21:41:53 +01:00 committed by GitHub
parent 141318affc
commit f4646e2e66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,7 +60,7 @@ export function treeify(paths) {
const level = { result }
paths.forEach(path => {
path.name.split('/').reduce((r, name) => {
path.name.split('\\').join('/').split('/').reduce((r, name) => {
if (!r[name]) {
r[name] = { result: [] }
r.result.push(createFile(path, name, r[name].result))