@@ -111,24 +111,19 @@ function inspectVariantTypes(types: ts.Type[]) {
111111 variantTypes . add ( "nullish" ) ;
112112 }
113113 const booleans = types . filter ( tsHelpers . isBooleanType ) ;
114+ const boolean0 = booleans [ 0 ] ;
114115 // If incoming type is either "true" or "false", there will be one type
115116 // object with intrinsicName set accordingly
116117 // If incoming type is boolean, there will be two type objects with
117118 // intrinsicName set "true" and "false" each because of ts-api-utils.unionTypeParts()
118- switch ( true ) {
119- case booleans . length === 1 && booleans [ 0 ] != null : {
120- const first = booleans [ 0 ] ;
121- if ( isTrueLiteralType ( first ) ) {
122- variantTypes . add ( "truthy boolean" ) ;
123- } else if ( isFalseLiteralType ( first ) ) {
124- variantTypes . add ( "falsy boolean" ) ;
125- }
126- break ;
127- }
128- case booleans . length === 2 : {
129- variantTypes . add ( "boolean" ) ;
130- break ;
119+ if ( booleans . length === 1 && boolean0 != null ) {
120+ if ( isFalseLiteralType ( boolean0 ) ) {
121+ variantTypes . add ( "falsy boolean" ) ;
122+ } else if ( isTrueLiteralType ( boolean0 ) ) {
123+ variantTypes . add ( "truthy boolean" ) ;
131124 }
125+ } else if ( booleans . length === 2 ) {
126+ variantTypes . add ( "boolean" ) ;
132127 }
133128 const strings = types . filter ( tsHelpers . isStringType ) ;
134129 if ( strings . length > 0 ) {
0 commit comments