(string: string)
| 16 | import fs from 'node:fs' |
| 17 | |
| 18 | export function isURI(string: string): boolean { |
| 19 | try { |
| 20 | const url = new URL(string) |
| 21 | return /^(http:|https:|mms:|mmsh:|rtsp:|rtmp:|srt:|rtp:|udp:)/.test(url.protocol) |
| 22 | } catch { |
| 23 | return false |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | export function normalizeURL(url: string): string { |
| 28 | const normalized = normalizeUrl(url, { stripWWW: false }) |