UNPKG

caminho

Version:

Tool for creating efficient data pipelines in a JavaScript environment

18 lines 836 B
import { __assign } from "tslib"; export function getNewValueBag(oldValueBag, toProvide, newValue) { var _a; return __assign(__assign({}, oldValueBag), (_a = {}, _a[toProvide] = newValue, _a)); } export function buildValueBagAccumulator(pipesParams) { var providablePipeParams = pipesParams.filter(function (pipeParams) { return 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, __assign({}, valueBags[0])); }; } //# sourceMappingURL=valueBag.js.map