(url: string | undefined)
| 15 | } |
| 16 | |
| 17 | export 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 | |
| 28 | export function getReferrerWithQuery( |
| 29 | query: Record<string, string> | undefined, |
no test coverage detected