Files
recflare/apps/example-worker-echoback/src/url.ts
T
Devin Zuczek 8e644a5c20 Initial commit
2026-06-08 18:23:40 -04:00

6 lines
217 B
TypeScript

/** Get hostname from url in lower case */
export function getUrlHostname(url: string | URL): string {
const hostname = typeof url === 'string' ? new URL(url).hostname : url.hostname
return hostname.toLowerCase()
}