summaryrefslogtreecommitdiff
path: root/cli/js/web
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/web')
-rw-r--r--cli/js/web/url.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/js/web/url.ts b/cli/js/web/url.ts
index 6a8dc6627..3d513a010 100644
--- a/cli/js/web/url.ts
+++ b/cli/js/web/url.ts
@@ -356,7 +356,7 @@ export class URLImpl implements URL {
return this.#searchParams;
}
- constructor(url: string, base?: string | URL) {
+ constructor(url: string | URL, base?: string | URL) {
let baseParts: URLParts | undefined;
if (base) {
baseParts = typeof base === "string" ? parse(base) : parts.get(base);
@@ -365,7 +365,7 @@ export class URLImpl implements URL {
}
}
- const urlParts = parse(url);
+ const urlParts = typeof url === "string" ? parse(url) : parts.get(url);
if (!urlParts) {
throw new TypeError("Invalid URL.");
}