| 44446 | sizeOf(s) { |
| 44447 | return this.isArray(s) || this.isObject(s) ? s.length : 0 |
| 44448 | } |
| 44449 | has(s, o) { |
| 44450 | if (this.isArray(s)) { |
| 44451 | const i = Number(o), |
| 44452 | a = i >>> 0 |
| 44453 | if (i !== a) |
| 44454 | throw new Jp( |
| 44455 | `Invalid array index "${o}": index must be an unsinged 32-bit integer`, |
| 44456 | { referenceToken: o, currentValue: s, realm: this.name } |
| 44457 | ) |
| 44458 | return a < this.sizeOf(s) |
| 44459 | } |
| 44460 | if (this.isObject(s)) { |
| 44461 | const i = s.keys(), |
| 44462 | a = new Set(i) |
| 44463 | if (i.length !== a.size) |
| 44464 | throw new Gp( |
| 44465 | `Object key "${o}" is not unique — JSON Pointer requires unique member names`, |
| 44466 | { referenceToken: o, currentValue: s, realm: this.name } |
| 44467 | ) |
| 44468 | return s.hasKey(o) |
| 44469 | } |
| 44470 | return !1 |
| 44471 | } |
| 44472 | evaluate(s, o) { |
| 44473 | return this.isArray(s) ? s.get(Number(o)) : s.get(o) |