(cookieHeader: string | null, name: string)
| 2 | // SSR auth gate all need it). Pure string code — safe in any bundle. |
| 3 | |
| 4 | export const parseCookie = (cookieHeader: string | null, name: string): string | null => { |
| 5 | if (!cookieHeader) return null; |
| 6 | const match = cookieHeader |
| 7 | .split(";") |
| 8 | .map((c) => c.trim()) |
| 9 | .find((c) => c.startsWith(`${name}=`)); |
| 10 | if (!match) return null; |
| 11 | return match.slice(name.length + 1) || null; |
| 12 | }; |
no outgoing calls
no test coverage detected