@tanstack/svelte-table 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.
|
@@ -2352,6 +2352,9 @@
|
|
|
2352
2352
|
return a === b ? 0 : a > b ? 1 : -1;
|
|
2353
2353
|
}
|
|
2354
2354
|
function toString(a) {
|
|
2355
|
+
if (typeof a === 'boolean') {
|
|
2356
|
+
return String(a);
|
|
2357
|
+
}
|
|
2355
2358
|
if (typeof a === 'number') {
|
|
2356
2359
|
if (isNaN(a) || a === Infinity || a === -Infinity) {
|
|
2357
2360
|
return '';
|
|
@@ -2368,6 +2371,13 @@
|
|
|
2368
2371
|
// It handles numbers, mixed alphanumeric combinations, and even
|
|
2369
2372
|
// null, undefined, and Infinity
|
|
2370
2373
|
function compareAlphanumeric(aStr, bStr) {
|
|
2374
|
+
// Check if the string contains only a number
|
|
2375
|
+
const aFloat = parseFloat(aStr);
|
|
2376
|
+
const bFloat = parseFloat(bStr);
|
|
2377
|
+
if (!isNaN(aFloat) && !isNaN(bFloat)) {
|
|
2378
|
+
return compareBasic(aFloat, bFloat);
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2371
2381
|
// Split on number groups, but keep the delimiter
|
|
2372
2382
|
// Then remove falsey split values
|
|
2373
2383
|
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);
|