mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
fix(utilities): Handle escape characters in ifelse-function node's return value, resolves #1887
This commit is contained in:
@@ -143,10 +143,11 @@ class IfElseFunction_Utilities implements INode {
|
|||||||
const vm = new NodeVM(nodeVMOptions)
|
const vm = new NodeVM(nodeVMOptions)
|
||||||
try {
|
try {
|
||||||
const responseTrue = await vm.run(`module.exports = async function() {${ifFunction}}()`, __dirname)
|
const responseTrue = await vm.run(`module.exports = async function() {${ifFunction}}()`, __dirname)
|
||||||
if (responseTrue) return { output: responseTrue, type: true }
|
if (responseTrue)
|
||||||
|
return { output: typeof responseTrue === 'string' ? handleEscapeCharacters(responseTrue, false) : responseTrue, type: true }
|
||||||
|
|
||||||
const responseFalse = await vm.run(`module.exports = async function() {${elseFunction}}()`, __dirname)
|
const responseFalse = await vm.run(`module.exports = async function() {${elseFunction}}()`, __dirname)
|
||||||
return { output: responseFalse, type: false }
|
return { output: typeof responseFalse === 'string' ? handleEscapeCharacters(responseFalse, false) : responseFalse, type: false }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(e)
|
throw new Error(e)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user