"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NumberSum = void 0;
const index_js_1 = require("../model/index.js");
class NumberSum extends index_js_1.Pipe {
    async apply(inputSet) {
        const sum = inputSet.reduce((sum, el) => {
            const num = parseFloat(el.value) || 0;
            return num + sum;
        }, 0);
        const el = await this.createDocument(sum);
        return [el];
    }
}
exports.NumberSum = NumberSum;
NumberSum.$type = 'Number.sum';
NumberSum.$help = `
Returns a single element whose value is a numeric sum of all input set values.
`;
//# sourceMappingURL=Number.sum.js.map