Update CustomFunction.ts

This commit is contained in:
YISH
2024-02-26 11:05:29 +08:00
committed by GitHub
parent 0521d26c60
commit 735425e902
@@ -90,6 +90,8 @@ 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) {
let value = inputVars[key]
if (typeof value === 'string') {
value = handleEscapeCharacters(value, true) value = handleEscapeCharacters(value, true)
if (value.startsWith('{') && value.endsWith('}')) { if (value.startsWith('{') && value.endsWith('}')) {
try { try {
@@ -100,6 +102,7 @@ class CustomFunction_Utilities implements INode {
} }
inputVars[key] = value inputVars[key] = value
} }
}
let sandbox: any = { $input: input } let sandbox: any = { $input: input }
sandbox['$vars'] = prepareSandboxVars(variables) sandbox['$vars'] = prepareSandboxVars(variables)