Skip to content

Commit d5daacb

Browse files
committed
add descending sorter function
1 parent 0a78842 commit d5daacb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ lib.parseDate = datesModule.parseDate;
3131
var searchModule = require('./search');
3232
lib.findBin = searchModule.findBin;
3333
lib.sorterAsc = searchModule.sorterAsc;
34+
lib.sorterDec = searchModule.sorterDes;
3435
lib.distinctVals = searchModule.distinctVals;
3536
lib.roundUp = searchModule.roundUp;
3637

src/lib/search.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function greaterThan(a, b) { return a > b; }
5656
function greaterOrEqual(a, b) { return a >= b; }
5757

5858
exports.sorterAsc = function(a, b) { return a - b; };
59+
exports.sorterDes = function(a, b) { return b - a; };
5960

6061
/**
6162
* find distinct values in an array, lumping together ones that appear to

0 commit comments

Comments
 (0)