@tanstack/table-core 8.10.5 → 8.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/table-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "8.10.5",
4
+ "version": "8.10.6",
5
5
  "description": "Headless UI for building powerful tables & datagrids for TS/JS.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/tanstack/table#readme",
package/src/sortingFns.ts CHANGED
@@ -55,6 +55,9 @@ function compareBasic(a: any, b: any) {
55
55
  }
56
56
 
57
57
  function toString(a: any) {
58
+ if (typeof a === 'boolean') {
59
+ return String(a)
60
+ }
58
61
  if (typeof a === 'number') {
59
62
  if (isNaN(a) || a === Infinity || a === -Infinity) {
60
63
  return ''
@@ -71,6 +74,13 @@ function toString(a: any) {
71
74
  // It handles numbers, mixed alphanumeric combinations, and even
72
75
  // null, undefined, and Infinity
73
76
  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
+
74
84
  // Split on number groups, but keep the delimiter
75
85
  // Then remove falsey split values
76
86
  const a = aStr.split(reSplitAlphaNumeric).filter(Boolean)