Function
nullsLast
(
rowA: Row<TData>,
rowB: Row<TData>,
columnId: string,
)
Source from the content-addressed store, hash-verified
| 15 | * before "100cc" instead of lexicographically). |
| 16 | */ |
| 17 | const nullsLast = <TData>( |
| 18 | rowA: Row<TData>, |
| 19 | rowB: Row<TData>, |
| 20 | columnId: string, |
| 21 | ): number => { |
| 22 | const a = rowA.getValue(columnId); |
| 23 | const b = rowB.getValue(columnId); |
| 24 | |
| 25 | if (a == null && b == null) return 0; |
| 26 | if (a == null) return 1; |
| 27 | if (b == null) return -1; |
| 28 | |
| 29 | return String(a).localeCompare(String(b), undefined, { numeric: true }); |
| 30 | }; |
| 31 | |
| 32 | export const sortingFunctions = { |
| 33 | nullsLast, |
Callers
nothing calls this directly
Tested by
no test coverage detected