tldts
tldts copied to clipboard
`isIcann` returns true or false when there's no valid extension
parse('https://google.');
// returns
{
"domain": null,
"domainWithoutSuffix": null,
"hostname": "google",
"isIcann": true, // incorrect
"isIp": false,
"isPrivate": false,
"publicSuffix": "google",
"subdomain": null
}
parse('https://googles.');
// returns
{
"domain": null,
"domainWithoutSuffix": null,
"hostname": "googles",
"isIcann": false, // correct
"isIp": false,
"isPrivate": false,
"publicSuffix": "googles",
"subdomain": null
}
"tldts": "7.0.9",
Hi @seahindeniz, google is a valid public suffix: https://github.com/publicsuffix/list/blob/9ae55199aa39694b19b7791d2e7b0b7592b3bdd7/public_suffix_list.dat#L8388
So I think the output above is correct.
I see but google is not actually a suffix in this context 🤔 I'm not sure if it parsed correctly to be evaluated as suffix
It is, a domain can end with a . so https://google. is interpreted as a domain wit has single label (google) which happens to be a valid public suffix.