* The base implementation of `_.sortByOrder` without param guards. * * @private * @param {Array|Object|string} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {boolean[]} orders The sort orders o
(collection, iteratees, orders)
| 4179 | * @returns {Array} Returns the new sorted array. |
| 4180 | */ |
| 4181 | function baseSortByOrder(collection, iteratees, orders) { |
| 4182 | var callback = getCallback(), |
| 4183 | index = -1; |
| 4184 | |
| 4185 | iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); }); |
| 4186 | |
| 4187 | var result = baseMap(collection, function(value) { |
| 4188 | var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); |
| 4189 | return { 'criteria': criteria, 'index': ++index, 'value': value }; |
| 4190 | }); |
| 4191 | |
| 4192 | return baseSortBy(result, function(object, other) { |
| 4193 | return compareMultiple(object, other, orders); |
| 4194 | }); |
| 4195 | } |
| 4196 | |
| 4197 | /** |
| 4198 | * The base implementation of `_.sum` without support for callback shorthands |
no test coverage detected