(chunk: string)
| 133 | } |
| 134 | |
| 135 | push(chunk: string): void { |
| 136 | this.buffer += chunk; |
| 137 | for (;;) { |
| 138 | const line = this.tryReadLineMessage(); |
| 139 | if (line !== undefined) { |
| 140 | this.emit(line); |
| 141 | continue; |
| 142 | } |
| 143 | break; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | private tryReadLineMessage(): string | undefined { |
| 148 | const newline = this.buffer.indexOf('\n'); |