Skip to content

findJsonObjectEnd

findJsonObjectEnd(text, start, maxPayloadBytes?): number | null

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/toolCallRepair/grammar.ts:86

Finds the exclusive end offset of a balanced JSON object starting at start. Returns null if the object never closes, or (when maxPayloadBytes is set) as soon as the scan runs past the cap — the payload-size gate that keeps a runaway blob from being treated as a tool call.

string

number

number

number | null