@@ -55,7 +55,7 @@ const allowedVariants = [
5555 "truthy string" ,
5656] as const satisfies VariantType [ ] ;
5757
58- const tsHelper = {
58+ const tsHelpers = {
5959 isAnyType : ( type : ts . Type ) => isTypeFlagSet ( type , ts . TypeFlags . TypeParameter | ts . TypeFlags . Any ) ,
6060 isBigIntType : ( type : ts . Type ) => isTypeFlagSet ( type , ts . TypeFlags . BigIntLike ) ,
6161 isBooleanType : ( type : ts . Type ) => isTypeFlagSet ( type , ts . TypeFlags . BooleanLike ) ,
@@ -102,14 +102,14 @@ const tsHelper = {
102102 */
103103function inspectVariantTypes ( types : ts . Type [ ] ) {
104104 const variantTypes = new Set < VariantType > ( ) ;
105- if ( types . some ( tsHelper . isUnknownType ) ) {
105+ if ( types . some ( tsHelpers . isUnknownType ) ) {
106106 variantTypes . add ( "unknown" ) ;
107107 return variantTypes ;
108108 }
109- if ( types . some ( tsHelper . isNullishType ) ) {
109+ if ( types . some ( tsHelpers . isNullishType ) ) {
110110 variantTypes . add ( "nullish" ) ;
111111 }
112- const booleans = types . filter ( tsHelper . isBooleanType ) ;
112+ const booleans = types . filter ( tsHelpers . isBooleanType ) ;
113113 // If incoming type is either "true" or "false", there will be one type
114114 // object with intrinsicName set accordingly
115115 // If incoming type is boolean, there will be two type objects with
@@ -134,40 +134,40 @@ function inspectVariantTypes(types: ts.Type[]) {
134134 break ;
135135 }
136136 }
137- const strings = types . filter ( tsHelper . isStringType ) ;
137+ const strings = types . filter ( tsHelpers . isStringType ) ;
138138 if ( strings . length > 0 ) {
139139 const evaluated = match < ts . Type [ ] , VariantType > ( strings )
140- . when ( types => types . every ( tsHelper . isTruthyStringType ) , F . constant ( "truthy string" ) )
141- . when ( types => types . every ( tsHelper . isFalsyStringType ) , F . constant ( "falsy string" ) )
140+ . when ( types => types . every ( tsHelpers . isTruthyStringType ) , F . constant ( "truthy string" ) )
141+ . when ( types => types . every ( tsHelpers . isFalsyStringType ) , F . constant ( "falsy string" ) )
142142 . otherwise ( F . constant ( "string" ) ) ;
143143 variantTypes . add ( evaluated ) ;
144144 }
145- const bigints = types . filter ( tsHelper . isBigIntType ) ;
145+ const bigints = types . filter ( tsHelpers . isBigIntType ) ;
146146 if ( bigints . length > 0 ) {
147147 const evaluated = match < ts . Type [ ] , VariantType > ( bigints )
148- . when ( types => types . every ( tsHelper . isTruthyBigIntType ) , F . constant ( "truthy bigint" ) )
149- . when ( types => types . every ( tsHelper . isFalsyBigIntType ) , F . constant ( "falsy bigint" ) )
148+ . when ( types => types . every ( tsHelpers . isTruthyBigIntType ) , F . constant ( "truthy bigint" ) )
149+ . when ( types => types . every ( tsHelpers . isFalsyBigIntType ) , F . constant ( "falsy bigint" ) )
150150 . otherwise ( F . constant ( "bigint" ) ) ;
151151 variantTypes . add ( evaluated ) ;
152152 }
153- const numbers = types . filter ( tsHelper . isNumberType ) ;
153+ const numbers = types . filter ( tsHelpers . isNumberType ) ;
154154 if ( numbers . length > 0 ) {
155155 const evaluated = match < ts . Type [ ] , VariantType > ( numbers )
156- . when ( types => types . every ( tsHelper . isTruthyNumberType ) , F . constant ( "truthy number" ) )
157- . when ( types => types . every ( tsHelper . isFalsyNumberType ) , F . constant ( "falsy number" ) )
156+ . when ( types => types . every ( tsHelpers . isTruthyNumberType ) , F . constant ( "truthy number" ) )
157+ . when ( types => types . every ( tsHelpers . isFalsyNumberType ) , F . constant ( "falsy number" ) )
158158 . otherwise ( F . constant ( "number" ) ) ;
159159 variantTypes . add ( evaluated ) ;
160160 }
161- if ( types . some ( tsHelper . isEnumType ) ) {
161+ if ( types . some ( tsHelpers . isEnumType ) ) {
162162 variantTypes . add ( "enum" ) ;
163163 }
164- if ( types . some ( tsHelper . isObjectType ) ) {
164+ if ( types . some ( tsHelpers . isObjectType ) ) {
165165 variantTypes . add ( "object" ) ;
166166 }
167- if ( types . some ( tsHelper . isAnyType ) ) {
167+ if ( types . some ( tsHelpers . isAnyType ) ) {
168168 variantTypes . add ( "any" ) ;
169169 }
170- if ( types . some ( tsHelper . isNeverType ) ) {
170+ if ( types . some ( tsHelpers . isNeverType ) ) {
171171 variantTypes . add ( "never" ) ;
172172 }
173173 return variantTypes ;
0 commit comments