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

Function readJsonNumberFieldBuffer

src/parser.ts:615–621  ·  view source on GitHub ↗
(source: Buffer, objectBounds: BufferJsonValueBounds | null, field: string)

Source from the content-addressed store, hash-verified

613}
614
615function readJsonNumberFieldBuffer(source: Buffer, objectBounds: BufferJsonValueBounds | null, field: string): number | undefined {
616 if (!objectBounds || objectBounds.kind !== 'object') return undefined
617 const bounds = findObjectFieldValueBuffer(source, objectBounds.start, objectBounds.end, field)
618 if (!bounds) return undefined
619 const value = Number(source.subarray(bounds.start, bounds.end).toString('ascii'))
620 return Number.isFinite(value) ? value : undefined
621}
622
623function parseLargeUsageBuffer(source: Buffer, usageBounds: BufferJsonValueBounds | null) {
624 const usage: AssistantMessageContent['usage'] = {

Callers 1

parseLargeUsageBufferFunction · 0.85

Calls 1

Tested by

no test coverage detected