@aimake/nanod
Version:
## 设计模式 NANO DESIGN 是面向于企业级中台化应用的解决方案。服务于 ToB 和 ToE 类型的单页应用,应用于各产品中从而产出了一套设计及前端规范。
16 lines (13 loc) • 408 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getDataOrAriaProps;
function getDataOrAriaProps(props) {
return Object.keys(props).reduce(function (prev, key) {
if ((key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') && key.substr(0, 7) !== 'data-__') {
prev[key] = props[key];
}
return prev;
}, {});
}