(buffer: string)
| 137 | } |
| 138 | |
| 139 | private consumeBlocks(buffer: string): string { |
| 140 | let next = buffer; |
| 141 | for (;;) { |
| 142 | const index = next.indexOf("\n\n"); |
| 143 | if (index === -1) return next; |
| 144 | const block = next.slice(0, index); |
| 145 | next = next.slice(index + 2); |
| 146 | this.recordBlock(block); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | private recordBlock(block: string): void { |
| 151 | let data = ""; |