mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05: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
2
cli/js/lib.deno.shared_globals.d.ts
vendored
2
cli/js/lib.deno.shared_globals.d.ts
vendored
|
@ -1172,7 +1172,7 @@ interface URL {
|
||||||
|
|
||||||
declare const URL: {
|
declare const URL: {
|
||||||
prototype: URL;
|
prototype: URL;
|
||||||
new (url: string | URL, base?: string | URL): URL;
|
new (url: string, base?: string | URL): URL;
|
||||||
createObjectURL(object: any): string;
|
createObjectURL(object: any): string;
|
||||||
revokeObjectURL(url: string): void;
|
revokeObjectURL(url: string): void;
|
||||||
};
|
};
|
||||||
|
|
|
@ -430,5 +430,5 @@ export function parse(path: string): ParsedPath {
|
||||||
* are ignored.
|
* are ignored.
|
||||||
*/
|
*/
|
||||||
export function fromFileUrl(url: string | URL): string {
|
export function fromFileUrl(url: string | URL): string {
|
||||||
return new URL(url).pathname;
|
return new URL(url.toString()).pathname;
|
||||||
}
|
}
|
||||||
|
|
|
@ -908,7 +908,7 @@ export function parse(path: string): ParsedPath {
|
||||||
* are ignored.
|
* are ignored.
|
||||||
*/
|
*/
|
||||||
export function fromFileUrl(url: string | URL): string {
|
export function fromFileUrl(url: string | URL): string {
|
||||||
return new URL(url).pathname
|
return new URL(url.toString()).pathname
|
||||||
.replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/")
|
.replace(/^\/*([A-Za-z]:)(\/|$)/, "$1/")
|
||||||
.replace(/\//g, "\\");
|
.replace(/\//g, "\\");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue