Skip to main content

url-to-domain

Documentation / extractor/html-to-cite/url-to-domain

convertURLToDomain()​

function convertURLToDomain(domain: string): string;

Defined in: extractor/html-to-cite/url-to-domain.js:10

Extract TLD and hostname from domain in Regex. There's two or more part TLDs so it is hard to tell if host.secondTLD.tld or host.tld is correct way to get root domain (e.g. abc.go.jp, abc.co.uk)

Parameters​

ParameterTypeDescription

domain

string

Returns​

string

rootDomain