Skip to main content

Class: JSONPathSelector

jsonpath.selectors.JSONPathSelector

Base class for all JSONPath segments and selectors.

Hierarchy

Constructors

constructor

new JSONPathSelector(environment, token): JSONPathSelector

Parameters

NameTypeDescription
environmentJSONPathEnvironment-
tokenTokenThe token at the start of this selector.

Returns

JSONPathSelector

Defined in

src/path/selectors.ts:16

Properties

environment

Readonly environment: JSONPathEnvironment

Defined in

src/path/selectors.ts:17


token

Readonly token: Token

The token at the start of this selector.

Defined in

src/path/selectors.ts:18

Methods

lazyResolve

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

Parameters

NameTypeDescription
nodesIterable<JSONPathNode>Nodes matched by preceding selectors.

Returns

Generator<JSONPathNode, any, unknown>

Defined in

src/path/selectors.ts:29


resolve

resolve(nodes): JSONPathNode[]

Parameters

NameTypeDescription
nodesJSONPathNode[]Nodes matched by preceding selectors.

Returns

JSONPathNode[]

Defined in

src/path/selectors.ts:24


toString

toString(): string

Return a canonical string representation of this selector.

Returns

string

Defined in

src/path/selectors.ts:36