@zowe/imperative
Version:
framework for building configurable CLIs
31 lines • 889 B
JavaScript
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.BufferBuilder = void 0;
const stream_1 = require("stream");
class BufferBuilder extends stream_1.Duplex {
constructor() {
super();
this.chunks = [];
}
_write(chunk, _encoding, callback) {
this.chunks.push(chunk);
callback();
}
_read(_size) {
const concatBuf = Buffer.concat(this.chunks);
this.push(concatBuf);
this.push(null);
}
}
exports.BufferBuilder = BufferBuilder;
//# sourceMappingURL=BufferBuilder.js.map
;