(headers: Headers)
| 109 | } |
| 110 | |
| 111 | function headersJson(headers: Headers): string { |
| 112 | const values: Record<string, string> = {} |
| 113 | for (const [key, value] of headers.entries()) { |
| 114 | values[key] = value |
| 115 | } |
| 116 | return JSON.stringify(values) |
| 117 | } |
| 118 | |
| 119 | function encodeSseFrame(data: string): Uint8Array { |
| 120 | return new TextEncoder().encode(`data: ${data}\n\n`) |
no test coverage detected