From 646bac8af48b7e76bf11fac902da8ba4d456eee0 Mon Sep 17 00:00:00 2001 From: Anna Bocharova Date: Fri, 3 Jan 2025 15:17:56 +0100 Subject: [PATCH] Allow type params on `makeArrowFn()` (#2281) Needed for #2280 --- src/integration-helpers.ts | 7 +++++-- src/integration.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/integration-helpers.ts b/src/integration-helpers.ts index 4e78413f8..6c03a01b7 100644 --- a/src/integration-helpers.ts +++ b/src/integration-helpers.ts @@ -212,11 +212,14 @@ export const makeTypeParams = ( export const makeArrowFn = ( params: ts.Identifier[], body: ts.ConciseBody, - isAsync?: boolean, + { + isAsync, + typeParams, + }: { isAsync?: boolean; typeParams?: Parameters[0] }, ) => f.createArrowFunction( isAsync ? asyncModifier : undefined, - undefined, + typeParams && makeTypeParams(typeParams), params.map((key) => makeParam(key)), undefined, undefined, diff --git a/src/integration.ts b/src/integration.ts index 385139506..0fcb18c20 100644 --- a/src/integration.ts +++ b/src/integration.ts @@ -589,7 +589,7 @@ export class Integration { parserStatement, returnStatement, ]), - true, + { isAsync: true }, ), { expose: true,