Class: SliceSelector
jsonpath.selectors.SliceSelector
Base class for all JSONPath segments and selectors.
Hierarchy
-
↳
SliceSelector
Constructors
constructor
• new SliceSelector(environment
, token
, start?
, stop?
, step?
): SliceSelector
Parameters
Name | Type |
---|---|
environment | JSONPathEnvironment |
token | Token |
start? | number |
stop? | number |
step? | number |
Returns
Overrides
Defined in
Properties
environment
• Readonly
environment: JSONPathEnvironment
Inherited from
Defined in
start
• Optional
Readonly
start: number
Defined in
step
• Optional
Readonly
step: number
Defined in
stop
• Optional
Readonly
stop: number
Defined in
token
• Readonly
token: Token
The token at the start of this selector.
Inherited from
Defined in
Methods
checkRange
▸ checkRange(...indices
): void
Parameters
Name | Type |
---|---|
...indices | (undefined | number )[] |
Returns
void
Defined in
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
lazySlice
▸ lazySlice(arr
, start?
, stop?
, step?
): Generator
<[number
, JSONValue
], any
, unknown
>
Parameters
Name | Type |
---|---|
arr | JSONValue [] |
start? | number |
stop? | number |
step? | number |
Returns
Generator
<[number
, JSONValue
], any
, unknown
>
Defined in
resolve
▸ resolve(nodes
): JSONPathNode
[]
Parameters
Name | Type | Description |
---|---|---|
nodes | JSONPathNode [] | Nodes matched by preceding selectors. |
Returns
Overrides
Defined in
slice
▸ slice(arr
, start?
, stop?
, step?
): [number
, JSONValue
][]
Parameters
Name | Type |
---|---|
arr | JSONValue [] |
start? | number |
stop? | number |
step? | number |
Returns
[number
, JSONValue
][]
Defined in
toString
▸ toString(): string
Return a canonical string representation of this selector.
Returns
string