mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v3.0.0.
This commit is contained in:
24
internal/baseSortBy.js
Normal file
24
internal/baseSortBy.js
Normal file
@@ -0,0 +1,24 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.sortBy` and `_.sortByAll` 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;
|
||||
}
|
||||
|
||||
return baseSortBy;
|
||||
});
|
||||
Reference in New Issue
Block a user