‘liusuyi’
2023-05-31 3280739f26b778b59e2588d8f08012c31f79174b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * 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;