Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
steps.forEach((step) => {
const matchPattern = "([^']*)?";
const matcher = step.matcher
.replace(new RegExp(`(${placeholders.join('|')})`, 'g'), matchPattern);
When(new RegExp(`^${matcher}$`), {}, require(step.path));
step.regex = new RegExp(`^${matcher}$`); // eslint-disable-line no-param-reassign
});
}