44 FilterExpressionLiteral ,
55 FunctionExtension ,
66 InfixExpression ,
7- JSONPathQuery ,
7+ FilterQuery ,
88} from "./expression" ;
99import { Count as CountFilterFunction } from "./functions/count" ;
1010import { FilterFunction , FunctionExpressionType } from "./functions/function" ;
@@ -15,7 +15,7 @@ import { Value as ValueFilterFunction } from "./functions/value";
1515import { tokenize } from "./lex" ;
1616import { JSONPathNode , JSONPathNodeList } from "./node" ;
1717import { Parser } from "./parse" ;
18- import { JSONPath } from "./path" ;
18+ import { JSONPathQuery } from "./path" ;
1919import { Token , TokenStream } from "./token" ;
2020import { JSONValue } from "../types" ;
2121import { CurrentKey } from "./extra/expression" ;
@@ -140,10 +140,10 @@ export class JSONPathEnvironment {
140140
141141 /**
142142 * @param path - A JSONPath query to parse.
143- * @returns A new {@link JSONPath } object, bound to this environment.
143+ * @returns A new {@link JSONPathQuery } object, bound to this environment.
144144 */
145- public compile ( path : string ) : JSONPath {
146- return new JSONPath (
145+ public compile ( path : string ) : JSONPathQuery {
146+ return new JSONPathQuery (
147147 this ,
148148 this . parser . parse ( new TokenStream ( tokenize ( this , path ) ) ) ,
149149 ) ;
@@ -252,7 +252,7 @@ export class JSONPathEnvironment {
252252 ! (
253253 arg instanceof FilterExpressionLiteral ||
254254 arg instanceof CurrentKey ||
255- ( arg instanceof JSONPathQuery && arg . path . singularQuery ( ) ) ||
255+ ( arg instanceof FilterQuery && arg . path . singularQuery ( ) ) ||
256256 ( arg instanceof FunctionExtension &&
257257 this . functionRegister . get ( arg . name ) ?. returnType ===
258258 FunctionExpressionType . ValueType )
@@ -265,9 +265,7 @@ export class JSONPathEnvironment {
265265 }
266266 break ;
267267 case FunctionExpressionType . LogicalType :
268- if (
269- ! ( arg instanceof JSONPathQuery || arg instanceof InfixExpression )
270- ) {
268+ if ( ! ( arg instanceof FilterQuery || arg instanceof InfixExpression ) ) {
271269 throw new JSONPathTypeError (
272270 `${ token . value } () argument ${ idx } must be of LogicalType` ,
273271 arg . token ,
@@ -277,7 +275,7 @@ export class JSONPathEnvironment {
277275 case FunctionExpressionType . NodesType :
278276 if (
279277 ! (
280- arg instanceof JSONPathQuery ||
278+ arg instanceof FilterQuery ||
281279 ( arg instanceof FunctionExtension &&
282280 this . functionRegister . get ( arg . name ) ?. returnType ===
283281 FunctionExpressionType . NodesType )
0 commit comments