Closed intrnl closed 1 year ago
Hi @intrnl,
Thanks for reaching out. I think the confusion comes from the fact that there are two sections in the public suffix list:
.co.uk
is in this section).pages.dev
is in this section)By default, tldts will only consider the former (ICANN) when looking up publix suffix. The reason is that historically this is the behavior that is expected most of the time by default. If you wanna look suffixes from both sections you can use the option { allowPrivateDomains: true }
with any tldts function. For example:
import { parse } from "tldts";
parse("https://foo.pages.dev/", { allowPrivateDomains: true });
I hope that helps,
ooh, thank you, i've completely missed this. works as expected
I'm a little confused over how the library matches public suffixes, I can see that
pages.dev
is in the public suffix list, however the publicSuffix would only bedev
whereasco.uk
would beco.uk
, is there something I'm misunderstanding here?