UNPKG

481 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const stream_1 = require("stream");
4class ReadableString extends stream_1.Readable {
5 constructor(str) {
6 super();
7 this.str = str;
8 this.sent = false;
9 }
10 _read() {
11 if (!this.sent) {
12 this.push(Buffer.from(this.str));
13 this.sent = true;
14 }
15 else {
16 this.push(null);
17 }
18 }
19}
20exports.default = ReadableString;