diff options
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/cookies.ts')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/cookies.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/helpers/cookies.ts b/server/sonar-web/src/main/js/helpers/cookies.ts index 8b949b95c22..d0d226abdec 100644 --- a/server/sonar-web/src/main/js/helpers/cookies.ts +++ b/server/sonar-web/src/main/js/helpers/cookies.ts @@ -20,17 +20,15 @@ import { memoize } from 'lodash'; import { Dict } from '../types/types'; -const parseCookies = memoize( - (documentCookie: string): Dict<string> => { - const rawCookies = documentCookie.split('; '); - const cookies: Dict<string> = {}; - rawCookies.forEach(candidate => { - const [key, value] = candidate.split('='); - cookies[key] = value; - }); - return cookies; - } -); +const parseCookies = memoize((documentCookie: string): Dict<string> => { + const rawCookies = documentCookie.split('; '); + const cookies: Dict<string> = {}; + rawCookies.forEach((candidate) => { + const [key, value] = candidate.split('='); + cookies[key] = value; + }); + return cookies; +}); export function getCookie(name: string): string | undefined { return parseCookies(document.cookie)[name]; |