mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-29 09:58:27 +00:00
url/extract: convert input to URL object if passed as string
This commit is contained in:
parent
5199b3d8fd
commit
03b1248b5f
@ -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 New Issue
Block a user