Skip to main content

Class: NameSelector

jsonpath.selectors.NameSelector

Shorthand and quoted name selector.

Hierarchy

Constructors

constructor

new NameSelector(environment, token, name, shorthand): NameSelector

Parameters

NameType
environmentJSONPathEnvironment
tokenToken
namestring
shorthandboolean

Returns

NameSelector

Overrides

JSONPathSelector.constructor

Defined in

src/path/selectors.ts:43

Properties

environment

Readonly environment: JSONPathEnvironment

Inherited from

JSONPathSelector.environment

Defined in

src/path/selectors.ts:44


name

Readonly name: string

Defined in

src/path/selectors.ts:46


shorthand

Readonly shorthand: boolean

Defined in

src/path/selectors.ts:47


token

Readonly token: Token

The token at the start of this selector.

Inherited from

JSONPathSelector.token

Defined in

src/path/selectors.ts:45

Methods

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:68


resolve

resolve(nodes): JSONPathNode[]

Parameters

NameTypeDescription
nodesJSONPathNode[]Nodes matched by preceding selectors.

Returns

JSONPathNode[]

Overrides

JSONPathSelector.resolve

Defined in

src/path/selectors.ts:52


toString

toString(): string

Return a canonical string representation of this selector.

Returns

string

Overrides

JSONPathSelector.toString

Defined in

src/path/selectors.ts:80