UNPKG

@naverpay/hidash

Version:
16 lines (14 loc) 560 B
type FnType<T> = (item: T) => unknown; type Iteratee<T> = FnType<T> | keyof T; type Iteratees<T> = Iteratee<T> | Iteratee<T>[]; /** * @description * Sort in ascending order * * @template T - The type of the function to restrict. * @param {List<T>} [collection] The collection to iterate over * @param {ListIteratee<T | (value: T) => un} [iteratees] Sort by property or function. * @returns {List<T>} Returns the new sorted array. */ declare function sortBy<T>(collection: T[], ...iteratees: Iteratees<T>[]): T[]; export { sortBy as default, sortBy };