Skip to content

Commit

Permalink
feat: parse()
Browse files Browse the repository at this point in the history
  • Loading branch information
VirgilClyne committed Nov 11, 2024
1 parent e1fda7d commit 803f011
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions URL.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export declare class URL {
get searchParams(): URLSearchParams;
get username(): string;
set username(value: string);
static parse: (url: string, base?: string) => URL;
/**
* Returns the string representation of the URL.
*
Expand Down
1 change: 1 addition & 0 deletions URL.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export class URL {
set username(value) {
this.#url.username = value ?? "";
}
static parse = (url, base) => new URL(url, base);
/**
* Returns the string representation of the URL.
*
Expand Down
2 changes: 2 additions & 0 deletions URL.mts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export class URL {
this.#url.username = value ?? "";
}

static parse = (url: string, base?: string) => new URL(url, base);

/**
* Returns the string representation of the URL.
*
Expand Down

0 comments on commit 803f011

Please sign in to comment.