identical-links-same-purpose-matches.js 420 B

123456789101112131415161718
  1. import { accessibleTextVirtual } from '../commons/text';
  2. import { getRole } from '../commons/aria';
  3. function identicalLinksSamePurposeMatches(node, virtualNode) {
  4. const hasAccName = !!accessibleTextVirtual(virtualNode);
  5. if (!hasAccName) {
  6. return false;
  7. }
  8. const role = getRole(node);
  9. if (role && role !== 'link') {
  10. return false;
  11. }
  12. return true;
  13. }
  14. export default identicalLinksSamePurposeMatches;