@@ -64,8 +64,10 @@ export default defineNitroPlugin(nitroApp => {
6464 ttl : number = FETCH_CACHE_DEFAULT_TTL ,
6565 ) : Promise < CachedFetchResult < T > > => {
6666 // Check if this URL should be cached
67+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
68+ const _fetch = $fetch as any
6769 if ( ! isAllowedDomain ( url ) ) {
68- const data = ( await $fetch ( url , options ) ) as T
70+ const data = ( await _fetch ( url , options ) ) as T
6971 return { data, isStale : false , cachedAt : null }
7072 }
7173
@@ -108,7 +110,7 @@ export default defineNitroPlugin(nitroApp => {
108110 event . waitUntil (
109111 ( async ( ) => {
110112 try {
111- const freshData = ( await $fetch ( url , options as Parameters < typeof $fetch > [ 1 ] ) ) as T
113+ const freshData = ( await _fetch ( url , options ) ) as T
112114 const entry : CachedFetchEntry < T > = {
113115 data : freshData ,
114116 status : 200 ,
@@ -140,7 +142,7 @@ export default defineNitroPlugin(nitroApp => {
140142 console . log ( `[fetch-cache] MISS: ${ url } ` )
141143 }
142144
143- const data = ( await $fetch ( url , options as Parameters < typeof $fetch > [ 1 ] ) ) as T
145+ const data = ( await _fetch ( url , options ) ) as T
144146 const cachedAt = Date . now ( )
145147
146148 // Defer cache write to background via waitUntil for faster response
0 commit comments