@@ -189,7 +189,7 @@ export class ApiModelGenerator {
189189 const returnTypeTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
190190 nodesToCapture . push ( { node : callSignature . type , tokenRange : returnTypeTokenRange } ) ;
191191
192- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
192+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
193193 callSignature . typeParameters ) ;
194194
195195 const parameters : IApiParameterOptions [ ] = this . _captureParameters ( nodesToCapture , callSignature . parameters ) ;
@@ -252,7 +252,7 @@ export class ApiModelGenerator {
252252
253253 const nodesToCapture : IExcerptBuilderNodeToCapture [ ] = [ ] ;
254254
255- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
255+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
256256 classDeclaration . typeParameters ) ;
257257
258258 let extendsTokenRange : IExcerptTokenRange | undefined = undefined ;
@@ -308,7 +308,7 @@ export class ApiModelGenerator {
308308 const returnTypeTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
309309 nodesToCapture . push ( { node : constructSignature . type , tokenRange : returnTypeTokenRange } ) ;
310310
311- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
311+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
312312 constructSignature . typeParameters ) ;
313313
314314 const parameters : IApiParameterOptions [ ] = this . _captureParameters ( nodesToCapture , constructSignature . parameters ) ;
@@ -401,7 +401,7 @@ export class ApiModelGenerator {
401401 const returnTypeTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
402402 nodesToCapture . push ( { node : functionDeclaration . type , tokenRange : returnTypeTokenRange } ) ;
403403
404- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
404+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
405405 functionDeclaration . typeParameters ) ;
406406
407407 const parameters : IApiParameterOptions [ ] = this . _captureParameters ( nodesToCapture ,
@@ -467,7 +467,7 @@ export class ApiModelGenerator {
467467
468468 const nodesToCapture : IExcerptBuilderNodeToCapture [ ] = [ ] ;
469469
470- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
470+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
471471 interfaceDeclaration . typeParameters ) ;
472472
473473 const extendsTokenRanges : IExcerptTokenRange [ ] = [ ] ;
@@ -519,7 +519,7 @@ export class ApiModelGenerator {
519519 const returnTypeTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
520520 nodesToCapture . push ( { node : methodDeclaration . type , tokenRange : returnTypeTokenRange } ) ;
521521
522- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
522+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
523523 methodDeclaration . typeParameters ) ;
524524
525525 const parameters : IApiParameterOptions [ ] = this . _captureParameters ( nodesToCapture , methodDeclaration . parameters ) ;
@@ -558,7 +558,7 @@ export class ApiModelGenerator {
558558 const returnTypeTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
559559 nodesToCapture . push ( { node : methodSignature . type , tokenRange : returnTypeTokenRange } ) ;
560560
561- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
561+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
562562 methodSignature . typeParameters ) ;
563563
564564 const parameters : IApiParameterOptions [ ] = this . _captureParameters ( nodesToCapture , methodSignature . parameters ) ;
@@ -684,7 +684,7 @@ export class ApiModelGenerator {
684684
685685 const nodesToCapture : IExcerptBuilderNodeToCapture [ ] = [ ] ;
686686
687- const typeParameters : IApiTypeParameterOptions [ ] | undefined = this . _captureTypeParameters ( nodesToCapture ,
687+ const typeParameters : IApiTypeParameterOptions [ ] = this . _captureTypeParameters ( nodesToCapture ,
688688 typeAliasDeclaration . typeParameters ) ;
689689
690690 const aliasTypeTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
@@ -736,31 +736,25 @@ export class ApiModelGenerator {
736736 }
737737
738738 private _captureTypeParameters ( nodesToCapture : IExcerptBuilderNodeToCapture [ ] , typeParameterNodes :
739- ts . NodeArray < ts . TypeParameterDeclaration > | undefined ) : IApiTypeParameterOptions [ ] | undefined {
739+ ts . NodeArray < ts . TypeParameterDeclaration > | undefined ) : IApiTypeParameterOptions [ ] {
740740
741+ const typeParameters : IApiTypeParameterOptions [ ] = [ ] ;
741742 if ( typeParameterNodes ) {
742- const typeParameters : IApiTypeParameterOptions [ ] = [ ] ;
743743 for ( const typeParameter of typeParameterNodes ) {
744- let constraintTokenRange : IExcerptTokenRange | undefined ;
745- if ( typeParameter . constraint ) {
746- constraintTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
747- nodesToCapture . push ( { node : typeParameter . constraint , tokenRange : constraintTokenRange } ) ;
748- }
744+ const constraintTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
745+ nodesToCapture . push ( { node : typeParameter . constraint , tokenRange : constraintTokenRange } ) ;
749746
750- let defaultTypeTokenRange : IExcerptTokenRange | undefined ;
751- if ( typeParameter . default ) {
752- defaultTypeTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
753- nodesToCapture . push ( { node : typeParameter . default , tokenRange : defaultTypeTokenRange } ) ;
754- }
747+ const defaultTypeTokenRange : IExcerptTokenRange = ExcerptBuilder . createEmptyTokenRange ( ) ;
748+ nodesToCapture . push ( { node : typeParameter . default , tokenRange : defaultTypeTokenRange } ) ;
755749
756750 typeParameters . push ( {
757751 typeParameterName : typeParameter . name . getText ( ) . trim ( ) ,
758752 constraintTokenRange,
759753 defaultTypeTokenRange
760754 } ) ;
761755 }
762- return typeParameters ;
763756 }
757+ return typeParameters ;
764758 }
765759
766760 private _captureParameters ( nodesToCapture : IExcerptBuilderNodeToCapture [ ] ,
0 commit comments