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

Function readJsonNumberField

src/parser.ts:270–276  ·  view source on GitHub ↗
(source: string, objectBounds: JsonValueBounds | null, field: string)

Source from the content-addressed store, hash-verified

268}
269
270function readJsonNumberField(source: string, objectBounds: JsonValueBounds | null, field: string): number | undefined {
271 if (!objectBounds || objectBounds.kind !== 'object') return undefined
272 const bounds = findObjectFieldValue(source, objectBounds.start, objectBounds.end, field)
273 if (!bounds) return undefined
274 const value = Number(source.slice(bounds.start, bounds.end))
275 return Number.isFinite(value) ? value : undefined
276}
277
278function parseLargeUsage(source: string, usageBounds: JsonValueBounds | null) {
279 const usage: AssistantMessageContent['usage'] = {

Callers 1

parseLargeUsageFunction · 0.85

Calls 1

findObjectFieldValueFunction · 0.85

Tested by

no test coverage detected