Update CustomFunction.ts

This commit is contained in:
YISH 2024-02-26 11:05:29 +08:00 committed by GitHub
parent 0521d26c60
commit 735425e902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 7 deletions

View File

@ -90,15 +90,18 @@ class CustomFunction_Utilities implements INode {
// Some values might be a stringified JSON, parse it
for (const key in inputVars) {
value = handleEscapeCharacters(value, true)
if (value.startsWith('{') && value.endsWith('}')) {
try {
value = JSON.parse(value)
} catch (e) {
// ignore
let value = inputVars[key]
if (typeof value === 'string') {
value = handleEscapeCharacters(value, true)
if (value.startsWith('{') && value.endsWith('}')) {
try {
value = JSON.parse(value)
} catch (e) {
// ignore
}
}
inputVars[key] = value
}
inputVars[key] = value
}
let sandbox: any = { $input: input }