添加filesystem

This commit is contained in:
2025-04-14 18:04:04 +08:00
parent 3b2e72127f
commit b76a685988
18 changed files with 1173 additions and 25 deletions

View File

@ -0,0 +1,18 @@
/* eslint-disable import/prefer-default-export */
export function joinPath(...paths: string[]): string {
let path = "";
paths.forEach((value) => {
if (!value) {
return;
}
if (!value.startsWith("/")) {
value = `/${value}`;
}
if (value.endsWith("/")) {
value = value.substring(0, value.length - 1);
}
path += value;
});
return path;
}