* 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)
| 12469 | * @returns {Function} Returns the new aggregator function. |
| 12470 | */ |
| 12471 | function createAggregator(setter, initializer) { |
| 12472 | return function(collection, iteratee) { |
| 12473 | var func = isArray(collection) ? arrayAggregator : baseAggregator, |
| 12474 | accumulator = initializer ? initializer() : {}; |
| 12475 | |
| 12476 | return func(collection, setter, getIteratee(iteratee, 2), accumulator); |
| 12477 | }; |
| 12478 | } |
| 12479 | |
| 12480 | /** |
| 12481 | * Creates a function like `_.assign`. |
no test coverage detected