add fix for passing json variable

This commit is contained in:
Henry
2024-01-05 02:46:36 +00:00
parent d9136998c4
commit 8cb9393862
3 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -561,7 +561,11 @@ export const getVariableValue = (
variablePaths.forEach((path) => {
const variableValue = variableDict[path]
// Replace all occurrence
returnVal = returnVal.split(path).join(variableValue)
if (typeof variableValue === 'object') {
returnVal = returnVal.split(path).join(JSON.stringify(variableValue).replace(/"/g, '\\"'))
} else {
returnVal = returnVal.split(path).join(variableValue)
}
})
return returnVal
}