🐛 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 {
// 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
if (items === undefined) {
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;
try {
// 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) {
if (this.continueOnFail()) {
returnData.push({json:{ error: error.message }});