getComputedRole.js 675 B

12345678910111213141516171819202122
  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports["default"] = getComputedRole;
  7. var _getExplicitRole = _interopRequireDefault(require("./getExplicitRole"));
  8. var _getImplicitRole = _interopRequireDefault(require("./getImplicitRole"));
  9. /**
  10. * Returns an element's computed role, which is
  11. *
  12. * 1. The valid value of its explicit role attribute; or
  13. * 2. The implicit value of its tag.
  14. */
  15. function getComputedRole(tag, attributes) {
  16. return (0, _getExplicitRole["default"])(tag, attributes) || (0, _getImplicitRole["default"])(tag, attributes);
  17. }