import { OrdFunc, Ord } from '../typings/types'; interface StableSortBy { (fn: OrdFunc, list: ArrayLike): T[]; (fn: OrdFunc): (list: ArrayLike) => T[]; } /** * Sorts the array according to the supplied function and keeping the order of elements. * * @param {Function} fn * @param {Array} arr The array to sort. * @return {Array} A new array sorted by the keys generated by `fn`. * @example * * const people = [ * { name: 'Ann', age: 20 }, * { name: 'Gary', age: 20 }, * { name: 'John', age: 17 }, * { name: 'Sam', age: 21 }, * { name: 'Bob', age: 17 } * ]; * stableSortBy(path(['age']), people) => [ * { name: 'John', age: 17 }, * { name: 'Bob', age: 17 }, * { name: 'Ann', age: 20 }, * { name: 'Gary', age: 20 }, * { name: 'Sam', age: 21 } * ] */ declare const _default: StableSortBy; export default _default;