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-28.0.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.20.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.19.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.18.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.17.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.16.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.15.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.14.2 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.14.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.14.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.13.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.12.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.11.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.10.5 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.10.4 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.10.3 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.10.2 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.10.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.10.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-27.9.2 node_modules/axe-core/lib/commons/matches/index.js