Sha256: 2063d6eea62ddc6b11561f9d813acd89df98435c78c5a695e9970b9ae6a52888

Contents?: true

Size: 1.57 KB

Versions: 104

Compression:

Stored size: 1.57 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']),
		preloadAssets: Object.freeze(['cssom']), // overtime this array will grow with other preload asset types, this constant is to verify if a requested preload type by the user via the configuration is supported by axe.
		preloadAssetsTimeout: 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

104 entries across 104 versions & 1 rubygems

Version Path
govuk_publishing_components-21.16.3 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.16.2 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.16.1 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.16.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.15.2 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.15.1 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.15.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.14.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.13.5 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.13.4 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.13.3 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.13.2 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.13.1 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.13.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.12.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.11.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.10.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.9.0 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.8.1 node_modules/axe-core/lib/core/constants.js
govuk_publishing_components-21.8.0 node_modules/axe-core/lib/core/constants.js