Skip to content

Commit

Permalink
Compile actually returns something useful
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Van Ginkel committed May 31, 2020
1 parent aa04bf4 commit e0db9c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@metrichor/jmespath",
"description": "Typescript implementation of the JMESPath spec (100% compliant)",
"version": "0.1.1",
"version": "0.1.2",
"author": {
"name": "Oxford Nanopore Technologies",
"email": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export const TYPE_NUMBER = InputArgument.TYPE_NUMBER;
export const TYPE_OBJECT = InputArgument.TYPE_OBJECT;
export const TYPE_STRING = InputArgument.TYPE_STRING;

export function compile(expression: string): ExpressionNodeTree {
export function compile(expression: string): (data: JSONValue) => JSONValue {
const nodeTree = Parser.parse(expression);
return nodeTree;
return (data: JSONValue) => TreeInterpreter.search(nodeTree, data);
}

export function tokenize(expression: string): LexerToken[] {
Expand Down

0 comments on commit e0db9c5

Please sign in to comment.