* 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)
| 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`. |
no test coverage detected