Skip to content

JSONPath Tools / @jsonpath-tools/jsonpath / Node

Class: Node

JSON value with its location.

Constructors

Constructor

ts
new Node(
   value, 
   pathSegment, 
   parent): Node;

Parameters

value

JSONValue

JSON value.

pathSegment

NormalizedPathSegment

Property name or index that can be used to extract this value from a parent node value.

parent

Node | null

Node of a value from which this value was extracted. null when the current value is a root.

Returns

Node

Properties

parent

ts
readonly parent: Node | null;

Node of a value from which this value was extracted. null when the current value is a root.


pathSegment

ts
readonly pathSegment: NormalizedPathSegment;

Property name or index that can be used to extract this value from a parent node value.


value

ts
readonly value: JSONValue;

JSON value.

Methods

toNormalizedPath()

ts
toNormalizedPath(): NormalizedPath;

Creates a normalized path from the location.

Returns

NormalizedPath