mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
Fix definition of URL constructor (#5521)
This commit is contained in:
parent
4db4a7fbcc
commit
63bc468365
3 changed files with 3 additions and 3 deletions
|
@ -908,7 +908,7 @@ export function parse(path: string): ParsedPath {
|
|||
* are ignored.
|
||||
*/
|
||||
export function fromFileUrl(url: string | URL): string {
|
||||
return new URL(url).pathname
|
||||
return new URL(url.toString()).pathname
|
||||
.replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/")
|
||||
.replace(/\//g, "\\");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue