Skip to content

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 ​

NameTypeRequiredDescription
sortedstring[]yesThe sort order.
basestringyesThe base field name to toggle.

Returns ​

string[]

A fresh array.

Source ​

client/lib/utils/sortedFields.js:145