Sha256: 25e6f7e506a781adbdf379e893155f853fa71ccc161f613be944dcfa31031682

Contents?: true

Size: 1.53 KB

Versions: 11

Compression:

Stored size: 1.53 KB

Contents

(function(axe) {
	var definitions = [
		{
			name: 'NA',
			value: 'inapplicable',
			priority: 0,
			group: 'inapplicable'
		},
		{
			name: 'PASS',
			value: 'passed',
			priority: 1,
			group: 'passes'
		},
		{
			name: 'CANTTELL',
			value: 'cantTell',
			priority: 2,
			group: 'incomplete'
		},
		{
			name: 'FAIL',
			value: 'failed',
			priority: 3,
			group: 'violations'
		}
	];

	var constants = {
		helpUrlBase: 'https://dequeuniversity.com/rules/',
		results: [],
		resultGroups: [],
		resultGroupMap: {},
		impact: Object.freeze(['minor', 'moderate', 'serious', 'critical']),
		preload: Object.freeze({
			/**
			 * array of supported & preload(able) asset types.
			 */
			assets: ['cssom'],
			/**
			 * timeout value when resolving preload(able) assets
			 */
			timeout: 10000
		})
	};

	definitions.forEach(function(definition) {
		var name = definition.name;
		var value = definition.value;
		var priority = definition.priority;
		var group = definition.group;

		constants[name] = value;
		constants[name + '_PRIO'] = priority;
		constants[name + '_GROUP'] = group;

		constants.results[priority] = value;
		constants.resultGroups[priority] = group;

		constants.resultGroupMap[value] = group;
	});

	// Freeze everything
	Object.freeze(constants.results);
	Object.freeze(constants.resultGroups);
	Object.freeze(constants.resultGroupMap);
	Object.freeze(constants);

	// Ensure that constants can not be changed
	Object.defineProperty(axe, 'constants', {
		value: constants,
		enumerable: true,
		configurable: false,
		writable: false
	});
})(axe);

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
govuk_publishing_components-21.22.1 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.22.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.21.3 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.21.2 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.21.1 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.21.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.20.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.19.1 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.19.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.18.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.17.0 node_modules/axe-core/lib/core/constants.js