1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-17 22:06:41 +02:00
TableFilter/src/sort.js

14 lines
268 B
JavaScript
Raw Normal View History

2016-05-20 09:14:05 +02:00
/**
* Sorting utilities
*/
2015-02-01 09:26:48 +01:00
2016-05-20 09:14:05 +02:00
export const ignoreCase = (a, b) => {
let x = a.toLowerCase();
let y = b.toLowerCase();
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
}
export const numSortAsc = (a, b) => (a - b);
export const numSortDesc = (a, b) => (b - a);