UNPKG

forto-sorter

Version:

Fast and powerful array sorting. Sort by any property in any direction with easy to read syntax.

8 lines (7 loc) 178 B
export const defaultComparer = (a, b, order):number => { if (a == null) return order; if (b == null) return -order; if (a < b) return -1; if (a === b) return 0; return 1; }