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

Function modValid

gjson.go:3227–3232  ·  view source on GitHub ↗

@valid ensures that the json is valid before moving on. An empty string is returned when the json is not valid, otherwise it returns the original json.

(json, arg string)

Source from the content-addressed store, hash-verified

3225// @valid ensures that the json is valid before moving on. An empty string is
3226// returned when the json is not valid, otherwise it returns the original json.
3227func modValid(json, arg string) string {
3228 if !Valid(json) {
3229 return ""
3230 }
3231 return json
3232}
3233
3234// @fromstr converts a string to json
3235//

Callers

nothing calls this directly

Calls 1

ValidFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…