@metrichor/jmespath
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -20,3 +20,3 @@ "use strict"; | ||
var nodeTree = Parser_1.default.parse(expression); | ||
return nodeTree; | ||
return function (data) { return TreeInterpreter_1.default.search(nodeTree, data); }; | ||
} | ||
@@ -23,0 +23,0 @@ exports.compile = compile; |
@@ -1,2 +0,2 @@ | ||
import { ExpressionNodeTree, LexerToken, JSONValue, InputArgument, InputSignature, RuntimeFunction } from './typings/index'; | ||
import { LexerToken, JSONValue, InputArgument, InputSignature, RuntimeFunction } from './typings/index'; | ||
export declare const TYPE_ANY = InputArgument.TYPE_ANY; | ||
@@ -12,3 +12,3 @@ export declare const TYPE_ARRAY = InputArgument.TYPE_ARRAY; | ||
export declare const TYPE_STRING = InputArgument.TYPE_STRING; | ||
export declare function compile(expression: string): ExpressionNodeTree; | ||
export declare function compile(expression: string): (data: JSONValue) => JSONValue; | ||
export declare function tokenize(expression: string): LexerToken[]; | ||
@@ -15,0 +15,0 @@ export declare const registerFunction: (functionName: string, customFunction: RuntimeFunction<any, any>, signature: InputSignature[]) => void; |
{ | ||
"name": "@metrichor/jmespath", | ||
"description": "Typescript implementation of the JMESPath spec (100% compliant)", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Oxford Nanopore Technologies", |
@@ -123,3 +123,14 @@ ![Node.js CI](https://github.com/nanoporetech/jmespath-ts/workflows/Node.js%20CI/badge.svg?branch=master) | ||
```javascript | ||
import { compile, TreeInterpreter } from '@metrichor/jmespath'; | ||
const ast = compile('foo.bar'); | ||
TreeInterpreter.search(ast, {foo: {bar: 'BAZ'}}) | ||
// RETURNS: "BAZ" | ||
``` | ||
## More Resources | ||
@@ -126,0 +137,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
528623
149
1