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

Function extractRootDomain

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

Source from the content-addressed store, hash-verified

3export const TRACKING_COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 365 * 10;
4
5export const extractRootDomain = (hostname: string): string => {
6 const host = hostname.split(':')[0];
7 if (host === '127.0.0.1') {
8 return host;
9 }
10 const parts = host.split('.');
11 while (parts.length > 2) {
12 parts.shift();
13 }
14 return parts.join('.');
15};
16
17export const getRequiredEnv = (name: 'USER_NAME' | 'PASSWORD'): string => {
18 const value = process.env[name];

Callers 2

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

Calls

no outgoing calls

Tested by

no test coverage detected