UNPKG

ts-useful

Version:

Functions for animation, color transitions, ecliptic, bezier, decasteljau, curves, three dimensional curves, smooth scrolling, random range, randomItem, mobius index, vectors, physics vectors, and easing.

11 lines 328 B
/** * * @param array any[] * @param prop string * @param reverse boolean * @returns any[] */ export const Sorter = (array, prop, reverse = false) => { return array.sort((a, b) => ((a[prop] < b[prop]) ? (reverse ? 1 : -1) : (a[prop] > b[prop]) ? (reverse ? -1 : 1) : 0)); }; //# sourceMappingURL=sorter.js.map