Sha256: f332104b20a0e190b0531056a15acdb35ecd796d5b866f4408be802bca8fbb3f
Contents?: true
Size: 299 Bytes
Versions: 26
Compression:
Stored size: 299 Bytes
Contents
/** * Returns a boolean indicating whether the given URL string * can be parsed into a `URL` instance. * A substitute for `URL.canParse()` for Node.js 18. */ export function canParseUrl(url: string): boolean { try { new URL(url) return true } catch (_error) { return false } }
Version data entries
26 entries across 26 versions & 1 rubygems