File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed
Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 11# JSON P3 Change Log
22
3+ ## Version 2.1.1 (unreleased)
4+
5+ ** Fixes**
6+
7+ - Fixed parsing of filter queries containing multiple consecutive bracketed segments. Previously we were failing to parse queries like ` $[?@[0][1]] ` .
8+
39## Version 2.1.0
410
511** Changes**
Original file line number Diff line number Diff line change 11{
22 "name" : " json-p3" ,
3- "version" : " 2.1.0 " ,
3+ "version" : " 2.1.1 " ,
44 "author" : " James Prior" ,
55 "license" : " MIT" ,
66 "description" : " JSONPath, JSON Pointer and JSON Patch" ,
Original file line number Diff line number Diff line change @@ -392,7 +392,6 @@ function lexInsideBracketedSelection(l: Lexer): StateFn | null {
392392 switch ( ch ) {
393393 case "]" :
394394 l . emit ( TokenKind . RBRACKET ) ;
395- if ( l . filterLevel ) return lexInsideFilter ;
396395 return lexSegment ;
397396 case "" :
398397 l . error ( "unclosed bracketed selection" ) ;
Original file line number Diff line number Diff line change @@ -37,6 +37,21 @@ const TEST_CASES: TestCase[] = [
3737 path : "$[?@.* && @.b]" ,
3838 want : "$[?@[*] && @.b]" ,
3939 } ,
40+ {
41+ description : "filter query, multiple shorthand segments" ,
42+ path : "$[?@.a.b.c]" ,
43+ want : "$[?@.a.b.c]" ,
44+ } ,
45+ {
46+ description : "filter query, multiple bracketed segments" ,
47+ path : "$[?@[0][1] && $[2][3]]" ,
48+ want : "$[?@[0][1] && $[2][3]]" ,
49+ } ,
50+ {
51+ description : "filter query, dotted and bracketed segments" ,
52+ path : "$[?@.a[1][2] && $.b[2].c[3]]" ,
53+ want : "$[?@.a[1][2] && $.b[2].c[3]]" ,
54+ } ,
4055] ;
4156
4257describe ( "parse" , ( ) => {
You can’t perform that action at this time.
0 commit comments