aria-query
Advanced tools
Comparing version 5.3.1 to 5.3.2
@@ -12,4 +12,4 @@ "use strict"; | ||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } | ||
@@ -146,5 +146,5 @@ var properties = [['aria-activedescendant', { | ||
get: function get(key) { | ||
var item = properties.find(function (tuple) { | ||
var item = properties.filter(function (tuple) { | ||
return tuple[0] === key ? true : false; | ||
}); | ||
})[0]; | ||
return item && item[1]; | ||
@@ -151,0 +151,0 @@ }, |
@@ -12,4 +12,4 @@ "use strict"; | ||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } | ||
@@ -289,5 +289,5 @@ var dom = [['a', { | ||
get: function get(key) { | ||
var item = dom.find(function (tuple) { | ||
var item = dom.filter(function (tuple) { | ||
return tuple[0] === key ? true : false; | ||
}); | ||
})[0]; | ||
return item && item[1]; | ||
@@ -294,0 +294,0 @@ }, |
@@ -13,4 +13,4 @@ "use strict"; | ||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } | ||
@@ -24,33 +24,34 @@ var elementRoles = []; | ||
var concepts = [].concat(role.baseConcepts, role.relatedConcepts); | ||
for (var k = 0; k < concepts.length; k++) { | ||
var _loop = function _loop() { | ||
var relation = concepts[k]; | ||
if (relation.module === 'HTML') { | ||
(function () { | ||
var concept = relation.concept; | ||
if (concept) { | ||
var elementRoleRelation = elementRoles.find(function (relation) { | ||
return ariaRoleRelationConceptEquals(relation[0], concept); | ||
}); | ||
var roles; | ||
if (elementRoleRelation) { | ||
roles = elementRoleRelation[1]; | ||
} else { | ||
roles = []; | ||
var concept = relation.concept; | ||
if (concept) { | ||
var elementRoleRelation = elementRoles.filter(function (relation) { | ||
return ariaRoleRelationConceptEquals(relation[0], concept); | ||
})[0]; | ||
var roles; | ||
if (elementRoleRelation) { | ||
roles = elementRoleRelation[1]; | ||
} else { | ||
roles = []; | ||
} | ||
var isUnique = true; | ||
for (var _i = 0; _i < roles.length; _i++) { | ||
if (roles[_i] === key) { | ||
isUnique = false; | ||
break; | ||
} | ||
var isUnique = true; | ||
for (var _i = 0; _i < roles.length; _i++) { | ||
if (roles[_i] === key) { | ||
isUnique = false; | ||
break; | ||
} | ||
} | ||
if (isUnique) { | ||
roles.push(key); | ||
} | ||
if (!elementRoleRelation) { | ||
elementRoles.push([concept, roles]); | ||
} | ||
} | ||
})(); | ||
if (isUnique) { | ||
roles.push(key); | ||
} | ||
if (!elementRoleRelation) { | ||
elementRoles.push([concept, roles]); | ||
} | ||
} | ||
} | ||
}; | ||
for (var k = 0; k < concepts.length; k++) { | ||
_loop(); | ||
} | ||
@@ -73,5 +74,5 @@ } | ||
get: function get(key) { | ||
var item = elementRoles.find(function (tuple) { | ||
var item = elementRoles.filter(function (tuple) { | ||
return key.name === tuple[0].name && ariaRoleRelationConceptAttributeEquals(key.attributes, tuple[0].attributes); | ||
}); | ||
})[0]; | ||
return item && item[1]; | ||
@@ -78,0 +79,0 @@ }, |
@@ -13,4 +13,4 @@ "use strict"; | ||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } | ||
@@ -53,5 +53,5 @@ var roleElement = []; | ||
get: function get(key) { | ||
var item = roleElement.find(function (tuple) { | ||
var item = roleElement.filter(function (tuple) { | ||
return tuple[0] === key ? true : false; | ||
}); | ||
})[0]; | ||
return item && item[1]; | ||
@@ -58,0 +58,0 @@ }, |
"use strict"; | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -14,5 +13,2 @@ value: true | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | ||
@@ -22,4 +18,4 @@ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } | ||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } | ||
@@ -41,7 +37,7 @@ var roles = [].concat(_ariaAbstractRoles.default, _ariaLiteralRoles.default, _ariaDpubRoles.default, _ariaGraphicsRoles.default); | ||
var superClassName = _step2.value; | ||
var superClassRoleTuple = roles.find(function (_ref3) { | ||
var superClassRoleTuple = roles.filter(function (_ref3) { | ||
var _ref4 = _slicedToArray(_ref3, 1), | ||
name = _ref4[0]; | ||
return name === superClassName; | ||
}); | ||
})[0]; | ||
if (superClassRoleTuple) { | ||
@@ -54,3 +50,4 @@ var superClassDefinition = superClassRoleTuple[1]; | ||
!Object.prototype.hasOwnProperty.call(roleDefinition.props, prop)) { | ||
Object.assign(roleDefinition.props, _defineProperty({}, prop, superClassDefinition.props[prop])); | ||
// $FlowIgnore assigning without an index signature is fine | ||
roleDefinition.props[prop] = superClassDefinition.props[prop]; | ||
} | ||
@@ -97,5 +94,5 @@ } | ||
get: function get(key) { | ||
var item = roles.find(function (tuple) { | ||
var item = roles.filter(function (tuple) { | ||
return tuple[0] === key ? true : false; | ||
}); | ||
})[0]; | ||
return item && item[1]; | ||
@@ -102,0 +99,0 @@ }, |
{ | ||
"name": "aria-query", | ||
"version": "5.3.1", | ||
"version": "5.3.2", | ||
"description": "Programmatic access to the ARIA specification", | ||
@@ -17,4 +17,4 @@ "main": "lib/index.js", | ||
"build:tests": "npm run build && rimraf __tests-built__ && BABEL_ENV=test babel __tests__ --out-dir __tests-built__", | ||
"tests-built": "nyc tape '__tests-built__/**/*.js'", | ||
"tests-only": "nyc tape -r @babel/register '__tests__/**/*.js'", | ||
"tests-built": "nyc tape --strict -r array.from/auto '__tests-built__/**/*.js'", | ||
"tests-only": "nyc tape --strict -r @babel/register '__tests__/**/*.js'", | ||
"test": "npm run tests-only", | ||
@@ -39,10 +39,12 @@ "posttest": "npm audit --production", | ||
"devDependencies": { | ||
"@babel/cli": "^7.19.3", | ||
"@babel/core": "^7.24.7", | ||
"@babel/eslint-parser": "^7.19.1", | ||
"@babel/node": "^7.22.5", | ||
"@babel/plugin-transform-react-jsx": "^7.20.7", | ||
"@babel/preset-env": "^7.19.4", | ||
"@babel/preset-flow": "^7.18.6", | ||
"@babel/cli": "^7.25.6", | ||
"@babel/core": "^7.25.2", | ||
"@babel/eslint-parser": "^7.25.1", | ||
"@babel/node": "^7.25.0", | ||
"@babel/plugin-transform-react-jsx": "^7.25.2", | ||
"@babel/preset-env": "^7.25.4", | ||
"@babel/preset-flow": "^7.24.7", | ||
"@babel/register": "^7.24.6", | ||
"array.from": "^1.1.6", | ||
"array.prototype.some": "^1.1.6", | ||
"babel-plugin-module-resolver": "^5.0.2", | ||
@@ -53,11 +55,9 @@ "commander": "^9.4.1", | ||
"eslint-plugin-flowtype": "^8.0.3", | ||
"expect": "^29.2.1", | ||
"flow-bin": "^0.191.0", | ||
"minimist": "^1.2.7", | ||
"mock-property": "^1.0.3", | ||
"mock-property": "^1.1.0", | ||
"nyc": "^10.3.2", | ||
"object-inspect": "^1.13.2", | ||
"object.values": "^1.2.0", | ||
"rimraf": "^3.0.2", | ||
"tape": "^5.8.1" | ||
"rimraf": "^2.7.1", | ||
"tape": "^5.9.0" | ||
}, | ||
@@ -64,0 +64,0 @@ "browserslist": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
176114
5631