@@ -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' ;
1615
1716import attributesComparator from './attributesComparator' ;
1817
@@ -57,22 +56,13 @@ const interactiveRoles = new Set(roleKeys
5756 'toolbar' ,
5857 ) ) ;
5958
60- const interactiveElementRoleSchemas = flatMap (
61- elementRoleEntries ,
62- ( [ elementSchema , rolesArr ] ) => ( rolesArr . some ( ( role ) : boolean => interactiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ,
63- ) ;
59+ const interactiveElementRoleSchemas = elementRoleEntries . flatMap ( ( [ elementSchema , rolesArr ] ) => ( rolesArr . some ( ( role ) : boolean => interactiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ) ;
6460
65- const nonInteractiveElementRoleSchemas = flatMap (
66- elementRoleEntries ,
67- ( [ elementSchema , rolesArr ] ) => ( rolesArr . every ( ( role ) : boolean => nonInteractiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ,
68- ) ;
61+ const nonInteractiveElementRoleSchemas = elementRoleEntries . flatMap ( ( [ elementSchema , rolesArr ] ) => ( rolesArr . every ( ( role ) : boolean => nonInteractiveRoles . has ( role ) ) ? [ elementSchema ] : [ ] ) ) ;
6962
7063const nonInteractiveAXObjects = new Set ( AXObjects . keys ( ) . filter ( ( name ) => [ 'window' , 'structure' ] . includes ( AXObjects . get ( name ) . type ) ) ) ;
7164
72- const nonInteractiveElementAXObjectSchemas = flatMap (
73- [ ...elementAXObjects ] ,
74- ( [ elementSchema , AXObjectsArr ] ) => ( AXObjectsArr . every ( ( role ) : boolean => nonInteractiveAXObjects . has ( role ) ) ? [ elementSchema ] : [ ] ) ,
75- ) ;
65+ const nonInteractiveElementAXObjectSchemas = [ ...elementAXObjects ] . flatMap ( ( [ elementSchema , AXObjectsArr ] ) => ( AXObjectsArr . every ( ( role ) : boolean => nonInteractiveAXObjects . has ( role ) ) ? [ elementSchema ] : [ ] ) ) ;
7666
7767function checkIsNonInteractiveElement ( tagName , attributes ) : boolean {
7868 function elementSchemaMatcher ( elementSchema ) {
0 commit comments