addSortField
Overview
Append base to the sort order. No-op (returns a copy) when base is already present.
Signature
addSortField(sorted, base, options)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| sorted | string[] | yes | The sort order. |
| base | string | yes | The base field name to add. |
| options | object | no | Initial direction; ascending by default. |
options Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| descending | boolean | no |
Returns
string[]
A fresh array.
Source
client/lib/utils/sortedFields.js:119