MCPcopy Index your code
hub / github.com/simstudioai/sim / parseViaStream

Function parseViaStream

apps/sim/lib/table/import.test.ts:282–290  ·  view source on GitHub ↗
(csv: string, delimiter = ',')

Source from the content-addressed store, hash-verified

280
281 describe('createCsvParser', () => {
282 async function parseViaStream(csv: string, delimiter = ',') {
283 const parser = createCsvParser(delimiter)
284 Readable.from([csv]).pipe(parser)
285 const rows: Record<string, unknown>[] = []
286 for await (const record of parser as AsyncIterable<Record<string, unknown>>) {
287 rows.push(record)
288 }
289 return rows
290 }
291
292 it('streams records keyed by header, matching parseCsvBuffer', async () => {
293 const csv = 'name,age\nAlice,30\nBob,40\n'

Callers 1

import.test.tsFile · 0.85

Calls 2

createCsvParserFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected