(other JSON)
| 566 | } |
| 567 | |
| 568 | func (j *jsonEncoded) Compare(other JSON) (int, error) { |
| 569 | if cmp := cmpJSONTypes(j.Type(), other.Type()); cmp != 0 { |
| 570 | return cmp, nil |
| 571 | } |
| 572 | // TODO(justin): this can be optimized in some cases. We don't necessarily |
| 573 | // need to decode all of an array or every object key. |
| 574 | dec, err := j.shallowDecode() |
| 575 | if err != nil { |
| 576 | return 0, err |
| 577 | } |
| 578 | return dec.Compare(other) |
| 579 | } |
| 580 | |
| 581 | func (j *jsonEncoded) Exists(key string) (bool, error) { |
| 582 | if dec := j.alreadyDecoded(); dec != nil { |
nothing calls this directly
no test coverage detected