Skip to main content

Namespace: jsonpointer

Classes

Type Aliases

MaybeJSONValue

Ƭ MaybeJSONValue: JSONValue | typeof UNDEFINED

Defined in

src/pointer/pointer.ts:15

Variables

UNDEFINED

Const UNDEFINED: typeof UNDEFINED

The symbol indicating the absence of a JSON value.

Defined in

src/pointer/pointer.ts:13

Functions

resolve

resolve(pointer, value, fallback?): JSONValue

Resolve JSON Pointer pointer against JSON-like data value.

Parameters

NameTypeDefault valueDescription
pointerstringundefinedA string representation of a JSON pointer.
valueJSONValueundefinedThe target JSON-like value, possibly loaded using JSON.parse().
fallbackMaybeJSONValueUNDEFINEDA default value to return if value has no path matching pointer.

Returns

JSONValue

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.

Defined in

src/pointer/index.ts:34