Class: JSONPathNodeList
jsonpath.JSONPathNodeList
Constructors
constructor
• new JSONPathNodeList(nodes
): JSONPathNodeList
Parameters
Name | Type |
---|---|
nodes | JSONPathNode [] |
Returns
Defined in
Properties
nodes
• Readonly
nodes: JSONPathNode
[]
Defined in
Accessors
length
• get
length(): number
Returns
number
The number of nodes in the node list.
Defined in
Methods
[iterator]
▸ [iterator](): Iterator
<JSONPathNode
, any
, undefined
>
Returns
Iterator
<JSONPathNode
, any
, undefined
>
an iterator over nodes in the list.
Defined in
empty
▸ empty(): boolean
Returns
boolean
true
if the node list is empty.
Defined in
locations
▸ locations(): (string
| number
)[][]
Returns
(string
| number
)[][]
An array of locations for each node in the node list.
A location is an array of property names and array indices that were required to reach the node's value in the target JSON value.
Defined in
paths
▸ paths(): string
[]
Returns
string
[]
An array of normalized path strings for each node in the list.
A normalized path contains only property name and index selectors, and always uses bracketed segments, never shorthand selectors.
Defined in
pointers
▸ pointers(): JSONPointer
[]
Returns
An array of JSONPointer instances, one for each node in the list.
Defined in
values
▸ values(): JSONValue
[]
Returns
An array containing the values at each node in the list.
See
valuesOrSingular to unpack the array if there is only one node in the list.
Defined in
valuesOrSingular
▸ valuesOrSingular(): JSONValue
Like values, but returns the node's value is there is only one node in the list.