( schema: S, value: unknown )
| 116 | } |
| 117 | |
| 118 | function parseOptionalSchema<S extends ApiSchema | undefined>( |
| 119 | schema: S, |
| 120 | value: unknown |
| 121 | ): EmptySchemaOutput<S> { |
| 122 | if (!schema) return undefined as EmptySchemaOutput<S> |
| 123 | return schema.parse(value) as EmptySchemaOutput<S> |
| 124 | } |
| 125 | |
| 126 | async function readResponseBody(response: Response): Promise<{ parsed: unknown; raw?: string }> { |
| 127 | const text = await response.text() |
no test coverage detected