stream-mock
Version:
Node stream mock module
20 lines • 569 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = require("stream");
class ObjectWritableMock extends stream_1.Writable {
constructor(options = {}) {
options.objectMode = true;
super(options);
this.data = [];
}
_write(chunk, _encoding, callback) {
this.data.push(chunk);
callback();
}
_final(callback) {
this.flatData = [].concat(...this.data);
callback();
}
}
exports.default = ObjectWritableMock;
//# sourceMappingURL=ObjectWritableMock.js.map