AXObjectRoleMap.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = void 0;
  6. var _AXObjectsMap = _interopRequireDefault(require("./AXObjectsMap"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  8. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
  9. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
  10. function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  11. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  12. var AXObjectRoleMap = new Map([]);
  13. var _iteratorNormalCompletion = true;
  14. var _didIteratorError = false;
  15. var _iteratorError = undefined;
  16. try {
  17. var _loop = function _loop() {
  18. var _step$value = _slicedToArray(_step.value, 2),
  19. name = _step$value[0],
  20. def = _step$value[1];
  21. var relatedConcepts = def.relatedConcepts;
  22. if (Array.isArray(relatedConcepts)) {
  23. relatedConcepts.forEach(function (relation) {
  24. if (relation.module === 'ARIA') {
  25. var concept = relation.concept;
  26. if (concept) {
  27. var relationConcepts = AXObjectRoleMap.get(name) || new Set([]);
  28. relationConcepts.add(concept);
  29. AXObjectRoleMap.set(name, relationConcepts);
  30. }
  31. }
  32. });
  33. }
  34. };
  35. for (var _iterator = _AXObjectsMap["default"][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  36. _loop();
  37. }
  38. } catch (err) {
  39. _didIteratorError = true;
  40. _iteratorError = err;
  41. } finally {
  42. try {
  43. if (!_iteratorNormalCompletion && _iterator["return"] != null) {
  44. _iterator["return"]();
  45. }
  46. } finally {
  47. if (_didIteratorError) {
  48. throw _iteratorError;
  49. }
  50. }
  51. }
  52. var _default = AXObjectRoleMap;
  53. exports["default"] = _default;