@@ -39,23 +39,23 @@ async function openapiTS(
3939 options : OpenAPITSOptions = { } as Partial < OpenAPITSOptions >
4040) : Promise < string > {
4141 const ctx : GlobalContext = {
42- additionalProperties : options . additionalProperties || false ,
43- alphabetize : options . alphabetize || false ,
44- defaultNonNullable : options . defaultNonNullable || false ,
42+ additionalProperties : options . additionalProperties ?? false ,
43+ alphabetize : options . alphabetize ?? false ,
44+ defaultNonNullable : options . defaultNonNullable ?? false ,
4545 discriminators : { } ,
46- transform : options && typeof options . transform === "function" ? options . transform : undefined ,
47- postTransform : options && typeof options . postTransform === "function" ? options . postTransform : undefined ,
48- immutableTypes : options . immutableTypes || false ,
49- emptyObjectsUnknown : options . emptyObjectsUnknown || false ,
46+ transform : typeof options . transform === "function" ? options . transform : undefined ,
47+ postTransform : typeof options . postTransform === "function" ? options . postTransform : undefined ,
48+ immutableTypes : options . immutableTypes ?? false ,
49+ emptyObjectsUnknown : options . emptyObjectsUnknown ?? false ,
5050 indentLv : 0 ,
5151 operations : { } ,
52- pathParamsAsTypes : options . pathParamsAsTypes || false ,
53- silent : options . silent || false ,
54- supportArrayLength : options . supportArrayLength || false ,
52+ pathParamsAsTypes : options . pathParamsAsTypes ?? false ,
53+ silent : options . silent ?? false ,
54+ supportArrayLength : options . supportArrayLength ?? false ,
5555 } ;
5656
5757 // note: we may be loading many large schemas into memory at once; take care to reuse references without cloning
58- const isInlineSchema = typeof schema !== "string" && schema instanceof URL == false ;
58+ const isInlineSchema = typeof schema !== "string" && schema instanceof URL === false ; // eslint-disable-line @typescript-eslint/no-unnecessary-boolean-literal-compare
5959
6060 // 1. load schema (and subschemas)
6161 const allSchemas : { [ id : string ] : Subschema } = { } ;
@@ -90,7 +90,7 @@ async function openapiTS(
9090 const output : string [ ] = [ ] ;
9191
9292 // 2a. Start file, inject custom code (if any)
93- if ( options && "commentHeader" in options ) {
93+ if ( "commentHeader" in options ) {
9494 if ( options . commentHeader ) output . push ( options . commentHeader ) ;
9595 } else {
9696 output . push ( COMMENT_HEADER ) ;
0 commit comments