MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / tryParseJson

Function tryParseJson

web/src/app/api/v1/gravity-index/_post.ts:22–28  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

20const FETCH_TIMEOUT_MS = 30_000
21
22const tryParseJson = (text: string): unknown => {
23 try {
24 return JSON.parse(text)
25 } catch {
26 return null
27 }
28}
29
30const getErrorMessage = (value: unknown): string | undefined => {
31 if (!value || typeof value !== 'object') return undefined

Callers 1

postGravityIndexFunction · 0.70

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected