UNPKG

polymer-cli

Version:
39 lines 1.38 kB
"use strict"; /** * @license * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at * http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be found at * http://polymer.github.io/CONTRIBUTORS.txt * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ Object.defineProperty(exports, "__esModule", { value: true }); /** * Waits for the given ReadableStream */ function waitFor(stream) { return new Promise((resolve, reject) => { stream.on('end', resolve); stream.on('error', reject); }); } exports.waitFor = waitFor; /** * pipeStreams() takes in a collection streams and pipes them together, * returning the last stream in the pipeline. Each element in the `streams` * array must be either a stream, or an array of streams (see PipeStream). * pipeStreams() will then flatten this array before piping them all together. */ function pipeStreams(streams) { return Array.prototype.concat.apply([], streams) .reduce((a, b) => { return a.pipe(b); }); } exports.pipeStreams = pipeStreams; //# sourceMappingURL=streams.js.map