aria-allowed-attr-matches.js 322 B

123456789101112131415
  1. function ariaAllowedAttrMatches(node, virtualNode) {
  2. const aria = /^aria-/;
  3. const attrs = virtualNode.attrNames;
  4. if (attrs.length) {
  5. for (let i = 0, l = attrs.length; i < l; i++) {
  6. if (aria.test(attrs[i])) {
  7. return true;
  8. }
  9. }
  10. }
  11. return false;
  12. }
  13. export default ariaAllowedAttrMatches;