Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
*/
28
export
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
parseDomain
Function · 0.90
Calls
1
getDomainHost
Function · 0.85
Tested by
no test coverage detected