MCPcopy Create free account
hub / github.com/TanStack/ai / parseJson

Function parseJson

packages/ai-devtools/src/components/hooks/ToolFixtureForm.tsx:319–325  ·  view source on GitHub ↗
(value: string, label: string)

Source from the content-addressed store, hash-verified

317}
318
319function parseJson(value: string, label: string): unknown {
320 try {
321 return JSON.parse(value)
322 } catch {
323 throw new Error(`${label} must be valid JSON.`)
324 }
325}
326
327function normalizeType(value: unknown): SchemaField['type'] {
328 if (value === 'boolean') return 'boolean'

Callers 2

createFixtureFunction · 0.85
parseFieldValueFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected