MCPcopy Index your code
hub / github.com/deployd/deployd / createAggregator

Function createAggregator

test-app/public/sinon.js:15449–15456  ·  view source on GitHub ↗

* Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function.

(setter, initializer)

Source from the content-addressed store, hash-verified

15447 * @returns {Function} Returns the new aggregator function.
15448 */
15449 function createAggregator(setter, initializer) {
15450 return function(collection, iteratee) {
15451 var func = isArray(collection) ? arrayAggregator : baseAggregator,
15452 accumulator = initializer ? initializer() : {};
15453
15454 return func(collection, setter, getIteratee(iteratee, 2), accumulator);
15455 };
15456 }
15457
15458 /**
15459 * Creates a function like `_.assign`.

Callers 1

sinon.jsFile · 0.85

Calls 2

getIterateeFunction · 0.85
isArrayFunction · 0.70

Tested by

no test coverage detected