We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01c7d8c commit 1690ce2Copy full SHA for 1690ce2
src/curated-corpus/helpers/domainHelpers.ts
@@ -1,4 +1,4 @@
1
-import { parse } from 'tldts';
+import { getDomain } from 'tldts';
2
3
export interface DomainInfo {
4
/**
@@ -38,10 +38,8 @@ export function extractDomainInfo(url: string): DomainInfo {
38
const urlObj = new URL(url);
39
const hostname = urlObj.hostname;
40
41
- // Use tldts to parse domain components
42
- const parsed = parse(hostname);
43
-
44
- const registrableDomain = parsed.domain ?? null;
+ // Use tldts to get registrable domain
+ const registrableDomain = getDomain(hostname);
45
46
let subdomainHostname: string | null = null;
47
const hostnameWithoutWww = hostname.startsWith('www.')
0 commit comments