(chunk: Buffer)
| 143 | } |
| 144 | |
| 145 | function* parseHeaders(chunk: Buffer): Generator<[name: string, value: string]> { |
| 146 | for (const line of eachLine(chunk)) { |
| 147 | const sep = line.indexOf(':'); |
| 148 | const name = line.subarray(0, sep); |
| 149 | const value = line.subarray(sep + 1); |
| 150 | yield [name.toString('utf8'), value.toString('utf8').trim()]; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Create a statefull message buffer that parses TSServer messages. |
no test coverage detected