From fe8c87005024389930482bb4a2b6de64c5d86bcc Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 11 Sep 2020 21:30:40 +0100 Subject: [PATCH] some mutating function parameter --- packages/builder/src/builderStore/replaceBindings.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/builderStore/replaceBindings.js b/packages/builder/src/builderStore/replaceBindings.js index ce2d5fe163..aa57301261 100644 --- a/packages/builder/src/builderStore/replaceBindings.js +++ b/packages/builder/src/builderStore/replaceBindings.js @@ -4,6 +4,7 @@ export function readableToRuntimeBinding(bindableProperties, textWithBindings) { // Find all instances of mustasche const boundValues = textWithBindings.match(CAPTURE_VAR_INSIDE_MUSTACHE) + let result = textWithBindings // Replace readableBindings with runtimeBindings boundValues && boundValues.forEach(boundValue => { @@ -11,13 +12,13 @@ export function readableToRuntimeBinding(bindableProperties, textWithBindings) { return boundValue === `{{ ${readableBinding} }}` }) if (binding) { - textWithBindings = textWithBindings.replace( + result = textWithBindings.replace( boundValue, `{{ ${binding.runtimeBinding} }}` ) } }) - return textWithBindings + return result } export function runtimeToReadableBinding(bindableProperties, textWithBindings) {