toggleSortField
Overview
Flip the direction of base in place within the sort order. No-op (returns a copy) when base is absent; other entries keep their position and direction.
Signature
toggleSortField(sorted, base)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| sorted | string[] | yes | The sort order. |
| base | string | yes | The base field name to toggle. |
Returns
string[]
A fresh array.
Source
client/lib/utils/sortedFields.js:145