UNPKG

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

20 lines (17 loc) 505 B
function headingMatches(node) { // Get all valid roles let explicitRoles; if (node.hasAttribute('role')) { explicitRoles = node .getAttribute('role') .split(/\s+/i) .filter(axe.commons.aria.isValidRole); } // Check valid roles if there are any, otherwise fall back to the inherited role if (explicitRoles && explicitRoles.length > 0) { return explicitRoles.includes('heading'); } else { return axe.commons.aria.implicitRole(node) === 'heading'; } } export default headingMatches;