From 8833478237298760b81c790b92a81adfa6f2bcf4 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 26 Oct 2020 11:49:20 +0800 Subject: [PATCH] fix: type --- packages/uni-api/src/helpers/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni-api/src/helpers/api.ts b/packages/uni-api/src/helpers/api.ts index e4534f7ac..0e30b1037 100644 --- a/packages/uni-api/src/helpers/api.ts +++ b/packages/uni-api/src/helpers/api.ts @@ -38,11 +38,11 @@ export function createApi( fn: T, protocol?: ApiProtocols ) { - return function(...args: any[]) { + return (function(...args: any[]) { if (type === API_TYPE_SYNC) { if (!(__DEV__ && protocol && !validateProtocol(name!, args, protocol))) { return fn.apply(null, formatApiArgs(args, options)) } } - } + } as unknown) as T } -- GitLab