From ebff2ac9f25eb281c707ec61c3fbbdcc936e81a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Tue, 15 Oct 2019 13:27:40 +0200 Subject: [PATCH] Please JSHint --- lib/api/middlewares/cache-control-header.js | 7 ++++++- test/acceptance/cache/cache-control-header-test.js | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/api/middlewares/cache-control-header.js b/lib/api/middlewares/cache-control-header.js index a72bdea3..84b7a360 100644 --- a/lib/api/middlewares/cache-control-header.js +++ b/lib/api/middlewares/cache-control-header.js @@ -27,7 +27,12 @@ module.exports = function setCacheControlHeader ({ revalidate = false } = {}) { if (!validFallbackTTL.includes(fallbackTtl)) { - throw new Error(`Invalid fallback TTL value for Cache-Control header. Got ${fallbackTtl}, expected ${validFallbackTTL.join(', ')}`); + const message = [ + 'Invalid fallback TTL value for Cache-Control header.', + `Got ${fallbackTtl}, expected ${validFallbackTTL.join(', ')}` + ].join(' '); + + throw new Error(message); } return function setCacheControlHeaderMiddleware (req, res, next) { diff --git a/test/acceptance/cache/cache-control-header-test.js b/test/acceptance/cache/cache-control-header-test.js index d761b6ef..3094c8a2 100644 --- a/test/acceptance/cache/cache-control-header-test.js +++ b/test/acceptance/cache/cache-control-header-test.js @@ -80,8 +80,8 @@ describe('cache-control header', function () { } const cacheControl = res.headers['cache-control']; - const [ type, maxAge ] = cacheControl.split(','); - const [ key, value ] = maxAge.split('='); + const [ , maxAge ] = cacheControl.split(','); + const [ , value ] = maxAge.split('='); assert.ok(Number(value) <= ttl); @@ -120,8 +120,8 @@ describe('cache-control header', function () { } const cacheControl = res.headers['cache-control']; - const [ type, maxAge ] = cacheControl.split(','); - const [ key, value ] = maxAge.split('='); + const [ , maxAge ] = cacheControl.split(','); + const [ , value ] = maxAge.split('='); assert.ok(Number(value) <= ttl);