(headers: Headers.Headers)
| 33 | } |
| 34 | |
| 35 | const headersRecord = (headers: Headers.Headers): Record<string, string> => |
| 36 | Object.fromEntries( |
| 37 | Object.entries(headers as Record<string, unknown>).filter( |
| 38 | (entry): entry is [string, string] => typeof entry[1] === "string", |
| 39 | ), |
| 40 | ) |
| 41 | |
| 42 | const textEvent = (direction: "client" | "server", body: string): WebSocketEvent => ({ |
| 43 | direction, |