( path: string, schema: z.ZodType<T>, )
| 41 | } |
| 42 | |
| 43 | async function readJsonFile<T>( |
| 44 | path: string, |
| 45 | schema: z.ZodType<T>, |
| 46 | ): Promise<T | null> { |
| 47 | try { |
| 48 | const content = await readFile(path, { encoding: 'utf-8' }) |
| 49 | const result = schema.safeParse(jsonParse(content)) |
| 50 | return result.success ? result.data : null |
| 51 | } catch { |
| 52 | return null |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | async function copySnapshotToLocal( |
| 57 | agentType: string, |
no test coverage detected