File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
packages/nuxt/src/runtime/plugins Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -253,14 +253,14 @@ const CACHED_FN_HANDLERS_RE = /^nitro:(functions|handlers):/i;
253253 * First we check if the key matches the `defineCachedFunction` or `defineCachedEventHandler` key patterns, and if so we check the cached value.
254254 */
255255function isCacheHit ( key : string , value : unknown ) : boolean {
256- const isEmpty = isEmptyValue ( value ) ;
257- // Empty value means no cache hit either way
258- // Or if key doesn't match the cached function or handler patterns, we can return the empty value check
259- if ( isEmpty || ! CACHED_FN_HANDLERS_RE . test ( key ) ) {
260- return ! isEmpty ;
261- }
262-
263256 try {
257+ const isEmpty = isEmptyValue ( value ) ;
258+ // Empty value means no cache hit either way
259+ // Or if key doesn't match the cached function or handler patterns, we can return the empty value check
260+ if ( isEmpty || ! CACHED_FN_HANDLERS_RE . test ( key ) ) {
261+ return ! isEmpty ;
262+ }
263+
264264 return validateCacheEntry ( key , JSON . parse ( String ( value ) ) as CacheEntry ) ;
265265 } catch ( error ) {
266266 // this is a best effort, so we return false if we can't validate the cache entry
You can’t perform that action at this time.
0 commit comments