mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
18 lines
591 B
JavaScript
18 lines
591 B
JavaScript
define(['./baseCompareAscending'], function(baseCompareAscending) {
|
|
|
|
/**
|
|
* Used by `_.sortBy` to compare transformed elements of a collection and stable
|
|
* sort them in ascending order.
|
|
*
|
|
* @private
|
|
* @param {Object} object The object to compare to `other`.
|
|
* @param {Object} other The object to compare to `object`.
|
|
* @returns {number} Returns the sort order indicator for `object`.
|
|
*/
|
|
function compareAscending(object, other) {
|
|
return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
|
|
}
|
|
|
|
return compareAscending;
|
|
});
|