MCPcopy Create free account
hub / github.com/Noumena-Network/code / parseJSONL

Function parseJSONL

src/utils/json.ts:209–220  ·  view source on GitHub ↗
(
  data: string | Buffer,
  opts?: { strict?: boolean },
)

Source from the content-addressed store, hash-verified

207 * mode so line-level diagnostics are always available.
208 */
209export function parseJSONL<T>(
210 data: string | Buffer,
211 opts?: { strict?: boolean },
212): T[] {
213 if (bunJSONLParse && !opts?.strict) {
214 return parseJSONLBun<T>(data)
215 }
216 if (typeof data === 'string') {
217 return parseJSONLString<T>(data, opts?.strict)
218 }
219 return parseJSONLBuffer<T>(data, opts?.strict)
220}
221
222const MAX_JSONL_READ_BYTES = 100 * 1024 * 1024
223

Callers 6

loadTranscriptFileFunction · 0.90
getTranscriptStatsFunction · 0.90
json.test.tsFile · 0.90
createForkFunction · 0.90
errorHandlerFunction · 0.90
readJSONLFileFunction · 0.85

Calls 3

parseJSONLBunFunction · 0.85
parseJSONLStringFunction · 0.85
parseJSONLBufferFunction · 0.85

Tested by

no test coverage detected