MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / parseReferrer

Function parseReferrer

packages/common/server/parse-referrer.ts:17–26  ·  view source on GitHub ↗
(url: string | undefined)

Source from the content-addressed store, hash-verified

15}
16
17export function parseReferrer(url: string | undefined) {
18 const hostname = getHostname(url);
19 const match = referrers[hostname] ?? referrers[hostname.replace('www.', '')];
20
21 return {
22 name: match?.name ?? '',
23 type: match?.type ?? '',
24 url: stripTrailingSlash(url ?? ''),
25 };
26}
27
28export function getReferrerWithQuery(
29 query: Record<string, string> | undefined,

Callers 5

transformEventMethod · 0.90
transformEventMethod · 0.90
transformEventMethod · 0.90
incomingEventFunction · 0.90

Calls 3

stripTrailingSlashFunction · 0.90
getHostnameFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected