upd(utils/path): resolve 方法增加默认当前目录

This commit is contained in:
purocean
2021-11-02 17:24:59 +08:00
parent ec63602e15
commit 6ff1492ef7
+4 -1
View File
@@ -5,9 +5,12 @@ export const {
extname,
dirname,
join,
resolve,
} = Path
export function resolve (...args: string[]) {
return Path.resolve('/', ...args)
}
export function relative (from: string, to: string) {
return Path.relative(
from.startsWith('/') ? from : ('/' + from),