Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
10
export
const
optimisticParseJSON = <T>(text: string): T | null => {
11
try {
12
return
JSON.parse(text)
13
} catch {
14
return
null
15
}
16
}
Callers
7
all
Method · 0.90
read
Method · 0.90
getParsedData
Method · 0.90
getResourceIds
Method · 0.90
getResourceIds
Method · 0.90
open
Method · 0.90
readResource
Method · 0.90
Calls
1
parse
Method · 0.80
Tested by
no test coverage detected