Urara-Blog/node_modules/.pnpm-store/v3/files/97/ba5242d389c5a2e85f98445ebb39e5696ea56f09de6d1c567b1029210b8f3f3306127021f0ce433cef92f4bf1578c6470189f3ebd08f6cb9199b4d3c94f923
2022-08-14 01:14:53 +08:00

21 lines
543 B
Text

/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
module.exports = baseSortBy;