(source: Buffer, start: number, end: number, current: string, cap: number)
| 576 | } |
| 577 | |
| 578 | function 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 | |
| 585 | function readJsonStringBuffer(source: Buffer, bounds: BufferJsonValueBounds | null, cap = Number.POSITIVE_INFINITY): string | undefined { |
| 586 | if (!bounds || bounds.kind !== 'string') return undefined |
no outgoing calls
no test coverage detected