UNPKG

parse-domain

Version:

Splits a hostname into subdomains, domain and (effective) top-level domains

10 lines 442 B
import { ok } from "node:assert"; import { FETCH_PSL_EXPECTED_MIN_LENGTH, PUBLIC_SUFFIX_URL } from "../config.js"; export const fetchPsl = async () => { const response = await fetch(PUBLIC_SUFFIX_URL); const pslContent = await response.text(); // Sanity check ok(pslContent.length >= FETCH_PSL_EXPECTED_MIN_LENGTH, "Public suffix list is shorter than expected"); return pslContent; }; //# sourceMappingURL=fetch-psl.js.map