mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
committed by
John-David Dalton
parent
602cc3f03d
commit
659e8c019c
15
lodash.js
15
lodash.js
@@ -3719,8 +3719,21 @@
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
*/
|
||||
function baseOrderBy(collection, iteratees, orders) {
|
||||
if (iteratees.length) {
|
||||
iteratees = arrayMap(iteratees, function(iteratee) {
|
||||
if (isArray(iteratee)) {
|
||||
return function(value) {
|
||||
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
||||
}
|
||||
}
|
||||
return iteratee;
|
||||
});
|
||||
} else {
|
||||
iteratees = [identity];
|
||||
}
|
||||
|
||||
var index = -1;
|
||||
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
|
||||
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
||||
|
||||
var result = baseMap(collection, function(value, key, collection) {
|
||||
var criteria = arrayMap(iteratees, function(iteratee) {
|
||||
|
||||
Reference in New Issue
Block a user