Compiles a SortExpression into a comparator function.
Uses locale-aware string comparison by default. The first entry is the primary sort; subsequent entries act as tie-breakers.
The row object type.
The sort expression to compile.
A comparator function (a, b) => number.
(a, b) => number
const cmp = compileSortExpression<Employee>([ { columnKey: 'department', direction: SortDirection.Ascending }, { columnKey: 'name', direction: SortDirection.Ascending },]);const sorted = employees.sort(cmp); Copy
const cmp = compileSortExpression<Employee>([ { columnKey: 'department', direction: SortDirection.Ascending }, { columnKey: 'name', direction: SortDirection.Ascending },]);const sorted = employees.sort(cmp);
Compiles a SortExpression into a comparator function.
Uses locale-aware string comparison by default. The first entry is the primary sort; subsequent entries act as tie-breakers.