mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Account for duplicate copies without populating more than once. As a result, populate in place.
This commit is contained in:
parent
e823679340
commit
143a2aa65b
@ -99,8 +99,10 @@ class Variables {
|
||||
} else {
|
||||
singleValueToPopulate = this.getValueFromSource(variableString)
|
||||
.then(valueToPopulate => {
|
||||
if (typeof valueToPopulate === 'object'
|
||||
&& typeof this.populatedObjectReferences[variableString] === 'undefined') {
|
||||
if (typeof valueToPopulate === 'object') {
|
||||
if (variableString in this.populatedObjectReferences) {
|
||||
return this.populatedObjectReferences[variableString];
|
||||
}
|
||||
this.populatedObjectReferences[variableString] = valueToPopulate;
|
||||
return this.populateObject(valueToPopulate);
|
||||
}
|
||||
@ -121,7 +123,7 @@ class Variables {
|
||||
});
|
||||
return BbPromise.all(allValuesToPopulate).then(() => {
|
||||
if (property !== this.service) {
|
||||
return this.populateProperty(property);
|
||||
return this.populateProperty(property, true);
|
||||
}
|
||||
return BbPromise.resolve(property);
|
||||
});
|
||||
@ -402,7 +404,7 @@ class Variables {
|
||||
}
|
||||
if (typeof computedValueToPopulate === 'string' &&
|
||||
computedValueToPopulate.match(this.variableSyntax)) {
|
||||
return this.populateProperty(computedValueToPopulate);
|
||||
return this.populateProperty(computedValueToPopulate, true);
|
||||
}
|
||||
return BbPromise.resolve(computedValueToPopulate);
|
||||
}, valueToPopulate);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user