MCPcopy Index your code
hub / github.com/angular/angular / parseCookieValue

Function parseCookieValue

packages/common/src/cookie.ts:9–20  ·  view source on GitHub ↗
(cookieStr: string, name: string)

Source from the content-addressed store, hash-verified

7 */
8
9export function parseCookieValue(cookieStr: string, name: string): string | null {
10 name = encodeURIComponent(name);
11 for (const cookie of cookieStr.split(';')) {
12 const eqIndex = cookie.indexOf('=');
13 const [cookieName, cookieValue]: string[] =
14 eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];
15 if (cookieName.trim() === name) {
16 return decodeURIComponent(cookieValue);
17 }
18 }
19 return null;
20}

Callers 3

cookie_spec.tsFile · 0.90
getCookieMethod · 0.85
getTokenMethod · 0.85

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…