UNPKG

@uuv/a11y

Version:

A javascript lib for running a11y validation based on multiple reference(RGAA, etc)

25 lines (24 loc) 896 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CompliantAttributesQuery = void 0; class CompliantAttributesQuery { subQuery; attributeSpecifications; constructor(subQuery, attributeSpecifications) { this.subQuery = subQuery; this.attributeSpecifications = attributeSpecifications; } execute() { return this.subQuery.execute().filter((element) => { let result = true; this.attributeSpecifications.forEach(attributeSpecification => { result = result && attributeSpecification.specification.isSatisfiedBy(element.domNode, attributeSpecification.attribute); }); return result; }); } getSelector() { return `CompliantAttributes: ${this.subQuery.getSelector()}`; } } exports.CompliantAttributesQuery = CompliantAttributesQuery;