attempting to retain root slash in unix systems

This commit is contained in:
ThatBen 2025-04-02 11:25:33 +02:00
parent 5df758b4f6
commit 2b4fd7f456
No known key found for this signature in database
GPG Key ID: E020A7DDCD52E1AB

View File

@ -58,7 +58,11 @@ export class PathSelector {
};
splitPath = (str) => {
return str.replaceAll("\\", "/").split("/");
var result = str.replaceAll("\\", "/").split("/");
if (str.startsWith("/") && this.roots.includes("/")) {
result = ["/", ...result];
}
return result;
};
dropEmptyParts = (parts) => {