@@ -159,9 +159,8 @@ class Functions {
159159 ) : number {
160160 if ( isRecord ( arg ) ) {
161161 return Object . keys ( arg ) . length ;
162- } else {
163- return arg . length ;
164162 }
163+ return arg . length ;
165164 }
166165
167166 /**
@@ -194,12 +193,12 @@ class Functions {
194193 if ( arg . length === 0 ) {
195194 return null ;
196195 // The signature decorator already enforces that all elements are of the same type
197- } else if ( isNumber ( arg [ 0 ] ) ) {
196+ }
197+ if ( isNumber ( arg [ 0 ] ) ) {
198198 return Math . max ( ...( arg as number [ ] ) ) ;
199- } else {
200- // local compare function to handle string comparison
201- return arg . reduce ( ( a , b ) => ( a > b ? a : b ) ) ;
202199 }
200+ // local compare function to handle string comparison
201+ return arg . reduce ( ( a , b ) => ( a > b ? a : b ) ) ;
203202 }
204203
205204 /**
@@ -236,14 +235,13 @@ class Functions {
236235
237236 if ( max . visited === current . visited ) {
238237 return max ;
239- } else {
240- // We can safely cast visited to number | string here because we've already
241- // checked the type at runtime above and we know that it's either a number or a string
242- return ( max . visited as number | string ) >
243- ( current . visited as number | string )
244- ? max
245- : current ;
246238 }
239+ // We can safely cast visited to number | string here because we've already
240+ // checked the type at runtime above and we know that it's either a number or a string
241+ return ( max . visited as number | string ) >
242+ ( current . visited as number | string )
243+ ? max
244+ : current ;
247245 } , visitedArgs [ 0 ] ) ;
248246
249247 return max . arg ;
@@ -261,6 +259,7 @@ class Functions {
261259 variadic : true ,
262260 } )
263261 public funcMerge ( ...args : Array < JSONObject > ) : JSONObject {
262+ // biome-ignore lint/performance/noAccumulatingSpread: This is a shallow merge so the tradeoff is acceptable
264263 return args . reduce ( ( a , b ) => ( { ...a , ...b } ) , { } ) ;
265264 }
266265
@@ -276,11 +275,11 @@ class Functions {
276275 if ( arg . length === 0 ) {
277276 return null ;
278277 // The signature decorator already enforces that all elements are of the same type
279- } else if ( isNumber ( arg [ 0 ] ) ) {
278+ }
279+ if ( isNumber ( arg [ 0 ] ) ) {
280280 return Math . min ( ...arg ) ;
281- } else {
282- return arg . reduce ( ( a , b ) => ( a < b ? a : b ) ) ;
283281 }
282+ return arg . reduce ( ( a , b ) => ( a < b ? a : b ) ) ;
284283 }
285284
286285 /**
@@ -317,14 +316,13 @@ class Functions {
317316
318317 if ( min . visited === current . visited ) {
319318 return min ;
320- } else {
321- // We can safely cast visited to number | string here because we've already
322- // checked the type at runtime above and we know that it's either a number or a string
323- return ( min . visited as string | number ) <
324- ( current . visited as string | number )
325- ? min
326- : current ;
327319 }
320+ // We can safely cast visited to number | string here because we've already
321+ // checked the type at runtime above and we know that it's either a number or a string
322+ return ( min . visited as string | number ) <
323+ ( current . visited as string | number )
324+ ? min
325+ : current ;
328326 } , visitedArgs [ 0 ] ) ;
329327
330328 return min . arg ;
@@ -415,13 +413,12 @@ class Functions {
415413 . sort ( ( a , b ) => {
416414 if ( a . visited === b . visited ) {
417415 return a . index - b . index ; // Make the sort stable
418- } else {
419- // We can safely cast visited to number | string here because we've already
420- // checked the type at runtime above and we know that it's either a number or a string
421- return ( a . visited as string | number ) > ( b . visited as string | number )
422- ? 1
423- : - 1 ;
424416 }
417+ // We can safely cast visited to number | string here because we've already
418+ // checked the type at runtime above and we know that it's either a number or a string
419+ return ( a . visited as string | number ) > ( b . visited as string | number )
420+ ? 1
421+ : - 1 ;
425422 } )
426423 . map ( ( { value } ) => value ) ; // Extract the original values
427424 }
@@ -484,13 +481,13 @@ class Functions {
484481 public funcToNumber ( arg : JSONValue ) : number | null {
485482 if ( typeof arg === 'number' ) {
486483 return arg ;
487- } else if ( typeof arg === 'string' ) {
484+ }
485+ if ( typeof arg === 'string' ) {
488486 const num = Number ( arg ) ;
489487
490488 return Number . isNaN ( num ) ? null : num ;
491- } else {
492- return null ;
493489 }
490+ return null ;
494491 }
495492
496493 /**
0 commit comments