UNPKG

@startpage/search

Version:

Provides a function to search the web

15 lines (14 loc) 345 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isWebUrl = void 0; const isWebUrl = (value) => { let url; try { url = new URL(value); } catch { return false; } return url.protocol === "http:" || url.protocol === "https:"; }; exports.isWebUrl = isWebUrl;