Skip to content

Commit 33d9172

Browse files
Merge pull request #245 from iamstolis/patch-1
Fix of the compare function
2 parents 6e187e1 + 0ad46f8 commit 33d9172

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ helpers.withSort = function(array, prop, options) {
601601
array.sort(function(a, b) {
602602
a = utils.get(a, prop);
603603
b = utils.get(b, prop);
604-
return a > b;
604+
return a > b ? 1 : (a < b ? -1 : 0);
605605
});
606606

607607
if (utils.get(options, 'hash.reverse')) {

0 commit comments

Comments
 (0)