MCPcopy Create free account
hub / github.com/angular/components / getSortDirectionCycle

Function getSortDirectionCycle

src/material/sort/sort.ts:206–216  ·  view source on GitHub ↗

Returns the sort direction cycle to use given the provided parameters of order and clear.

(start: SortDirection, disableClear: boolean)

Source from the content-addressed store, hash-verified

204
205/** Returns the sort direction cycle to use given the provided parameters of order and clear. */
206function 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}

Callers 1

getNextSortDirectionMethod · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected