You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
465 B

4 years ago
  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;