(other JSON)
| 391 | } |
| 392 | |
| 393 | func (j jsonNumber) Compare(other JSON) (int, error) { |
| 394 | cmp := cmpJSONTypes(j.Type(), other.Type()) |
| 395 | if cmp != 0 { |
| 396 | return cmp, nil |
| 397 | } |
| 398 | var err error |
| 399 | if other, err = decodeIfNeeded(other); err != nil { |
| 400 | return 0, err |
| 401 | } |
| 402 | dec := apd.Decimal(j) |
| 403 | o := apd.Decimal(other.(jsonNumber)) |
| 404 | return dec.Cmp(&o), nil |
| 405 | } |
| 406 | |
| 407 | func (j jsonString) Compare(other JSON) (int, error) { |
| 408 | cmp := cmpJSONTypes(j.Type(), other.Type()) |
no test coverage detected