MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / baseSortByOrder

Function baseSortByOrder

lib/web/jshint.js:4181–4195  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 2

runInContextFunction · 0.85
sortByOrderFunction · 0.85

Calls 6

getCallbackFunction · 0.85
arrayMapFunction · 0.85
baseMapFunction · 0.85
baseSortByFunction · 0.85
compareMultipleFunction · 0.85
callbackFunction · 0.70

Tested by

no test coverage detected