( path: string, schema: z.ZodType<T>, )
| 55 | } |
| 56 | |
| 57 | async function readJsonFile<T>( |
| 58 | path: string, |
| 59 | schema: z.ZodType<T>, |
| 60 | ): Promise<T | null> { |
| 61 | try { |
| 62 | const content = await readFile(path, { encoding: 'utf-8' }) |
| 63 | const result = schema.safeParse(jsonParse(content)) |
| 64 | return result.success ? result.data : null |
| 65 | } catch { |
| 66 | return null |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | async function copySnapshotToLocal( |
| 71 | agentType: string, |
no test coverage detected