get-global-aria-attrs.js 548 B

12345678910111213141516171819202122
  1. import cache from '../../core/base/cache';
  2. import standards from '../../standards';
  3. /**
  4. * Return a list of global aria attributes.
  5. * @return {String[]} List of all global aria attributes
  6. */
  7. function getGlobalAriaAttrs() {
  8. if (cache.get('globalAriaAttrs')) {
  9. return cache.get('globalAriaAttrs');
  10. }
  11. const globalAttrs = Object.keys(standards.ariaAttrs).filter(attrName => {
  12. return standards.ariaAttrs[attrName].global;
  13. });
  14. cache.set('globalAriaAttrs', globalAttrs);
  15. return globalAttrs;
  16. }
  17. export default getGlobalAriaAttrs;