新增: - backend/venv/ - Python 虚拟环境 - backend/start.sh - 启动脚本(使用虚拟环境) - backend/requirements.txt - 依赖列表 - .gitignore - 忽略虚拟环境和缓存文件 说明: - 每个项目使用独立虚拟环境 - 避免依赖冲突 - 启动脚本自动创建和激活虚拟环境
27 lines
758 B
JavaScript
27 lines
758 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports["default"] = getExplicitRole;
|
|
var _ariaQuery = require("aria-query");
|
|
var _jsxAstUtils = require("jsx-ast-utils");
|
|
/**
|
|
* Returns an element's computed role, which is
|
|
*
|
|
* 1. The valid value of its explicit role attribute; or
|
|
* 2. The implicit value of its tag.
|
|
*/
|
|
function getExplicitRole(tag, attributes) {
|
|
var explicitRole = function toLowerCase(role) {
|
|
if (typeof role === 'string') {
|
|
return role.toLowerCase();
|
|
}
|
|
return null;
|
|
}((0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role')));
|
|
if (_ariaQuery.roles.has(explicitRole)) {
|
|
return explicitRole;
|
|
}
|
|
return null;
|
|
}
|
|
module.exports = exports.default; |