Sha256: fd5b94b7ffd95a128565a9de7df87ade4fefd7d4521eac9f3b26bb0465f06ddf

Contents?: true

Size: 671 Bytes

Versions: 115

Compression:

Stored size: 671 Bytes

Contents

/* global matches */
/**
 * Check if a node matches some attribute(s)
 *
 * Note: matches.attributes(node, matcher) can be indirectly used through
 * matches(node, { attributes: matcher })
 *
 * Example:
 * ```js
 * matches.attributes(node, {
 *   'aria-live': 'assertive', // Simple string match
 *   'aria-expanded': /true|false/i, // either boolean, case insensitive
 * })
 * ```
 *
 * @param {HTMLElement|VirtualNode} node
 * @param {Object} Attribute matcher
 * @returns {Boolean}
 */
matches.attributes = function matchesAttributes(node, matcher) {
	node = node.actualNode || node;
	return matches.fromFunction(attrName => node.getAttribute(attrName), matcher);
};

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
govuk_publishing_components-21.13.4 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.13.3 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.13.2 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.13.1 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.13.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.12.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.11.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.10.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.9.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.8.1 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.8.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.7.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.6.1 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.6.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.5.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.4.1 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.4.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.3.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.2.0 node_modules/axe-core/lib/commons/matches/attributes.js
govuk_publishing_components-21.1.1 node_modules/axe-core/lib/commons/matches/attributes.js