Namespace: jsonpointer
Classes
- JSONPointer
- JSONPointerError
- JSONPointerIndexError
- JSONPointerKeyError
- JSONPointerResolutionError
- JSONPointerSyntaxError
- JSONPointerTypeError
- RelativeJSONPointer
Type Aliases
MaybeJSONValue
Ƭ MaybeJSONValue: JSONValue
| typeof UNDEFINED
Defined in
Variables
UNDEFINED
• Const
UNDEFINED: typeof UNDEFINED
The symbol indicating the absence of a JSON value.
Defined in
Functions
resolve
▸ resolve(pointer
, value
, fallback?
): JSONValue
Resolve JSON Pointer pointer against JSON-like data value.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
pointer | string | undefined | A string representation of a JSON pointer. |
value | JSONValue | undefined | The target JSON-like value, possibly loaded using JSON.parse() . |
fallback | MaybeJSONValue | UNDEFINED | A default value to return if value has no path matching pointer . |
Returns
The value identified by pointer or, if given, the fallback
value in the even of a JSONPointerResolutionError
.
Throws
JSONPointerResolutionError If the value pointed to by pointer does not exist in value, and no fallback value is given.
Throws
JSONPointerSyntaxError If pointer is malformed according to RFC 6901.