Sha256: 9b9b91ae56ab1eda1ba5f22fc79cf835401616091c2acb4a8612ba315dba6d5e

Contents?: true

Size: 670 Bytes

Versions: 115

Compression:

Stored size: 670 Bytes

Contents

/* global matches */

/**
 * Check if a node matches some attribute(s)
 *
 * Note: matches.properties(node, matcher) can be indirectly used through
 * matches(node, { properties: matcher })
 *
 * Example:
 * ```js
 * matches.properties(node, {
 *   type: 'text', // Simple string match
 *   value: value => value.trim() !== '', // None-empty value, using a function matcher
 * })
 * ```
 *
 * @param {HTMLElement|VirtualNode} node
 * @param {Object} matcher
 * @returns {Boolean}
 */
matches.properties = function matchesProperties(node, matcher) {
	node = node.actualNode || node;
	const out = matches.fromFunction(propName => node[propName], matcher);
	return out;
};

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
govuk_publishing_components-21.22.1 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.22.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.21.3 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.21.2 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.21.1 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.21.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.20.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.19.1 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.19.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.18.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.17.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.16.3 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.16.2 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.16.1 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.16.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.15.2 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.15.1 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.15.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.14.0 node_modules/axe-core/lib/commons/matches/properties.js
govuk_publishing_components-21.13.5 node_modules/axe-core/lib/commons/matches/properties.js