diff --git a/src/lib/run-dev.js b/src/lib/run-dev.js index 1352d76..972ed50 100644 --- a/src/lib/run-dev.js +++ b/src/lib/run-dev.js @@ -554,7 +554,10 @@ function interpolate (valueString, props) { // replace ${VAR_NAME}, $VAR_NAME, or {VAR_NAME} with values from props, but not if they are enclosed in quotes // if key is not found on props, the value is returned as is (no replacement) const retStr = valueString.replace(/(? props[varName1 || varName2 || varName3] || _) + (_, varName1, varName2, varName3) => { + const varName = varName1 || varName2 || varName3 + return Object.prototype.hasOwnProperty.call(props, varName) ? props[varName] : '' + }) return retStr } diff --git a/test/lib/run-dev.test.js b/test/lib/run-dev.test.js index 375d71b..550b71a 100644 --- a/test/lib/run-dev.test.js +++ b/test/lib/run-dev.test.js @@ -348,7 +348,7 @@ describe('createActionParametersFromRequest', () => { justDollar: 'value is world', mustache: 'value is world', literal: 'value is literally "${mustache}" and "{mustache}"', - doesNotExist: 'value is ${doesNotExist}' + doesNotExist: 'value is ' }) delete process.env.mustache })