fix: safe path join

This commit is contained in:
charlie
2022-08-17 15:23:51 +08:00
committed by Andelf
parent 1a6379f118
commit 5373da2deb
2 changed files with 5 additions and 5 deletions

View File

@@ -317,7 +317,8 @@ export const nodePath = Object.assign({}, path, {
try {
orURI = new URL(input)
input = orURI.pathname
input = input.replace(orURI.protocol, '')
.replace(/^\/+/, '/')
} catch (_e) {}
input = path.join(input, ...paths)