"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeAll = void 0;
const flattenPar_1 = require("./flattenPar");
const fromIterable_1 = require("./fromIterable");
/**
 * Merges a variable list of streams in a non-deterministic fashion.
 * Up to `n` streams may be consumed in parallel and up to
 * `outputBuffer` chunks may be buffered by this operator.
 */
function mergeAll(n, outputBuffer = 16) {
    return (...streams) => (0, flattenPar_1.flattenPar_)((0, fromIterable_1.fromIterable)(streams), n, outputBuffer);
}
exports.mergeAll = mergeAll;
//# sourceMappingURL=mergeAll.js.map