MCPcopy Index your code
hub / github.com/cameri/nostream / resolveOutputPath

Function resolveOutputPath

src/scripts/export-events.ts:207–217  ·  view source on GitHub ↗
(filename: string | undefined, format: 'jsonl' | 'json')

Source from the content-addressed store, hash-verified

205}
206
207const resolveOutputPath = (filename: string | undefined, format: 'jsonl' | 'json'): string => {
208 const fallback = format === 'json' ? 'events.json' : 'events.jsonl'
209 const outputPath = path.resolve(filename || fallback)
210 const expectedExtension = format === 'json' ? '.json' : '.jsonl'
211
212 if (extname(outputPath).toLowerCase() !== expectedExtension) {
213 throw new Error(`Output file extension must be ${expectedExtension} when using --format ${format}`)
214 }
215
216 return outputPath
217}
218
219const toEvent = (row: EventRow) => ({
220 id: row.event_id.toString('hex'),

Callers 1

runExportEventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected