source: trip-planner-front/node_modules/fast-glob/out/utils/stream.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 629 bytes
RevLine 
[6a3a178]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.merge = void 0;
4const merge2 = require("merge2");
5function merge(streams) {
6 const mergedStream = merge2(streams);
7 streams.forEach((stream) => {
8 stream.once('error', (error) => mergedStream.emit('error', error));
9 });
10 mergedStream.once('close', () => propagateCloseEventToSources(streams));
11 mergedStream.once('end', () => propagateCloseEventToSources(streams));
12 return mergedStream;
13}
14exports.merge = merge;
15function propagateCloseEventToSources(streams) {
16 streams.forEach((stream) => stream.emit('close'));
17}
Note: See TracBrowser for help on using the repository browser.