mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Added JMESPath 0.15.0 (#14685)
* Added JMESPath 0.15.0 * Added tslint to jmespath * Fix linting issue.
This commit is contained in:
committed by
Mohamed Hegazy
parent
2e0317a202
commit
f4e385218b
Vendored
+13
@@ -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;
|
||||
@@ -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`]");
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user