UNPKG

axe-sarif-converter

Version:

Convert axe-core accessibility scan results to the SARIF format

29 lines (28 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WCAGLinkDataIndexer = void 0; var WCAGLinkDataIndexer = /** @class */ (function () { function WCAGLinkDataIndexer(wcagConfiguration) { this.wcagConfiguration = wcagConfiguration; this.sortedWcagTags = this.sortWcagTags(this.wcagConfiguration); this.wcagTagsToTaxaIndices = this.mapWcagTagToTaxaIndex(); } WCAGLinkDataIndexer.prototype.getSortedWcagTags = function () { return this.sortedWcagTags; }; WCAGLinkDataIndexer.prototype.getWcagTagsToTaxaIndices = function () { return this.wcagTagsToTaxaIndices; }; WCAGLinkDataIndexer.prototype.mapWcagTagToTaxaIndex = function () { var wcagTagsToTaxaIndices = {}; for (var i = 0; i < this.sortedWcagTags.length; i++) { wcagTagsToTaxaIndices[this.sortedWcagTags[i]] = i; } return wcagTagsToTaxaIndices; }; WCAGLinkDataIndexer.prototype.sortWcagTags = function (wcagConfiguration) { return Object.keys(wcagConfiguration).sort(); }; return WCAGLinkDataIndexer; }()); exports.WCAGLinkDataIndexer = WCAGLinkDataIndexer;