mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
548 B
17 lines
548 B
10 years ago
|
var baseCompareAscending = require('./baseCompareAscending');
|
||
|
|
||
|
/**
|
||
|
* Used by `_.sortBy` to compare transformed elements of a collection and stable
|
||
|
* sort them in ascending order.
|
||
|
*
|
||
|
* @private
|
||
9 years ago
|
* @param {Object} object The object to compare.
|
||
|
* @param {Object} other The other object to compare.
|
||
10 years ago
|
* @returns {number} Returns the sort order indicator for `object`.
|
||
|
*/
|
||
|
function compareAscending(object, other) {
|
||
|
return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
|
||
|
}
|
||
|
|
||
|
module.exports = compareAscending;
|