aria-has-attr-matches.js 366 B

1234567891011121314151617
  1. import { getNodeAttributes } from '../core/utils';
  2. function ariaHasAttrMatches(node) {
  3. var aria = /^aria-/;
  4. if (node.hasAttributes()) {
  5. var attrs = getNodeAttributes(node);
  6. for (var i = 0, l = attrs.length; i < l; i++) {
  7. if (aria.test(attrs[i].name)) {
  8. return true;
  9. }
  10. }
  11. }
  12. return false;
  13. }
  14. export default ariaHasAttrMatches;