Skip to main content

Class: SliceSelector

jsonpath.selectors.SliceSelector

Base class for all JSONPath segments and selectors.

Hierarchy

Constructors

constructor

new SliceSelector(environment, token, start?, stop?, step?): SliceSelector

Parameters

NameType
environmentJSONPathEnvironment
tokenToken
start?number
stop?number
step?number

Returns

SliceSelector

Overrides

JSONPathSelector.constructor

Defined in

src/path/selectors.ts:149

Properties

environment

Readonly environment: JSONPathEnvironment

Inherited from

JSONPathSelector.environment

Defined in

src/path/selectors.ts:150


start

Optional Readonly start: number

Defined in

src/path/selectors.ts:152


step

Optional Readonly step: number

Defined in

src/path/selectors.ts:154


stop

Optional Readonly stop: number

Defined in

src/path/selectors.ts:153


token

Readonly token: Token

The token at the start of this selector.

Inherited from

JSONPathSelector.token

Defined in

src/path/selectors.ts:151

Methods

checkRange

checkRange(...indices): void

Parameters

NameType
...indices(undefined | number)[]

Returns

void

Defined in

src/path/selectors.ts:199


lazyResolve

lazyResolve(nodes): Generator<JSONPathNode, any, unknown>

Parameters

NameTypeDescription
nodesIterable<JSONPathNode>Nodes matched by preceding selectors.

Returns

Generator<JSONPathNode, any, unknown>

Overrides

JSONPathSelector.lazyResolve

Defined in

src/path/selectors.ts:177


lazySlice

lazySlice(arr, start?, stop?, step?): Generator<[number, JSONValue], any, unknown>

Parameters

NameType
arrJSONValue[]
start?number
stop?number
step?number

Returns

Generator<[number, JSONValue], any, unknown>

Defined in

src/path/selectors.ts:261


resolve

resolve(nodes): JSONPathNode[]

Parameters

NameTypeDescription
nodesJSONPathNode[]Nodes matched by preceding selectors.

Returns

JSONPathNode[]

Overrides

JSONPathSelector.resolve

Defined in

src/path/selectors.ts:160


slice

slice(arr, start?, stop?, step?): [number, JSONValue][]

Parameters

NameType
arrJSONValue[]
start?number
stop?number
step?number

Returns

[number, JSONValue][]

Defined in

src/path/selectors.ts:212


toString

toString(): string

Return a canonical string representation of this selector.

Returns

string

Overrides

JSONPathSelector.toString

Defined in

src/path/selectors.ts:192