* Strips an optional trailing carriage return from a single SSE line, so both * `\n`- and `\r\n`-terminated framings parse identically.
(line: string)
| 105 | * `\n`- and `\r\n`-terminated framings parse identically. |
| 106 | */ |
| 107 | function stripCarriageReturn(line: string): string { |
| 108 | return line.endsWith('\r') ? line.slice(0, -1) : line |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * The single client-side SSE decode engine. Reads a byte stream, decodes it |