From 61b182c4e77401a5d5860b5b5ce59c37255514d0 Mon Sep 17 00:00:00 2001 From: taefi Date: Wed, 7 Aug 2024 15:00:38 +0300 Subject: [PATCH] apply suggestions from code review --- packages/ts/generator-plugin-signals/src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/ts/generator-plugin-signals/src/index.ts b/packages/ts/generator-plugin-signals/src/index.ts index 5c518f671d..ac442733a4 100644 --- a/packages/ts/generator-plugin-signals/src/index.ts +++ b/packages/ts/generator-plugin-signals/src/index.ts @@ -16,7 +16,7 @@ function extractEndpointMethodsWithSignalsAsReturnType(storage: SharedStorage): const response200 = pathObject?.post?.responses['200']; return response200 && !('$ref' in response200); }) - .map(([path, pathObject]) => { + .flatMap(([path, pathObject]) => { const response200 = pathObject?.post?.responses['200']; const responseSchema = (response200 as OpenAPIV3.ResponseObject).content?.['application/json']?.schema; @@ -29,8 +29,7 @@ function extractEndpointMethodsWithSignalsAsReturnType(storage: SharedStorage): })) : []; }) - .filter((signalArray) => signalArray !== undefined) - .reduce((acc, current) => acc.concat(current), []); + .filter((signalArray) => signalArray !== undefined); } function groupByService(signals: readonly PathSignalType[]): Map> {