UNPKG

caminho

Version:

Tool for creating efficient data pipelines in a JavaScript environment

20 lines 897 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNewValueBag = getNewValueBag; exports.buildValueBagAccumulator = buildValueBagAccumulator; function getNewValueBag(oldValueBag, toProvide, newValue) { return { ...oldValueBag, [toProvide]: newValue }; } function buildValueBagAccumulator(pipesParams) { const providablePipeParams = pipesParams.filter((pipeParams) => pipeParams.provides); return function getAccumulatedParallelBag(valueBags) { function accumulateParallelProvidedValues(valueBag, pipeParams, index) { if (pipeParams.provides) { valueBag[pipeParams.provides] = valueBags[index][pipeParams.provides]; } return valueBag; } return providablePipeParams.reduce(accumulateParallelProvidedValues, { ...valueBags[0] }); }; } //# sourceMappingURL=valueBag.js.map