Base url that works everywhere in mocks

This commit is contained in:
Joseph Garrone
2024-02-10 19:51:24 +01:00
parent db0dc96cc7
commit bda76200d7
6 changed files with 49 additions and 20 deletions

View File

@ -1,6 +0,0 @@
export function pathJoin(...path: string[]): string {
return path
.map((part, i) => (i === 0 ? part : part.replace(/^\/+/, "")))
.map((part, i) => (i === path.length - 1 ? part : part.replace(/\/+$/, "")))
.join(typeof process !== "undefined" && process.platform === "win32" ? "\\" : "/");
}