MCPcopy Create free account
hub / github.com/conforma/cli / IsJson

Function IsJson

internal/utils/helpers.go:106–109  ·  view source on GitHub ↗

detect if the string is json

(data string)

Source from the content-addressed store, hash-verified

104
105// detect if the string is json
106func IsJson(data string) bool {
107 var jsMsg json.RawMessage
108 return json.Unmarshal([]byte(data), &jsMsg) == nil
109}
110
111// detect if the string is yamlMap
112func IsYamlMap(data string) bool {

Callers 2

detectInputFunction · 0.92
TestIsJsonFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsJsonFunction · 0.68