mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 09:01:06 +03:00
Bugfix/get rid of double quotes when replacing variable value (#2577)
get rid of double quotes when replacing variable value
This commit is contained in:
@@ -782,7 +782,13 @@ export const getVariableValue = (
|
|||||||
const variableValue = variableDict[path]
|
const variableValue = variableDict[path]
|
||||||
// Replace all occurrence
|
// Replace all occurrence
|
||||||
if (typeof variableValue === 'object') {
|
if (typeof variableValue === 'object') {
|
||||||
returnVal = returnVal.split(path).join(JSON.stringify(JSON.stringify(variableValue)))
|
const stringifiedValue = JSON.stringify(JSON.stringify(variableValue))
|
||||||
|
if (stringifiedValue.startsWith('"') && stringifiedValue.endsWith('"')) {
|
||||||
|
// get rid of the double quotes
|
||||||
|
returnVal = returnVal.split(path).join(stringifiedValue.substring(1, stringifiedValue.length - 1))
|
||||||
|
} else {
|
||||||
|
returnVal = returnVal.split(path).join(JSON.stringify(variableValue).replace(/"/g, '\\"'))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
returnVal = returnVal.split(path).join(variableValue)
|
returnVal = returnVal.split(path).join(variableValue)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user