Class: IndexSelector
jsonpath.selectors.IndexSelector
Array index selector.
Hierarchy
-
↳
IndexSelector
Constructors
constructor
• new IndexSelector(environment
, token
, index
): IndexSelector
Parameters
Name | Type |
---|---|
environment | JSONPathEnvironment |
token | Token |
index | number |
Returns
Overrides
Defined in
Properties
environment
• Readonly
environment: JSONPathEnvironment
Inherited from
Defined in
index
• Readonly
index: number
Defined in
token
• Readonly
token: Token
The token at the start of this selector.
Inherited from
Defined in
Methods
lazyResolve
▸ lazyResolve(nodes
): Generator
<JSONPathNode
, any
, unknown
>
Parameters
Name | Type | Description |
---|---|---|
nodes | Iterable <JSONPathNode > | Nodes matched by preceding selectors. |
Returns
Generator
<JSONPathNode
, any
, unknown
>
Overrides
Defined in
normalizedIndex
▸ normalizedIndex(length
): number
Parameters
Name | Type |
---|---|
length | number |
Returns
number
Defined in
resolve
▸ resolve(nodes
): JSONPathNode
[]
Parameters
Name | Type | Description |
---|---|---|
nodes | JSONPathNode [] | Nodes matched by preceding selectors. |
Returns
Overrides
Defined in
toString
▸ toString(): string
Return a canonical string representation of this selector.
Returns
string