MCPcopy Create free account
hub / github.com/Semporia/Scripts / toObj

Method toObj

jd_try.js:578–584  ·  view source on GitHub ↗
(str, defaultValue = null)

Source from the content-addressed store, hash-verified

576 }
577
578 toObj(str, defaultValue = null) {
579 try {
580 return JSON.parse(str)
581 } catch {
582 return defaultValue
583 }
584 }
585
586 toStr(obj, defaultValue = null) {
587 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected