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

14 lines (10 loc) 474 B
import { findUpVirtual } from '../commons/dom'; function landmarkHasBodyContextMatches(node, virtualNode) { const nativeScopeFilter = 'article, aside, main, nav, section'; // Filter elements that, within certain contexts, don't map their role. // e.g. a <header> inside a <main> is not a banner, but in the <body> context it is return ( node.hasAttribute('role') || !findUpVirtual(virtualNode, nativeScopeFilter) ); } export default landmarkHasBodyContextMatches;