url/extract: convert input to URL object if passed as string
This commit is contained in:
parent
5199b3d8fd
commit
03b1248b5f
1 changed files with 4 additions and 0 deletions
|
@ -127,6 +127,10 @@ export function normalizeURL(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function extract(url) {
|
export function extract(url) {
|
||||||
|
if (!(url instanceof URL)) {
|
||||||
|
url = new URL(url);
|
||||||
|
}
|
||||||
|
|
||||||
const host = getHostIfValid(url);
|
const host = getHostIfValid(url);
|
||||||
|
|
||||||
if (!host || !services[host].enabled) {
|
if (!host || !services[host].enabled) {
|
||||||
|
|
Loading…
Reference in a new issue