UNPKG

415 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.readableToArray = void 0;
4/**
5 * Convenience function to read the whole Readable stream into Array (in-memory)
6 * and return that array.
7 */
8async function readableToArray(readable) {
9 const a = [];
10 for await (const item of readable) {
11 a.push(item);
12 }
13 return a;
14}
15exports.readableToArray = readableToArray;