@@ -12,7 +12,6 @@ import {
1212 elementAXObjects ,
1313} from 'axobject-query' ;
1414import type { Node } from 'ast-types-flow' ;
15- import flatMap from 'array.prototype.flatmap' ;
1615import iterFrom from 'es-iterator-helpers/Iterator.from' ;
1716// import iterFlatMap from 'es-iterator-helpers/Iterator.prototype.flatMap';
1817import filter from 'es-iterator-helpers/Iterator.prototype.filter' ;
@@ -62,24 +61,15 @@ const interactiveRoles = new Set(roleKeys
6261 ) ) ;
6362
6463// TODO: convert to use iterFlatMap and iterFrom
65- const interactiveElementRoleSchemas = flatMap (
66- elementRoleEntries ,
67- ( [ elementSchema , rolesArr ] ) => ( rolesArr . some ( ( role ) : boolean => interactiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ,
68- ) ;
64+ const interactiveElementRoleSchemas = elementRoleEntries . flatMap ( ( [ elementSchema , rolesArr ] ) => ( rolesArr . some ( ( role ) : boolean => interactiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ) ;
6965
7066// TODO: convert to use iterFlatMap and iterFrom
71- const nonInteractiveElementRoleSchemas = flatMap (
72- elementRoleEntries ,
73- ( [ elementSchema , rolesArr ] ) => ( rolesArr . every ( ( role ) : boolean => nonInteractiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ,
74- ) ;
67+ const nonInteractiveElementRoleSchemas = elementRoleEntries . flatMap ( ( [ elementSchema , rolesArr ] ) => ( rolesArr . every ( ( role ) : boolean => nonInteractiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ) ;
7568
7669const nonInteractiveAXObjects = new Set ( filter ( iterFrom ( AXObjects . keys ( ) ) , ( name ) => [ 'window' , 'structure' ] . includes ( AXObjects . get ( name ) . type ) ) ) ;
7770
7871// TODO: convert to use iterFlatMap and iterFrom
79- const nonInteractiveElementAXObjectSchemas = flatMap (
80- [ ...elementAXObjects ] ,
81- ( [ elementSchema , AXObjectsArr ] ) => ( AXObjectsArr . every ( ( role ) : boolean => nonInteractiveAXObjects . has ( role ) ) ? [ elementSchema ] : [ ] ) ,
82- ) ;
72+ const nonInteractiveElementAXObjectSchemas = [ ...elementAXObjects ] . flatMap ( ( [ elementSchema , AXObjectsArr ] ) => ( AXObjectsArr . every ( ( role ) : boolean => nonInteractiveAXObjects . has ( role ) ) ? [ elementSchema ] : [ ] ) ) ;
8373
8474function checkIsNonInteractiveElement ( tagName , attributes ) : boolean {
8575 function elementSchemaMatcher ( elementSchema ) {
0 commit comments