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

Method Compare

pkg/util/json/encoded.go:554–565  ·  view source on GitHub ↗
(other JSON)

Source from the content-addressed store, hash-verified

552}
553
554func (j *jsonEncoded) Compare(other JSON) (int, error) {
555 if cmp := cmpJSONTypes(j.Type(), other.Type()); cmp != 0 {
556 return cmp, nil
557 }
558 // TODO(justin): this can be optimized in some cases. We don't necessarily
559 // need to decode all of an array or every object key.
560 dec, err := j.shallowDecode()
561 if err != nil {
562 return 0, err
563 }
564 return dec.Compare(other)
565}
566
567func (j *jsonEncoded) Exists(key string) (bool, error) {
568 if dec := j.alreadyDecoded(); dec != nil {

Callers

nothing calls this directly

Calls 5

TypeMethod · 0.95
shallowDecodeMethod · 0.95
cmpJSONTypesFunction · 0.85
TypeMethod · 0.65
CompareMethod · 0.65

Tested by

no test coverage detected