UNPKG

@splode/obake

Version:

Check merchants for deals.

11 lines (10 loc) 281 B
/** * getHost returns the host from a given URL. For example, `"https://example.com"` would return `"example.com"` * * @param str A URL string * @returns The URL's host */ export default function getHost(str: string): string { const u = new URL(str); return u.hostname; }