luhn-generator
Version:
A generator of numbers that passes the validation of Luhn algorithm or Luhn formula, also known as the 'modulus 10' or 'mod 10' algorithm
22 lines (17 loc) • 476 B
JavaScript
import { isValidRole } from '../../commons/aria';
import { tokenList } from '../../core/utils';
function invalidroleEvaluate(node, options, virtualNode) {
const allRoles = tokenList(virtualNode.attr('role'));
const allInvalid = allRoles.every(
role => !isValidRole(role, { allowAbstract: true })
);
/**
* Only fail when all the roles are invalid
*/
if (allInvalid) {
this.data(allRoles);
return true;
}
return false;
}
export default invalidroleEvaluate;