From 62d9137715753a18a9642294e437157c24366a5c Mon Sep 17 00:00:00 2001 From: Deepty Thampy Date: Tue, 3 Jun 2025 13:10:01 -0500 Subject: [PATCH] feat: fixed the issue where unmapped action input params show up as literal placeholders --- src/lib/run-dev.js | 5 ++++- test/lib/run-dev.test.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/run-dev.js b/src/lib/run-dev.js index 412b8f7..cc79b2c 100644 --- a/src/lib/run-dev.js +++ b/src/lib/run-dev.js @@ -545,7 +545,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 })