( filePath: string, lineSchema: z.ZodType<T>, value: T, )
| 94 | } |
| 95 | |
| 96 | export async function appendJsonlLine<T>( |
| 97 | filePath: string, |
| 98 | lineSchema: z.ZodType<T>, |
| 99 | value: T, |
| 100 | ): Promise<void> { |
| 101 | assertNonConfigWrite(filePath); |
| 102 | const parsed = lineSchema.parse(value); |
| 103 | await mkdir(dirname(filePath), { recursive: true }); |
| 104 | await appendFile(filePath, `${JSON.stringify(parsed)}\n`, 'utf-8'); |
| 105 | } |
no test coverage detected