From d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 10 Aug 2018 16:02:22 +0200 Subject: update main dependencies & fix autofixable eslint warnings (#601) --- server/sonar-web/src/main/js/helpers/cookies.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'server/sonar-web/src/main/js/helpers/cookies.ts') 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]; -- cgit v1.2.3