Built-in sort functions, ported from row-sorting/sortFns.ts.
A SortFn compares two cell values in ascending order. Descending order is
applied by the sorted row model. Each sort fn carries an optional
resolveDataValue normaliser that runs on both values before comparison,
which is how the built-ins lowercase text or turn dates into timestamps.
Natural sort, case-insensitive: item2 before item10.
Natural sort, case-sensitive.
Plain lexicographic sort, case-sensitive.
Chronological sort on Date values (and numeric timestamps).
Date values become millisecond timestamps first; anything else is compared
with JavaScript's relational rules, so two strings compare as strings and
everything else compares numerically.
Build a sort fn from a comparison. Use withResolveDataValue
to add a normaliser.
Replace the normaliser that runs on both values before comparison.
Compare two raw cell values: both are passed through the normaliser, then the comparison runs.
Run only the normaliser.
The Elm counterpart of splitting a string with TanStack's
reSplitAlphaNumeric regex (/([0-9]+)/gm): runs of digits become their own
segments, and the empty segments JavaScript leaves at the boundaries are kept.
splitAlphaNumeric "apple" == [ "apple" ]
splitAlphaNumeric "item10" == [ "item", "10", "" ]
splitAlphaNumeric "10abc" == [ "", "10", "abc" ]
splitAlphaNumeric "" == [ "" ]
An ascending comparison on cell values plus its value normaliser.