MCPcopy
hub / github.com/tidwall/gjson / modFromStr

Function modFromStr

gjson.go:3237–3242  ·  view source on GitHub ↗

@fromstr converts a string to json "{\"id\":1023,\"name\":\"alert\"}" -> {"id":1023,"name":"alert"}

(json, arg string)

Source from the content-addressed store, hash-verified

3235//
3236// "{\"id\":1023,\"name\":\"alert\"}" -> {"id":1023,"name":"alert"}
3237func modFromStr(json, arg string) string {
3238 if !Valid(json) {
3239 return ""
3240 }
3241 return Parse(json).String()
3242}
3243
3244// @tostr converts a string to json
3245//

Callers

nothing calls this directly

Calls 3

ValidFunction · 0.85
ParseFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…