Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1639b925 authored by Brett Zamir's avatar Brett Zamir
Browse files

Fix checking issue

parent f1746de6
Branches
Tags
No related merge requests found
...@@ -39,14 +39,14 @@ function JSONPath (opts, obj, expr) { ...@@ -39,14 +39,14 @@ function JSONPath (opts, obj, expr) {
} }
opts = opts || {}; opts = opts || {};
var len1 = arguments.length === 1; var objArgs = opts.hasOwnProperty('json') && opts.hasOwnProperty('path');
this.resultType = (opts.resultType && opts.resultType.toLowerCase()) || 'value'; this.resultType = (opts.resultType && opts.resultType.toLowerCase()) || 'value';
this.flatten = opts.flatten || false; this.flatten = opts.flatten || false;
this.wrap = opts.hasOwnProperty('wrap') ? opts.wrap : true; this.wrap = opts.hasOwnProperty('wrap') ? opts.wrap : true;
this.sandbox = opts.sandbox || {}; this.sandbox = opts.sandbox || {};
if (opts.autostart !== false) { if (opts.autostart !== false) {
return this.evaluate((len1 ? opts.json : obj), (len1 ? opts.path : expr)); return this.evaluate((objArgs ? opts.json : obj), (objArgs ? opts.path : expr));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment