lib/core/utils/get-selector.js
function uncommonAttributes(node, selectorData) {
	let retVal = [];
	let attData = selectorData.attributes;
	let tagData = selectorData.tags;

	if (node.hasAttributes()) {
		Array.from(axe.utils.getNodeAttributes(node))
			.filter(filterAttributes)
			.forEach(at => {
				const atnv = getAttributeNameValue(node, at);

				if (atnv && attData[atnv] < tagData[node.nodeName]) {
					retVal.push({
						name: atnv,
						count: attData[atnv],
						species: 'attribute'
					});
				}
			});
	}
	return retVal.sort(countSort);
}
function uncommonAttributes(node, selectorData) {
	let retVal = [];
	let attData = selectorData.attributes;
	let tagData = selectorData.tags;

	if (node.hasAttributes()) {
		Array.from(axe.utils.getNodeAttributes(node))
			.filter(filterAttributes)
			.forEach(at => {
				const atnv = getAttributeNameValue(node, at);

				if (atnv && attData[atnv] < tagData[node.nodeName]) {
					retVal.push({
						name: atnv,
						count: attData[atnv],
						species: 'attribute'
					});
				}
			});
	}
	return retVal.sort(countSort);
}
function uncommonAttributes ( node , selectorData ) { let retVal = [ ] ; let attData = selectorData . attributes ; let tagData = selectorData . tags ; if ( node . hasAttributes ( ) ) { Array . from ( axe . utils . getNodeAttributes ( node ) ) . filter ( filterAttributes ) . forEach ( at => { const atnv = getAttributeNameValue ( node , at ) ; if ( atnv && attData [ atnv ] < tagData [ node . nodeName ] ) { retVal . push ( { name : atnv , count : attData [ atnv ] , species : 'attribute' } ) ; } } ) ; } return retVal . sort ( countSort ) ; }
Given a node and the statistics on attribute frequency on the page,
return all its uncommon attribute data sorted in order of decreasing uniqueness
@param {Element} node			The node
@param {Object} attData		The map of attributes to counts
@return {Array}						The sorted array of uncommon attribute data
Given a node and the statistics on attribute frequency on the page return all its uncommon attribute data sorted in order of decreasing uniqueness