mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
some styling cleanup
This commit is contained in:
@@ -6,16 +6,19 @@ export const urlShim = {
|
||||
// Return an object with .href matching Node's url.pathToFileURL behavior
|
||||
const encoded = encodeURI(p.replace(/\\/g, "/"));
|
||||
const href = "file:///" + encoded.replace(/^\/+/, "");
|
||||
|
||||
return { href, toString: () => href };
|
||||
},
|
||||
|
||||
fileURLToPath(url) {
|
||||
let str = typeof url === "string" ? url : url.href || url.toString();
|
||||
|
||||
if (str.startsWith("file:///")) {
|
||||
str = str.slice(8);
|
||||
} else if (str.startsWith("file://")) {
|
||||
str = str.slice(7);
|
||||
}
|
||||
|
||||
return decodeURI(str);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user