( json: unknown, )
| 38 | } |
| 39 | |
| 40 | export async function parsePersistConfig( |
| 41 | json: unknown, |
| 42 | ): Promise<EnhancedPersistConfig> { |
| 43 | const schema = z.object({ |
| 44 | persist: persistConfigSchema.optional(), |
| 45 | upload: uploadConfigSchema.optional(), |
| 46 | }); |
| 47 | const result = await schema.safeParseAsync(json); |
| 48 | if (result.error) { |
| 49 | throw new Error( |
| 50 | `Code PushUp config is invalid:\n${z.prettifyError(result.error)}`, |
| 51 | ); |
| 52 | } |
| 53 | return result.data; |
| 54 | } |
no outgoing calls
no test coverage detected