From 2a239ef52d990dd8766f2fb0c698aa3dd6c211a2 Mon Sep 17 00:00:00 2001 From: xjccc <546534045@qq.com> Date: Fri, 29 Nov 2024 17:22:16 +0800 Subject: [PATCH] update: transform type --- packages/nuxt/src/app/composables/asyncData.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/app/composables/asyncData.ts b/packages/nuxt/src/app/composables/asyncData.ts index a809ff2f09..59fc441364 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -62,12 +62,12 @@ export interface AsyncDataOptions< * An `undefined` return value will trigger a fetch. * Default is `key => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key]` which only caches data when payloadExtraction is enabled. */ - getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer | undefined + getCachedData?: (key: string, nuxtApp: NuxtApp) => NoInfer | undefined /** * A function that can be used to alter handler function result after resolving. * Do not use it along with the `pick` option. */ - transform?: _Transform + transform?: _Transform /** * Only pick specified keys in this array from the handler function result. * Do not use it along with the `transform` option. @@ -293,7 +293,7 @@ export function useAsyncData< let result = _result as unknown as DataT if (options.transform) { - result = await options.transform(_result) + result = await options.transform(_result as any) } if (options.pick) { result = pick(result as any, options.pick) as DataT