Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function shouldProceedCurrentStep(tags = [], envTags = getEnvTags()) {
const parser = new TagExpressionParser();
try {
const expressionNode = parser.parse(envTags);
const mappedTags = tags.map(tag => tag.name);
return expressionNode.evaluate(mappedTags);
} catch (e) {
/* eslint-disable-next-line no-console */
console.log(`Error parsing tags: '${envTags}'. Message: ${e.message}`);
return false;
}
}