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> {