MCPcopy Create free account
hub / github.com/DavidWells/analytics / getDomainBase

Function getDomainBase

packages/analytics-utils/src/url.js:28–31  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

26 * > my-site.com
27 */
28export function getDomainBase(url) {
29 const host = getDomainHost(url) || ''
30 return host.split('.').slice(-2).join('.')
31}
32
33/**
34 * Remove TLD from domain string

Callers 1

parseDomainFunction · 0.90

Calls 1

getDomainHostFunction · 0.85

Tested by

no test coverage detected