stream.js 465 B

1234567891011121314
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var merge2 = require("merge2");
  4. /**
  5. * Merge multiple streams and propagate their errors into one stream in parallel.
  6. */
  7. function merge(streams) {
  8. var mergedStream = merge2(streams);
  9. streams.forEach(function (stream) {
  10. stream.on('error', function (err) { return mergedStream.emit('error', err); });
  11. });
  12. return mergedStream;
  13. }
  14. exports.merge = merge;