1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-01 13:32:40 +02:00
TableFilter/src/sort.js

16 lines
294 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 {
2015-02-01 09:26:48 +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
}
};