1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | // We want only the final segment of a domain, without any
|
4 | // preceding subdomains. However, we do keep leading `.` when
|
5 | // subdomains exist.
|
6 | function getRootDomain(domain) {
|
7 | var parts = domain.split('.');
|
8 | var baseDomainOnly = parts.slice(-2).join('.');
|
9 | return parts.length > 2 ? "." + baseDomainOnly : baseDomainOnly;
|
10 | }
|
11 | exports.getRootDomain = getRootDomain;
|
12 | function noop() { }
|
13 | exports.noop = noop;
|