diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-08-10 16:02:22 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-08-10 20:21:32 +0200 |
commit | d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4 (patch) | |
tree | 03ad7aa9ab7d9bcfb0f5b354149da9c014052010 /server/sonar-web/src/main/js/helpers/cookies.ts | |
parent | 29b5f4a0ebf686f9dee7f1d6c6eab65fe381654d (diff) | |
download | sonarqube-d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4.tar.gz sonarqube-d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4.zip |
update main dependencies & fix autofixable eslint warnings (#601)
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, 11 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/helpers/cookies.ts b/server/sonar-web/src/main/js/helpers/cookies.ts index 9d6dabbe266..3c37516c6fd 100644 --- a/server/sonar-web/src/main/js/helpers/cookies.ts +++ b/server/sonar-web/src/main/js/helpers/cookies.ts @@ -19,15 +19,17 @@ */ import { memoize } from 'lodash'; -const parseCookies = memoize((documentCookie: string): { [key: string]: string } => { - const rawCookies = documentCookie.split('; '); - const cookies: { [key: string]: string } = {}; - rawCookies.forEach(candidate => { - const [key, value] = candidate.split('='); - cookies[key] = value; - }); - return cookies; -}); +const parseCookies = memoize( + (documentCookie: string): { [key: string]: string } => { + const rawCookies = documentCookie.split('; '); + const cookies: { [key: string]: 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]; |