@@ -160,7 +160,7 @@ class SchemaRoutes {
160160 const queryParamMatches = fixedRoute . match ( / ( \{ \? .* \} ) / g) ;
161161 const queryParams = [ ] ;
162162
163- if ( queryParamMatches && queryParamMatches . length ) {
163+ if ( queryParamMatches ? .length ) {
164164 queryParamMatches . forEach ( ( match ) => {
165165 fixedRoute = fixedRoute . replace ( match , "" ) ;
166166 } ) ;
@@ -220,11 +220,7 @@ class SchemaRoutes {
220220 this . schemaParserFabric . schemaUtils . getSchemaRefType ( parameter ) ;
221221 let routeParam = null ;
222222
223- if (
224- refTypeInfo &&
225- refTypeInfo . rawTypeData . in &&
226- refTypeInfo . rawTypeData
227- ) {
223+ if ( refTypeInfo ?. rawTypeData . in && refTypeInfo . rawTypeData ) {
228224 if ( ! routeParams [ refTypeInfo . rawTypeData . in ] ) {
229225 routeParams [ refTypeInfo . rawTypeData . in ] = [ ] ;
230226 }
@@ -345,7 +341,7 @@ class SchemaRoutes {
345341
346342 /* for example: dataType = "multipart/form-data" */
347343 for ( const dataType in content ) {
348- if ( content [ dataType ] && content [ dataType ] . schema ) {
344+ if ( content [ dataType ] ? .schema ) {
349345 return {
350346 ...content [ dataType ] . schema ,
351347 dataType,
@@ -510,9 +506,7 @@ class SchemaRoutes {
510506 responses : responseInfos ,
511507 success : {
512508 schema : successResponse ,
513- type :
514- ( successResponse && successResponse . type ) ||
515- this . config . Ts . Keyword . Any ,
509+ type : successResponse ?. type || this . config . Ts . Keyword . Any ,
516510 } ,
517511 error : {
518512 schemas : errorResponses ,
@@ -640,10 +634,7 @@ class SchemaRoutes {
640634 }
641635
642636 return {
643- paramName :
644- requestBodyName ||
645- ( requestBody && requestBody . name ) ||
646- DEFAULT_BODY_ARG_NAME ,
637+ paramName : requestBodyName || requestBody ?. name || DEFAULT_BODY_ARG_NAME ,
647638 contentTypes,
648639 contentKind,
649640 schema,
@@ -892,7 +883,7 @@ class SchemaRoutes {
892883 moduleNameFirstTag && firstTag
893884 ? _ . camelCase ( firstTag )
894885 : _ . camelCase ( _ . compact ( _ . split ( route , "/" ) ) [ moduleNameIndex ] ) ;
895- let hasSecurity = ! ! ( globalSecurity && globalSecurity . length ) ;
886+ let hasSecurity = ! ! globalSecurity ? .length ;
896887 if ( security ) {
897888 hasSecurity = security . length > 0 ;
898889 }
0 commit comments