(body: unknown)
| 107 | } |
| 108 | |
| 109 | function recordFromBody(body: unknown): Record<string, unknown> { |
| 110 | if (!isRecord(body)) { |
| 111 | throw new Error('Invalid request body') |
| 112 | } |
| 113 | |
| 114 | const data = body.forwardedProps ?? body.data ?? body |
| 115 | if (!isRecord(data)) { |
| 116 | throw new Error('Invalid request body') |
| 117 | } |
| 118 | |
| 119 | return data |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * Drives `generateImage` with `otelMiddleware` against the same aimock mount |
no test coverage detected