UNPKG

@naturalcycles/nodejs-lib

Version:
19 lines 600 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const stream_1 = require("stream"); /** * Will push all results to `arr`, will emit nothing in the end. */ function writablePushToArray(arr, opt = {}) { return new stream_1.Writable({ objectMode: true, ...opt, write(chunk, _encoding, cb) { arr.push(chunk); // callback to signal that we processed input, but not emitting any output cb(); }, }); } exports.writablePushToArray = writablePushToArray; //# sourceMappingURL=writablePushToArray.js.map