diff options
Diffstat (limited to 'std/path/win32.ts')
-rw-r--r-- | std/path/win32.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/std/path/win32.ts b/std/path/win32.ts index 66ed1ff14..cf0e69537 100644 --- a/std/path/win32.ts +++ b/std/path/win32.ts @@ -914,7 +914,7 @@ export function parse(path: string): ParsedPath { * are ignored. */ export function fromFileUrl(url: string | URL): string { - return new URL(String(url)).pathname + return (url instanceof URL ? url : new URL(url)).pathname .replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/") .replace(/\//g, "\\"); } |