File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -513,15 +513,22 @@ const getSortFunction = (sort: string[], typeOfValue: string) => {
513513 aVal = ( aVal || '' ) ?. toUpperCase ?.( ) || '' ;
514514 if ( ! aVal || aVal === '\n' ) aVal = direction === 'asc' ? 'zzzzzz' : '' ;
515515 aVal = aVal . trimStart ( ) ;
516+ } else if ( typeOfValue === 'number' ) {
517+ aVal = Number . isFinite ( aVal )
518+ ? aVal
519+ : Infinity * ( direction === 'asc' ? 1 : - 1 ) ;
516520 }
517521 // @ts -ignore
518522 let bVal = b [ columnName ] ;
519523 if ( typeOfValue === 'string' ) {
520524 bVal = ( bVal || '' ) ?. toUpperCase ?.( ) || '' ;
521525 if ( ! bVal || bVal === '\n' ) bVal = direction === 'asc' ? 'zzzzzz' : '' ;
522526 bVal = bVal . trimStart ( ) ;
527+ } else if ( typeOfValue === 'number' ) {
528+ bVal = Number . isFinite ( bVal )
529+ ? bVal
530+ : Infinity * ( direction === 'asc' ? 1 : - 1 ) ;
523531 }
524-
525532 return direction == 'desc'
526533 ? // @ts -ignore
527534 descending ( aVal , bVal )
You can’t perform that action at this time.
0 commit comments