Sha256: 2197e63a88402cb86f0465573717355a11b3ffff4e0573cef1f2ded1715202ee

Contents?: true

Size: 1.11 KB

Versions: 271

Compression:

Stored size: 1.11 KB

Contents

/**
 * Determines which CheckOption to use, either defined on the rule options, global check options or the check itself
 * @param  {Check} check    The Check object
 * @param  {String} ruleID  The ID of the rule
 * @param  {Object} options Options object as passed to main API
 * @return {Object}         The resolved object with `options` and `enabled` keys
 */
axe.utils.getCheckOption = function(check, ruleID, options) {
	var ruleCheckOption = (((options.rules && options.rules[ruleID]) || {})
		.checks || {})[check.id];
	var checkOption = (options.checks || {})[check.id];

	var enabled = check.enabled;
	var opts = check.options;

	if (checkOption) {
		if (checkOption.hasOwnProperty('enabled')) {
			enabled = checkOption.enabled;
		}
		if (checkOption.hasOwnProperty('options')) {
			opts = checkOption.options;
		}
	}

	if (ruleCheckOption) {
		if (ruleCheckOption.hasOwnProperty('enabled')) {
			enabled = ruleCheckOption.enabled;
		}
		if (ruleCheckOption.hasOwnProperty('options')) {
			opts = ruleCheckOption.options;
		}
	}

	return {
		enabled: enabled,
		options: opts,
		absolutePaths: options.absolutePaths
	};
};

Version data entries

271 entries across 271 versions & 1 rubygems

Version Path
govuk_publishing_components-30.4.1 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-30.4.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-30.3.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-30.2.1 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-30.2.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-30.1.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-30.0.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.15.3 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.15.2 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.15.1 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.15.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.14.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.13.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.12.1 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.12.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.11.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.10.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.9.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.8.0 node_modules/axe-core/lib/core/utils/get-check-option.js
govuk_publishing_components-29.7.0 node_modules/axe-core/lib/core/utils/get-check-option.js