Closed vinayakwadhwa closed 2 years ago
.gov.uk
is listed in the public suffix list and thus the effective top-level domain (see this for clarification).
You're probably looking for result.icann
:
const parseResult = parseDomain("something.gov.uk");
const { subDomains, domain, topLevelDomains } = parseResult.icann;
console.log(subDomains); // ["something"]
console.log(domain); // "gov"
console.log(topLevelDomains); // ["uk"]
both gov and uk are considered as TLDs instead of gov being treated as domain