( body: any, bodySchema: z.ZodType<any>, )
| 290 | }); |
| 291 | |
| 292 | export function isValidBody<T extends Record<string, unknown>>( |
| 293 | body: any, |
| 294 | bodySchema: z.ZodType<any>, |
| 295 | ): body is T { |
| 296 | const safeParseOut = bodySchema.safeParse(body); |
| 297 | if ("error" in safeParseOut) { |
| 298 | console.error( |
| 299 | "Error parsing request body: " + safeParseOut.error.toString(), |
| 300 | ); |
| 301 | } |
| 302 | return safeParseOut.success; |
| 303 | } |
| 304 | |
| 305 | const monthNames = [ |
| 306 | "January", |
nothing calls this directly
no outgoing calls
no test coverage detected