UNPKG

@ocap/util

Version:

utils shared across multiple forge js libs, works in both node.js and browser

17 lines (16 loc) 625 B
import ipaddr from "ipaddr.js"; //#region src/url.d.ts declare function parseIp(host: string): ipaddr.IPv4 | ipaddr.IPv6 | null; declare function isUnicastAddress(host: string): boolean; declare function resolveHostAddresses(host: string): Promise<string[]>; interface VerifyUrlOptions { allowIp?: boolean; maxLength?: number; protocols?: string[]; blockedHosts?: string[]; blockedSuffixes?: string[]; checkDns?: boolean; } declare function verifyUrl(url: string, options?: VerifyUrlOptions): Promise<boolean>; //#endregion export { VerifyUrlOptions, isUnicastAddress, parseIp, resolveHostAddresses, verifyUrl };