MCPcopy Create free account
hub / github.com/dailydotdev/apps / extractRootDomain

Function extractRootDomain

packages/playwright/tests/helpers.ts:3–13  ·  view source on GitHub ↗
(hostname: string)

Source from the content-addressed store, hash-verified

1export const TRACKING_COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 365 * 10;
2
3export const extractRootDomain = (hostname: string): string => {
4 const host = hostname.split(':')[0];
5 if (host === '127.0.0.1') {
6 return host;
7 }
8 const parts = host.split('.');
9 while (parts.length > 2) {
10 parts.shift();
11 }
12 return parts.join('.');
13};

Callers 2

tracking.setup.tsFile · 0.90
tracking.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected