Sha256: 731bce1f90728ed09800df99920205357216a8741726629d7bc8525d5bf55e00

Contents?: true

Size: 1.15 KB

Versions: 260

Compression:

Stored size: 1.15 KB

Contents

/* exported matches */

/**
 * Check if a virtual node matches a definition
 *
 * Example:
 * ```js
 * // Match a single nodeName:
 * axe.commons.matches(vNode, 'div')
 *
 * // Match one of multiple nodeNames:
 * axe.commons.matches(vNode, ['ul', 'ol'])
 *
 * // Match a node with nodeName 'button' and with aria-hidden: true:
 * axe.commons.matches(vNode, {
 * 	 nodeName: 'button',
 * 	 attributes: { 'aria-hidden': 'true' }
 * })
 *
 * // Mixed input. Match button nodeName, input[type=button] and input[type=reset]
 * axe.commons.matches(vNode, ['button', {
 * 	nodeName: 'input', // nodeName match isn't case sensitive
 * 	properties: { type: ['button', 'reset'] }
 * }])
 * ```
 *
 * @deprecated HTMLElement is deprecated, use VirtualNode instead
 *
 * @namespace matches
 * @memberof axe.commons
 * @param {HTMLElement|VirtualNode} vNode virtual node to verify attributes against constraints
 * @param {Array<ElementDefinition>|String|Object|Function|Regex} definition
 * @return {Boolean} true/ false based on if vNode passes the constraints expected
 */
function matches(vNode, definition) {
	return matches.fromDefinition(vNode, definition);
}

commons.matches = matches;

Version data entries

260 entries across 260 versions & 1 rubygems

Version Path
govuk_publishing_components-27.9.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.9.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.8.2 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.8.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.8.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.7.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.6.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.5.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.4.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.3.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.3.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.2.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.1.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.0.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-26.0.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-25.7.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-25.6.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-25.5.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-25.4.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-25.3.1 node_modules/axe-core/lib/commons/matches/index.js