MCPcopy
hub / github.com/simstudioai/sim / parseBuffer

Method parseBuffer

apps/sim/lib/file-parsers/csv-parser.ts:34–45  ·  view source on GitHub ↗
(buffer: Buffer)

Source from the content-addressed store, hash-verified

32 }
33
34 async parseBuffer(buffer: Buffer): Promise<FileParseResult> {
35 const bufferSize = buffer.length
36 logger.info(
37 `Parsing CSV buffer, size: ${bufferSize} bytes (${(bufferSize / 1024 / 1024).toFixed(2)} MB)`
38 )
39
40 const stream = new Readable({ read() {} })
41 stream.push(buffer)
42 stream.push(null)
43
44 return this.parseStream(stream)
45 }
46
47 private parseStream(inputStream: NodeJS.ReadableStream): Promise<FileParseResult> {
48 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls 3

parseStreamMethod · 0.95
infoMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected