Skip to content

Commit

Permalink
fixes #18 - string slices (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
springcomp authored May 1, 2023
1 parent ad1da7c commit bd6a29b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/TreeInterpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export class TreeInterpreter {

const base = this.visit(left, value);
if (allowString && typeof base === 'string') {
return base;
// a projection is really a sub-expression in disguise
// we must evaluate the right hand expression
return this.visit(right, base) as JSONValue;
}

if (!Array.isArray(base)) {
Expand Down
2 changes: 1 addition & 1 deletion test/compliance
Submodule compliance updated 1 files
+12 −0 tests/slice.json

0 comments on commit bd6a29b

Please sign in to comment.