Sha256: ae1de2f3bc4b53a61b94126aed0606246a529858ed52b46a4c8359153947b367
Contents?: true
Size: 1.07 KB
Versions: 104
Compression:
Stored size: 1.07 KB
Contents
/* global reporters */ function configureChecksRulesAndBranding(spec) { /*eslint max-statements: ["error",21]*/ 'use strict'; var audit; audit = axe._audit; if (!audit) { throw new Error('No audit configured'); } if ( spec.reporter && (typeof spec.reporter === 'function' || reporters[spec.reporter]) ) { audit.reporter = spec.reporter; } if (spec.checks) { spec.checks.forEach(function(check) { audit.addCheck(check); }); } const modifiedRules = []; if (spec.rules) { spec.rules.forEach(function(rule) { modifiedRules.push(rule.id); audit.addRule(rule); }); } if (spec.disableOtherRules) { audit.rules.forEach(rule => { if (modifiedRules.includes(rule.id) === false) { rule.enabled = false; } }); } if (typeof spec.branding !== 'undefined') { audit.setBranding(spec.branding); } else { audit._constructHelpUrls(); } if (spec.tagExclude) { audit.tagExclude = spec.tagExclude; } // Support runtime localization if (spec.locale) { audit.applyLocale(spec.locale); } } axe.configure = configureChecksRulesAndBranding;
Version data entries
104 entries across 104 versions & 1 rubygems