|
- import {WriteStream} from 'tty';
-
- export class DummyWriteStream extends WriteStream {
- private bufferInternal = Buffer.from('');
-
- constructor() {
- super(0);
- }
-
- write(input: Uint8Array | string, _encoding?: BufferEncoding | ((err?: Error) => void), _cb?: (err?: Error) => void): boolean {
- this.bufferInternal = Buffer.concat([this.bufferInternal, Buffer.from(input)]);
- // noop
- return true;
- }
-
- get buffer(): Buffer {
- return this.bufferInternal;
- }
- }
|