Skip to content

Commit ea50117

Browse files
committed
Changing in the transformation function format
1 parent 7b4b4d6 commit ea50117

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/framework/store/actions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ function transformFirstArgument (elementKey, transformScript, firstArgument) {
2525
if (!transformFunction) {
2626
try {
2727
// if there is a transformation in props save it into the cache as new Function
28-
const newTransformFunction = new Function('data', transformScript)();
28+
const newTransformFunction = new Function('data', `return ${transformScript}`)();
2929
transformFunctionsCache.set(elementKey, newTransformFunction);
3030
transformFunction = newTransformFunction;
3131
if (!isFunction(newTransformFunction)) {
32-
console.error(`[Framework] The transformation script should return a JavaScript function: ${transformScript}`);
32+
console.error(`[Framework] The transformation script should be a JavaScript function. Check the transformation script: ${transformScript}`);
3333
}
3434
} catch (error) {
35-
console.error(`[Framework] In input transformation function "${transformScript.substr(0, 200)}${transformScript.length > 200 ? '...' : ''}" has error: "${error.message}".`);
35+
console.error(`[Framework] The transformation function "${transformScript.substr(0, 200)}${transformScript.length > 200 ? '...' : ''}" has the error: "${error.message}".`);
3636
}
3737
}
3838
try {

0 commit comments

Comments
 (0)