diff options
Diffstat (limited to 'std/path')
-rw-r--r-- | std/path/posix.ts | 2 | ||||
-rw-r--r-- | std/path/win32.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/std/path/posix.ts b/std/path/posix.ts index 365232e33..1e78d1cfe 100644 --- a/std/path/posix.ts +++ b/std/path/posix.ts @@ -435,5 +435,5 @@ export function parse(path: string): ParsedPath { * are ignored. */ export function fromFileUrl(url: string | URL): string { - return new URL(url).pathname; + return new URL(String(url)).pathname; } diff --git a/std/path/win32.ts b/std/path/win32.ts index 8e438a79c..bac43a61a 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(url).pathname + return new URL(String(url)).pathname .replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/") .replace(/\//g, "\\"); } |