@@ -83,8 +83,9 @@ export async function processOpenApiDocument(
8383 overwrite : true ,
8484 } ) ;
8585
86- const outputTypes : ( InterfaceDeclaration | TypeAliasDeclaration | 'void' ) [ ] =
87- [ ] ;
86+ const outputTypes = new Set <
87+ InterfaceDeclaration | TypeAliasDeclaration | 'void'
88+ > ( ) ;
8889
8990 const refs = await $RefParser . default . resolve ( schema ) ;
9091
@@ -477,7 +478,7 @@ export async function processOpenApiDocument(
477478 // ensureImport(outputType, outputTypeAlias);
478479
479480 if ( outputType ) {
480- outputTypes . push ( outputType ) ;
481+ outputTypes . add ( outputType ) ;
481482 ensureImport ( outputType ) ;
482483 }
483484
@@ -497,7 +498,7 @@ export async function processOpenApiDocument(
497498
498499 classDeclaration . getExtends ( ) ?. addTypeArgument ( retVal ) ;
499500
500- outputTypes . push ( retVal ) ;
501+ outputTypes . add ( retVal ) ;
501502
502503 // jsdoc.addTag({
503504 // tagName: 'returns',
@@ -592,9 +593,7 @@ export async function processOpenApiDocument(
592593 ...new Set ( inputTypes . sort ( ) . map ( ( t ) => t . getName ( ) ) ) ,
593594 ) ;
594595 const outputUnion = createUnion (
595- ...new Set (
596- outputTypes . map ( ( t ) => ( typeof t === 'string' ? t : t . getName ( ) ) ) ,
597- ) ,
596+ ...[ ...outputTypes ] . map ( ( t ) => ( typeof t === 'string' ? t : t . getName ( ) ) ) ,
598597 ) ;
599598
600599 const allInputs = inputUnion
0 commit comments