mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Fix expression extension misdetection (#5219)
* 🐛 Narrow down check * fix: converted expression extension check loop into regex * fix: remove greedy string check * fix: re-add string spliting regex Co-authored-by: Valya Bullions <valya@n8n.io>
This commit is contained in:
@@ -314,11 +314,15 @@ export class Expression {
|
||||
}
|
||||
|
||||
extendSyntax(bracketedExpression: string): string {
|
||||
if (!hasExpressionExtension(bracketedExpression) || hasNativeMethod(bracketedExpression))
|
||||
return bracketedExpression;
|
||||
|
||||
const chunks = splitExpression(bracketedExpression);
|
||||
|
||||
const codeChunks = chunks
|
||||
.filter((c) => c.type === 'code')
|
||||
.map((c) => c.text.replace(/("|').*?("|')/, '').trim());
|
||||
|
||||
if (!codeChunks.some(hasExpressionExtension) || hasNativeMethod(bracketedExpression))
|
||||
return bracketedExpression;
|
||||
|
||||
const extendedChunks = chunks.map((chunk): ExpressionChunk => {
|
||||
if (chunk.type === 'code') {
|
||||
const output = extendTransform(chunk.text);
|
||||
|
||||
Reference in New Issue
Block a user