MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / parseJSONUncached

Function parseJSONUncached

source code/utils/json.ts:33–42  ·  view source on GitHub ↗
(json: string, shouldLogError: boolean)

Source from the content-addressed store, hash-verified

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

Callers 1

json.tsFile · 0.85

Calls 2

stripBOMFunction · 0.90
logErrorFunction · 0.70

Tested by

no test coverage detected