MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / decodeIfNeeded

Function decodeIfNeeded

pkg/util/json/json.go:382–391  ·  view source on GitHub ↗
(j JSON)

Source from the content-addressed store, hash-verified

380func (j jsonTrue) Compare(other JSON) (int, error) { return cmpJSONTypes(j.Type(), other.Type()), nil }
381
382func decodeIfNeeded(j JSON) (JSON, error) {
383 if enc, ok := j.(*jsonEncoded); ok {
384 var err error
385 j, err = enc.decode()
386 if err != nil {
387 return nil, err
388 }
389 }
390 return j, nil
391}
392
393func (j jsonNumber) Compare(other JSON) (int, error) {
394 cmp := cmpJSONTypes(j.Type(), other.Type())

Callers 4

CompareMethod · 0.85
CompareMethod · 0.85
CompareMethod · 0.85
CompareMethod · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…