eslint-plugin-lodash
Version:
Lodash specific linting rules for ESLint
13 lines (11 loc) • 410 B
JavaScript
const assignWith = require('lodash/assignWith')
const mapValues = require('lodash/mapValues')
const over = require('lodash/over')
function combineVisitorObjects(...objects) {
const accumForAllVisitors = assignWith({}, ...objects, (objValue, sourceValue) => (objValue || []).concat(sourceValue))
return mapValues(accumForAllVisitors, over)
}
module.exports = {
combineVisitorObjects
}