Namespace: jsonpath
Namespaces
Enumerations
Classes
- JSONPath
- JSONPathEnvironment
- JSONPathError
- JSONPathIndexError
- JSONPathLexerError
- JSONPathNode
- JSONPathNodeList
- JSONPathRecursionLimitError
- JSONPathSyntaxError
- JSONPathTypeError
- Token
References
FilterFunction
Re-exports FilterFunction
FunctionExpressionType
Re-exports FunctionExpressionType
Type Aliases
FilterContext
Ƭ FilterContext: Object
Object passed to FilterExpression.evaluate().
Type declaration
Name | Type |
---|---|
currentKey? | string | number |
currentValue | JSONValue |
environment | JSONPathEnvironment |
lazy? | boolean |
rootValue | JSONValue |
Defined in
JSONPathEnvironmentOptions
Ƭ JSONPathEnvironmentOptions: Object
JSONPath environment options. The defaults are in compliance with JSONPath standards.
Type declaration
Name | Type | Description |
---|---|---|
keysPattern? | RegExp | The pattern to use for the non-standard keys selector. The lexer expects the sticky bit to be set. Defaults to /~/y . |
maxIntIndex? | number | The maximum number allowed when indexing or slicing an array. Defaults to 2**53 -1. |
maxRecursionDepth? | number | The maximum number of objects and/or arrays the recursive descent selector can visit before a JSONPathRecursionLimitError is thrown. |
minIntIndex? | number | The minimum number allowed when indexing or slicing an array. Defaults to -(2**53) -1. |
nondeterministic? | boolean | If true , enable nondeterministic ordering when iterating JSON object data. This is mainly useful for validating the JSONPath Compliance Test Suite. |
strict? | boolean | Indicates if the environment should to be strict about its compliance with RFC 9535. Defaults to true . Setting strict to false enables non-standard features. Non-standard features are subject to change if conflicting features are included in a future JSONPath standard or draft standard, or an overwhelming consensus amongst the JSONPath community emerges that differs from this implementation. |
Defined in
JSONPathValue
Ƭ JSONPathValue: JSONValue
| typeof Nothing
ValueType for JSONPath function expression tye system.
Defined in
Variables
DEFAULT_ENVIRONMENT
• Const
DEFAULT_ENVIRONMENT: JSONPathEnvironment
Defined in
KEY_MARK
• Const
KEY_MARK: "\u0002"
Defined in
Nothing
• Const
Nothing: typeof Nothing
Defined in
Functions
compile
▸ compile(path
): JSONPath
Compile JSONPath path for later use.
Parameters
Name | Type | Description |
---|---|---|
path | string | A JSONPath expression/query. |
Returns
A path object with a query()
method.
Throws
JSONPathSyntaxError If the path does not conform to standard syntax.
Throws
JSONPathTypeError If filter function arguments are invalid, or filter expression are used in an invalid way.
Defined in
lazyQuery
▸ lazyQuery(path
, value
): IterableIterator
<JSONPathNode
>
Lazily query JSON value value with JSONPath expression path. Lazy queries can be faster and more memory efficient when querying large datasets, especially when using recursive decent selectors.
Parameters
Name | Type | Description |
---|---|---|
path | string | A JSONPath expression/query. |
value | JSONValue | The JSON-like value the JSONPath query is applied to. |
Returns
IterableIterator
<JSONPathNode
>
A sequence of JSONPathNode objects resulting from applying path to value.
Throws
JSONPathSyntaxError If the path does not conform to standard syntax.
Throws
JSONPathTypeError If filter function arguments are invalid, or filter expression are used in an invalid way.
Defined in
match
▸ match(path
, value
): JSONPathNode
| undefined
Return a JSONPathNode instance for the first object found in value matching path.
Parameters
Name | Type | Description |
---|---|---|
path | string | A JSONPath query. |
value | JSONValue | JSON-like data to which the query path will be applied. |
Returns
JSONPathNode
| undefined
The first node in value matching path, or undefined
if
there are no matches.
Defined in
query
▸ query(path
, value
): JSONPathNodeList
Query JSON value value with JSONPath expression path.
Parameters
Name | Type | Description |
---|---|---|
path | string | A JSONPath expression/query. |
value | JSONValue | The JSON-like value the JSONPath query is applied to. |
Returns
A list of JSONPathNode objects, one for each value matched by path in value.
Throws
JSONPathSyntaxError If the path does not conform to standard syntax.
Throws
JSONPathTypeError If filter function arguments are invalid, or filter expression are used in an invalid way.