* Helper to extract text from SSE response * Note: Can only be called once per response stream. For multiple reads, * get the reader manually and read multiple times.
(response: Response)
| 88 | * get the reader manually and read multiple times. |
| 89 | */ |
| 90 | async function readSSEEvent(response: Response): Promise<string> { |
| 91 | const reader = response.body?.getReader(); |
| 92 | const { value } = await reader!.read(); |
| 93 | return new TextDecoder().decode(value); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Helper to send JSON-RPC request |
no outgoing calls
no test coverage detected
searching dependent graphs…