diff --git a/package-lock.json b/package-lock.json index e95a822a023f004f4cbaeb82fb03aef88b05b500..f0d4af6010d4dc2347efee3bf476dfd06c7126f8 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index 3deebb08441ad63d7ce10d3d48b63d9ee66f987b..6dd0b530d50f711e4c30033afccac8e84a36750c 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,9 @@ "codecov": "^3.0.0", "concat": "^1.0.3", "cryptiles": "^4.1.3", + "eslint": "^6.0.1", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-plugin-import": "^2.18.0", "esm": "^3.0.82", "extend": "^3.0.2", "faker": "^4.1.0", @@ -82,7 +85,7 @@ }, "dependencies": { "json-schema-ref-parser": "^6.0.2", - "jsonpath": "^1.0.1", + "jsonpath-plus": "^0.20.1", "randexp": "^0.5.3" } } diff --git a/src/core/run.js b/src/core/run.js index d53f73b0f70d90d68ee05e2944eb21baf32b1cf9..430f8dc4a8d07be87414d827a11c342ce10f0d64 100644 --- a/src/core/run.js +++ b/src/core/run.js @@ -1,4 +1,4 @@ -import jsonpath from 'jsonpath'; +import { JSONPath } from 'jsonpath-plus'; import optionAPI from '../api/option'; import traverse from './traverse'; @@ -60,9 +60,9 @@ function resolve(obj, data, values, property) { if (!values[key]) { if (params.count > 1) { - values[key] = jsonpath.query(data, params.path, params.count); + values[key] = JSONPath(params.path, data).slice(0, params.count); } else { - values[key] = jsonpath.query(data, params.path); + values[key] = JSONPath(params.path, data); } }