UNPKG

module-composer

Version:

Bring order to chaos. Level up your JS application architecture with Module Composer, a tiny but powerful module composition utility based on functional dependency injection.

10 lines (6 loc) 206 B
const invokeOrReturn = require('./invoke-or-return'); module.exports = (...funs) => { const acc = {}; for (const fun of funs) { Object.assign(acc, invokeOrReturn(fun, acc)); } return acc; };