cacheable-response
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="1.3.1"></a> | ||
## [1.3.1](https://github.com/Kikobeats/cacheable-response/compare/v1.3.0...v1.3.1) (2019-03-29) | ||
<a name="1.3.0"></a> | ||
@@ -7,0 +12,0 @@ # [1.3.0](https://github.com/Kikobeats/cacheable-response/compare/v1.2.1...v1.3.0) (2019-03-28) |
@@ -68,8 +68,9 @@ 'use strict' | ||
const hasData = cachedData !== undefined | ||
const isHit = !hasForce && hasData | ||
const cachedResult = | ||
compress && hasData ? JSON.parse(await brotliDecompress(cachedData)) : cachedData | ||
const isHit = !hasForce && hasData | ||
const { etag: cachedEtag, ttl = defaultTtl, createdAt = Date.now(), data, ...props } = isHit | ||
? cachedResult || {} | ||
? cachedResult | ||
: await get({ req, res, ...opts }) | ||
@@ -76,0 +77,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://nicedoc.io/Kikobeats/cacheable-response", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "author": { |
19553