logitar-js
Version:
Helper functions distributed by Logitar.
16 lines (15 loc) • 650 B
TypeScript
/**
* Sorts the specified array.
* @param items The array to sort.
* @param key If provided, the key used to sort an array of objects.
* @param isDescending A value indicating whether or not the sort is reversed (descending).
* @returns A shallow copy of the sorted array.
*/
export declare function orderBy<T>(items: T[], key?: keyof T, isDescending?: boolean): T[];
/**
* Reverse-sorts the specified array.
* @param items The array to sort.
* @param key If provided, the key used to sort an array of objects.
* @returns A shallow copy of the sorted array.
*/
export declare function orderByDescending<T>(items: T[], key?: keyof T): T[];