1234567891011121314151617181920212223 |
- import arrayAggregator from './_arrayAggregator.js';
- import baseAggregator from './_baseAggregator.js';
- import baseIteratee from './_baseIteratee.js';
- import isArray from './isArray.js';
- function createAggregator(setter, initializer) {
- return function(collection, iteratee) {
- var func = isArray(collection) ? arrayAggregator : baseAggregator,
- accumulator = initializer ? initializer() : {};
- return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
- };
- }
- export default createAggregator;
|