🐛 Rework expression for renaming node for dotted expressions (#2380)

This commit is contained in:
Oliver Trajceski
2021-10-28 17:59:09 +02:00
committed by GitHub
parent ba8c922604
commit c73a5f76dc

View File

@@ -415,8 +415,7 @@ export class Workflow {
const currentNameEscaped = currentName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
parameterValue = parameterValue.replace(
// eslint-disable-next-line no-useless-escape
new RegExp(`(\\$node(\.|\\["|\\[\'))${currentNameEscaped}((\s/g|"\\]|\'\\]))`, 'g'),
new RegExp(`(\\$node(\\.|\\["|\\['))${currentNameEscaped}((\\.|"\\]|'\\]))`, 'g'),
`$1${newName}$3`,
);
}