mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 01:01:11 +03:00
Update CustomFunction.ts
This commit is contained in:
@@ -90,15 +90,18 @@ class CustomFunction_Utilities implements INode {
|
|||||||
|
|
||||||
// Some values might be a stringified JSON, parse it
|
// Some values might be a stringified JSON, parse it
|
||||||
for (const key in inputVars) {
|
for (const key in inputVars) {
|
||||||
value = handleEscapeCharacters(value, true)
|
let value = inputVars[key]
|
||||||
if (value.startsWith('{') && value.endsWith('}')) {
|
if (typeof value === 'string') {
|
||||||
try {
|
value = handleEscapeCharacters(value, true)
|
||||||
value = JSON.parse(value)
|
if (value.startsWith('{') && value.endsWith('}')) {
|
||||||
} catch (e) {
|
try {
|
||||||
// ignore
|
value = JSON.parse(value)
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
inputVars[key] = value
|
||||||
}
|
}
|
||||||
inputVars[key] = value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let sandbox: any = { $input: input }
|
let sandbox: any = { $input: input }
|
||||||
|
|||||||
Reference in New Issue
Block a user