mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
fixes JSONPath missing variable typo (#4754)
This commit is contained in:
parent
ef03a0feb9
commit
b17df4a78d
@ -1,5 +1,5 @@
|
|||||||
const os = require('os');
|
const os = require('os');
|
||||||
const {JSONPath} = require('jsonpath-plus');
|
const { JSONPath } = require('jsonpath-plus');
|
||||||
|
|
||||||
const FILTERABLE = ['userInfo', 'cpus'];
|
const FILTERABLE = ['userInfo', 'cpus'];
|
||||||
|
|
||||||
@ -32,9 +32,9 @@ module.exports.templateTags = [
|
|||||||
run(context, fnName, filter) {
|
run(context, fnName, filter) {
|
||||||
let value = os[fnName]();
|
let value = os[fnName]();
|
||||||
|
|
||||||
if (jsonPath && FILTERABLE.includes(fnName)) {
|
if (JSONPath && FILTERABLE.includes(fnName)) {
|
||||||
try {
|
try {
|
||||||
value = JSONPath({json: value, path: filter})[0];
|
value = JSONPath({ json: value, path: filter })[0];
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user