Skip to content

Commit

Permalink
fix(cache): check globalThis.caches (#2444)
Browse files Browse the repository at this point in the history
* fix(cache): check `global.caches`

* denoify

* use `globalThis`
  • Loading branch information
yusukebe authored Mar 31, 2024
1 parent d0e44d0 commit 78171ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deno_dist/middleware/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const cache = (options: {
wait?: boolean
cacheControl?: string
}): MiddlewareHandler => {
if (!caches) {
if (!globalThis.caches) {
console.log('Cache Middleware is not enabled because caches is not defined.')
return async (_c, next) => await next()
}
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const cache = (options: {
wait?: boolean
cacheControl?: string
}): MiddlewareHandler => {
if (!caches) {
if (!globalThis.caches) {
console.log('Cache Middleware is not enabled because caches is not defined.')
return async (_c, next) => await next()
}
Expand Down

0 comments on commit 78171ee

Please sign in to comment.