👁 查看:_baseSortBy.js
路径:/home/boguraj1/public_html/jobsite/node_modules/lodash/_baseSortBy.js
大小:543 B · 修改:2022-11-21 20:09:38 · 权限:0644 · 可写
/**
 * 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;