Skip to content

Commit 02a7884

Browse files
authored
fix: revert better alphanumeric sort of bools and floats (fix #5108) (#5109) (#5129)
This reverts commit 3f9d382.
1 parent e4ddee6 commit 02a7884

File tree

2 files changed

+0
-90
lines changed

2 files changed

+0
-90
lines changed

packages/table-core/__tests__/Sorting.test.ts

-80
This file was deleted.

packages/table-core/src/sortingFns.ts

-10
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ function compareBasic(a: any, b: any) {
5555
}
5656

5757
function toString(a: any) {
58-
if (typeof a === 'boolean') {
59-
return String(a)
60-
}
6158
if (typeof a === 'number') {
6259
if (isNaN(a) || a === Infinity || a === -Infinity) {
6360
return ''
@@ -74,13 +71,6 @@ function toString(a: any) {
7471
// It handles numbers, mixed alphanumeric combinations, and even
7572
// null, undefined, and Infinity
7673
function compareAlphanumeric(aStr: string, bStr: string) {
77-
// Check if the string contains only a number
78-
const aFloat = parseFloat(aStr);
79-
const bFloat = parseFloat(bStr);
80-
if(!isNaN(aFloat) && !isNaN(bFloat)) {
81-
return compareBasic(aFloat, bFloat)
82-
}
83-
8474
// Split on number groups, but keep the delimiter
8575
// Then remove falsey split values
8676
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean)

0 commit comments

Comments
 (0)