Skip to content

Commit 5cc0e98

Browse files
authored
Bugfix/Allow prefix vars when executing custom function (#3902)
allow prefix vars when executing custom function
1 parent 4aa97b0 commit 5cc0e98

File tree

1 file changed

+7
-0
lines changed
  • packages/server/src/services/nodes

1 file changed

+7
-0
lines changed

packages/server/src/services/nodes/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ const executeCustomFunction = async (requestBody: any) => {
123123
const functionInputVariables = Object.fromEntries(
124124
[...(body?.javascriptFunction ?? '').matchAll(/\$([a-zA-Z0-9_]+)/g)].map((g) => [g[1], undefined])
125125
)
126+
if (functionInputVariables && Object.keys(functionInputVariables).length) {
127+
for (const key in functionInputVariables) {
128+
if (key.includes('vars')) {
129+
delete functionInputVariables[key]
130+
}
131+
}
132+
}
126133
const nodeData = { inputs: { functionInputVariables, ...body } }
127134
if (Object.prototype.hasOwnProperty.call(appServer.nodesPool.componentNodes, 'customFunction')) {
128135
try {

0 commit comments

Comments
 (0)