22import { dom , elementRoles , roles } from 'aria-query' ;
33import type { Node } from 'ast-types-flow' ;
44import { AXObjects , elementAXObjects } from 'axobject-query' ;
5- import flatMap from 'array.prototype.flatmap' ;
65
76import attributesComparator from './attributesComparator' ;
87
@@ -47,16 +46,14 @@ const interactiveRoles = new Set(
4746 ) ,
4847) ;
4948
50- const interactiveElementRoleSchemas = flatMap (
51- elementRoleEntries ,
49+ const interactiveElementRoleSchemas = elementRoleEntries . flatMap (
5250 ( [ elementSchema , rolesArr ] ) =>
5351 rolesArr . some ( ( role ) : boolean => interactiveRoles . has ( role ) )
5452 ? [ elementSchema ]
5553 : [ ] ,
5654) ;
5755
58- const nonInteractiveElementRoleSchemas = flatMap (
59- elementRoleEntries ,
56+ const nonInteractiveElementRoleSchemas = elementRoleEntries . flatMap (
6057 ( [ elementSchema , rolesArr ] ) =>
6158 rolesArr . every ( ( role ) : boolean => nonInteractiveRoles . has ( role ) )
6259 ? [ elementSchema ]
@@ -67,8 +64,7 @@ const interactiveAXObjects = new Set(
6764 AXObjects . keys ( ) . filter ( name => AXObjects . get ( name ) . type === 'widget' ) ,
6865) ;
6966
70- const interactiveElementAXObjectSchemas = flatMap (
71- [ ...elementAXObjects ] ,
67+ const interactiveElementAXObjectSchemas = [ ...elementAXObjects ] . flatMap (
7268 ( [ elementSchema , AXObjectsArr ] ) =>
7369 AXObjectsArr . every ( ( role ) : boolean => interactiveAXObjects . has ( role ) )
7470 ? [ elementSchema ]
0 commit comments