MCPcopy Create free account
hub / github.com/deta/surf / optimisticParseJSON

Function optimisticParseJSON

packages/utils/src/data/text.ts:10–16  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

8}
9
10export const optimisticParseJSON = <T>(text: string): T | null => {
11 try {
12 return JSON.parse(text)
13 } catch {
14 return null
15 }
16}

Callers 7

allMethod · 0.90
readMethod · 0.90
getParsedDataMethod · 0.90
getResourceIdsMethod · 0.90
getResourceIdsMethod · 0.90
openMethod · 0.90
readResourceMethod · 0.90

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected