* The `parent` query param required by Twitch embeds. Reads the current host in * the browser and falls back to `localhost` during SSR.
()
| 14 | * the browser and falls back to `localhost` during SSR. |
| 15 | */ |
| 16 | function getTwitchParent(): string { |
| 17 | return typeof window !== 'undefined' ? window.location.hostname : 'localhost' |
| 18 | } |
| 19 | |
| 20 | /** Parse a URL, tolerating scheme-less inputs (https is assumed). Returns null if unparseable. */ |
| 21 | function parseUrl(url: string): URL | null { |