Skip to content

Commit ce44c14

Browse files
committed
refactor: style
1 parent fabacd2 commit ce44c14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ module.exports = ({
6565

6666
const cachedData = await cache.get(key)
6767
const hasData = cachedData !== undefined
68+
const isHit = !hasForce && hasData
69+
6870
const cachedResult =
6971
compress && hasData ? JSON.parse(await brotliDecompress(cachedData)) : cachedData
70-
const isHit = !hasForce && hasData
7172

7273
const { etag: cachedEtag, ttl = defaultTtl, createdAt = Date.now(), data, ...props } = isHit
73-
? cachedResult || {}
74+
? cachedResult
7475
: await get({ req, res, ...opts })
7576

7677
const etag = cachedEtag || getEtag(data)

0 commit comments

Comments
 (0)