🐛 Fix issue with comments in last line

This commit is contained in:
Jan Oberhauser 2021-12-23 18:02:32 +01:00
parent b9abf5c57b
commit 4ab7257c2b
2 changed files with 2 additions and 2 deletions

View file

@ -102,7 +102,7 @@ return items;`,
try { try {
// Execute the function code // Execute the function code
items = (await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname)); items = (await vm.run(`module.exports = async function() {${functionCode}\n}()`, __dirname));
// Do very basic validation of the data // Do very basic validation of the data
if (items === undefined) { if (items === undefined) {
throw new NodeOperationError(this.getNode(), 'No data got returned. Always return an Array of items!'); throw new NodeOperationError(this.getNode(), 'No data got returned. Always return an Array of items!');

View file

@ -114,7 +114,7 @@ return item;`,
let jsonData: IDataObject; let jsonData: IDataObject;
try { try {
// Execute the function code // Execute the function code
jsonData = await vm.run(`module.exports = async function() {${functionCode}}()`, __dirname); jsonData = await vm.run(`module.exports = async function() {${functionCode}\n}()`, __dirname);
} catch (error) { } catch (error) {
if (this.continueOnFail()) { if (this.continueOnFail()) {
returnData.push({json:{ error: error.message }}); returnData.push({json:{ error: error.message }});