function youtubeHost
youtubeHost(u: URL): string | null

Returns u's host in lower case and without "www.", when it is one of YouTube's (youtu.be aside), and null otherwise. The YouTube preview provider uses it too, so both agree on what a YouTube link is.

Parameters

Return Type

string | null

Usage

import { youtubeHost } from "api/lib/canonical-url.ts";