• File: _baseSortBy.js
  • Full Path: /var/www/nodejs/callDir/node_modules/lodash/_baseSortBy.js
  • Date Modified: 06/03/2024 5:11 PM
  • File size: 543 bytes
  • MIME-type: text/plain
  • Charset: utf-8
/**
 * 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;