Added JMESPath 0.15.0 (#14685)

* Added JMESPath 0.15.0

* Added tslint to jmespath

* Fix linting issue.
This commit is contained in:
Jeffery Grajkowski
2017-03-10 16:13:26 -08:00
committed by Mohamed Hegazy
parent 2e0317a202
commit f4e385218b
4 changed files with 42 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for jmespath 0.15
// Project: https://github.com/jmespath/jmespath.js
// Definitions by: Jeffery Grajkowski <https://github.com/pushplay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Take a JSON document and transform it into another JSON document
* through a JMESPath expression. See: http://jmespath.org/
* @param jsonDoc the document to transform
* @param query a JMESPath expression
* @return the transformed document
*/
export function search(jsonDoc: any, query: string): any;
+6
View File
@@ -0,0 +1,6 @@
import jmespath = require("jmespath");
const a = jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar.baz[2]");
const b = jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar")
const c = jmespath.search({"foo": [{"first": "a", "last": "b"}, {"first": "c", "last": "d"}]}, "foo[*].first");
const d = jmespath.search({"foo": [{"age": 20}, {"age": 25}, {"age": 30}, {"age": 35}, {"age": 40}]}, "foo[?age > `30`]");
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jmespath-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }