(res: Response)
| 50 | : body; |
| 51 | |
| 52 | const readJson = async (res: Response): Promise<unknown> => { |
| 53 | if (!isJson(res)) { |
| 54 | const got = res.headers.get("content-type") ?? "<missing>"; |
| 55 | |
| 56 | throw new Error(`Expected JSON, got: ${got}`); |
| 57 | } |
| 58 | |
| 59 | return res.json(); |
| 60 | }; |
| 61 | |
| 62 | const isMessageEnvelope = (value: unknown): value is IMessageEnvelope => |
| 63 | value !== null && |
no test coverage detected