(other JSON)
| 552 | } |
| 553 | |
| 554 | func (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 | |
| 567 | func (j *jsonEncoded) Exists(key string) (bool, error) { |
| 568 | if dec := j.alreadyDecoded(); dec != nil { |
nothing calls this directly
no test coverage detected