mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Code Node): Do not validate code within comments (#12938)
This commit is contained in:
@@ -13,7 +13,13 @@ export function validateNoDisallowedMethodsInRunForEach(code: string, itemIndex:
|
||||
|
||||
const lineNumber =
|
||||
code.split('\n').findIndex((line) => {
|
||||
return line.includes(disallowedMethod) && !line.startsWith('//') && !line.startsWith('*');
|
||||
line = line.trimStart();
|
||||
return (
|
||||
line.includes(disallowedMethod) &&
|
||||
!line.startsWith('//') &&
|
||||
!line.startsWith('/*') &&
|
||||
!line.startsWith('*')
|
||||
);
|
||||
}) + 1;
|
||||
|
||||
const disallowedMethodFound = lineNumber !== 0;
|
||||
|
||||
Reference in New Issue
Block a user