Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ClydeTime/Surge
/ toObj
Method
toObj
Script/Env.js:53–59 ·
view source on GitHub ↗
(str, defaultValue = null)
Source
from the content-addressed store, hash-verified
51
}
52
53
toObj(str, defaultValue = null) {
54
try {
55
return
JSON.parse(str)
56
} catch {
57
return
defaultValue
58
}
59
}
60
61
toStr(obj, defaultValue = null) {
62
try {
Callers
nothing calls this directly
Calls
1
parse
Method · 0.45
Tested by
no test coverage detected