mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
evaluateTemplateVariable: require property to be a direct/own property of 'values', not from its prototype
This commit is contained in:
parent
f76dd3ed62
commit
40cb74ee28
3 changed files with 8 additions and 1 deletions
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -5528,6 +5528,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
|
||||||
"integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw="
|
"integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw="
|
||||||
},
|
},
|
||||||
|
"lodash.has": {
|
||||||
|
"version": "4.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz",
|
||||||
|
"integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI="
|
||||||
|
},
|
||||||
"lodash.intersection": {
|
"lodash.intersection": {
|
||||||
"version": "4.4.0",
|
"version": "4.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.intersection/-/lodash.intersection-4.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.intersection/-/lodash.intersection-4.4.0.tgz",
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
"lodash.at": "^4.6.0",
|
"lodash.at": "^4.6.0",
|
||||||
"lodash.chunk": "^4.2.0",
|
"lodash.chunk": "^4.2.0",
|
||||||
"lodash.difference": "^4.5.0",
|
"lodash.difference": "^4.5.0",
|
||||||
|
"lodash.has": "^4.5.2",
|
||||||
"lodash.intersection": "^4.4.0",
|
"lodash.intersection": "^4.4.0",
|
||||||
"lodash.isequal": "^4.5.0",
|
"lodash.isequal": "^4.5.0",
|
||||||
"moment-timezone": "^0.5.21",
|
"moment-timezone": "^0.5.21",
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import has from "lodash.has";
|
||||||
import at from "lodash.at";
|
import at from "lodash.at";
|
||||||
|
|
||||||
const TEMPLATE_CACHE_SIZE = 100;
|
const TEMPLATE_CACHE_SIZE = 100;
|
||||||
|
@ -218,7 +219,7 @@ export function parseTemplate(str: string): ParsedTemplate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function evaluateTemplateVariable(theVar: ITemplateVar, values) {
|
async function evaluateTemplateVariable(theVar: ITemplateVar, values) {
|
||||||
const value = at(values, theVar.identifier)[0];
|
const value = has(values, theVar.identifier) && at(values, theVar.identifier)[0];
|
||||||
|
|
||||||
if (typeof value === "function") {
|
if (typeof value === "function") {
|
||||||
const args = [];
|
const args = [];
|
||||||
|
|
Loading…
Add table
Reference in a new issue