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) • 431 B
JavaScript
import { sanitize } from '../commons/text';
import { isVisible, isInTextBlock } from '../commons/dom';
function linkInTextBlockMatches(node) {
var text = sanitize(node.textContent);
var role = node.getAttribute('role');
if (role && role !== 'link') {
return false;
}
if (!text) {
return false;
}
if (!isVisible(node, false)) {
return false;
}
return isInTextBlock(node);
}
export default linkInTextBlockMatches;