Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const value = utils.getAttributeValue(node);
if (value === null || typeof value !== 'string') {
return;
}
const normalizedValues = String(value).toLowerCase().split(' ');
const validRoles = [...roles.keys()].filter(role => roles.get(role).abstract === false);
const isValid = normalizedValues.every(val => validRoles.indexOf(val) > -1);
if (isValid === true) { return; }
context.report({
node: node,
message: errorMessage
});
}
}, altRule.create(context))
}
};