SortByMultiple
cartographer / sortByMultiple
Function: sortByMultiple()
Section titled “Function: sortByMultiple()”sortByMultiple(
items,sorts):CatalogItem[]
Defined in: queries/queryFunctions.ts:548
Sort items by multiple fields sequentially.
Applies sorts in reverse order so the first sort specification has highest priority.
Parameters
Section titled “Parameters”Array of items to sort
object[]
Array of sort specifications (field, descending, type)
Returns
Section titled “Returns”- New sorted array (original array not mutated)
Example
Section titled “Example”const sorted = sortByMultiple(items, [ { field: 'year', descending: true, type: 'number' }, { field: 'title', type: 'string' }]);