Returns the sort direction cycle to use given the provided parameters of order and clear.
(start: SortDirection, disableClear: boolean)
| 204 | |
| 205 | /** Returns the sort direction cycle to use given the provided parameters of order and clear. */ |
| 206 | function getSortDirectionCycle(start: SortDirection, disableClear: boolean): SortDirection[] { |
| 207 | let sortOrder: SortDirection[] = ['asc', 'desc']; |
| 208 | if (start == 'desc') { |
| 209 | sortOrder.reverse(); |
| 210 | } |
| 211 | if (!disableClear) { |
| 212 | sortOrder.push(''); |
| 213 | } |
| 214 | |
| 215 | return sortOrder; |
| 216 | } |
no test coverage detected