MCPcopy Create free account
hub / github.com/getagentseal/codeburn / appendBufferJsonSegment

Function appendBufferJsonSegment

src/parser.ts:578–583  ·  view source on GitHub ↗
(source: Buffer, start: number, end: number, current: string, cap: number)

Source from the content-addressed store, hash-verified

576}
577
578function appendBufferJsonSegment(source: Buffer, start: number, end: number, current: string, cap: number): string {
579 if (start >= end || current.length >= cap) return current
580 const remaining = cap - current.length
581 const cappedEnd = Number.isFinite(cap) ? Math.min(end, start + remaining * 4) : end
582 return current + source.subarray(start, cappedEnd).toString('utf-8').slice(0, remaining)
583}
584
585function readJsonStringBuffer(source: Buffer, bounds: BufferJsonValueBounds | null, cap = Number.POSITIVE_INFINITY): string | undefined {
586 if (!bounds || bounds.kind !== 'string') return undefined

Callers 1

readJsonStringBufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected