You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_baseSortBy.js 543B

123456789101112131415161718192021
  1. /**
  2. * The base implementation of `_.sortBy` which uses `comparer` to define the
  3. * sort order of `array` and replaces criteria objects with their corresponding
  4. * values.
  5. *
  6. * @private
  7. * @param {Array} array The array to sort.
  8. * @param {Function} comparer The function to define sort order.
  9. * @returns {Array} Returns `array`.
  10. */
  11. function baseSortBy(array, comparer) {
  12. var length = array.length;
  13. array.sort(comparer);
  14. while (length--) {
  15. array[length] = array[length].value;
  16. }
  17. return array;
  18. }
  19. module.exports = baseSortBy;