(format?: string)
| 193 | } |
| 194 | |
| 195 | const resolveExportFormat = (format?: string): 'jsonl' | 'json' => { |
| 196 | if (!format) { |
| 197 | return 'jsonl' |
| 198 | } |
| 199 | |
| 200 | if (format === 'jsonl' || format === 'json') { |
| 201 | return format |
| 202 | } |
| 203 | |
| 204 | throw new Error(`Unsupported format: ${format}. Supported values: json, jsonl`) |
| 205 | } |
| 206 | |
| 207 | const resolveOutputPath = (filename: string | undefined, format: 'jsonl' | 'json'): string => { |
| 208 | const fallback = format === 'json' ? 'events.json' : 'events.jsonl' |