[refactor] bundle up two filter into one

pull/6693/head
shinyaigeek 5 years ago committed by tanhauhau
parent f26e5c643d
commit 8998079d03

@ -1,11 +1,11 @@
import { ARIARoleDefintionKey, roles as rolesMap } from 'aria-query'; import { ARIARoleDefintionKey, roles as rolesMap } from 'aria-query';
const roles = [...rolesMap.keys()]; const roles = [...rolesMap.keys()];
const _interactiveRoles = roles const _interactiveRoles = roles.filter(
.filter((name) => !rolesMap.get(name).abstract) (name) =>
.filter((name) => !rolesMap.get(name).abstract &&
rolesMap.get(name).superClass.some((c) => c.includes('widget')) rolesMap.get(name).superClass.some((c) => c.includes('widget'))
); );
// 'toolbar' does not descend from widget, but it does support // 'toolbar' does not descend from widget, but it does support
// aria-activedescendant, thus in practice we treat it as a widget. // aria-activedescendant, thus in practice we treat it as a widget.

Loading…
Cancel
Save