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

16 lines
295 B
JavaScript
Raw Normal View History

2015-05-30 14:23:33 +02:00
import Str from './string';
2015-02-01 09:26:48 +01:00
2015-05-30 14:23:33 +02:00
export default {
2016-02-22 08:14:58 +01:00
ignoreCase(a, b){
2015-05-30 14:23:33 +02:00
let x = Str.lower(a);
let y = Str.lower(b);
2015-02-01 09:26:48 +01:00
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},
numSortAsc(a, b){
return (a - b);
},
numSortDesc(a, b){
return (b - a);
2015-02-01 09:26:48 +01:00
}
};