MCPcopy
hub / github.com/codeaashu/claude-code / parseJSONUncached

Function parseJSONUncached

src/utils/json.ts:31–40  ·  view source on GitHub ↗
(json: string, shouldLogError: boolean)

Source from the content-addressed store, hash-verified

29const PARSE_CACHE_MAX_KEY_BYTES = 8 * 1024
30
31function parseJSONUncached(json: string, shouldLogError: boolean): CachedParse {
32 try {
33 return { ok: true, value: JSON.parse(stripBOM(json)) }
34 } catch (e) {
35 if (shouldLogError) {
36 logError(e)
37 }
38 return { ok: false }
39 }
40}
41
42const parseJSONCached = memoizeWithLRU(parseJSONUncached, json => json, 50)
43

Callers 1

json.tsFile · 0.85

Calls 3

stripBOMFunction · 0.90
logErrorFunction · 0.70
parseMethod · 0.45

Tested by

no test coverage detected