function getNthChildString(elm, selector) {
	const siblings =
		(elm.parentNode && Array.from(elm.parentNode.children || '')) || [];
	const hasMatchingSiblings = siblings.find(
		sibling => sibling !== elm && axe.utils.matchesSelector(sibling, selector)
	);
	if (hasMatchingSiblings) {
		const nthChild = 1 + siblings.indexOf(elm);
		return ':nth-child(' + nthChild + ')';
	} else {
		return '';
	}
}
function getNthChildString(elm, selector) {
	const siblings =
		(elm.parentNode && Array.from(elm.parentNode.children || '')) || [];
	const hasMatchingSiblings = siblings.find(
		sibling => sibling !== elm && axe.utils.matchesSelector(sibling, selector)
	);
	if (hasMatchingSiblings) {
		const nthChild = 1 + siblings.indexOf(elm);
		return ':nth-child(' + nthChild + ')';
	} else {
		return '';
	}
}
function getNthChildString ( elm , selector ) { const siblings = ( elm . parentNode && Array . from ( elm . parentNode . children || '' ) ) || [ ] ; const hasMatchingSiblings = siblings . find ( sibling => sibling !== elm && axe . utils . matchesSelector ( sibling , selector ) ) ; if ( hasMatchingSiblings ) { const nthChild = 1 + siblings . indexOf ( elm ) ; return ':nth-child(' + nthChild + ')' ; } else { return '' ; } }
Given an element and a selector that finds that element (but possibly other sibling elements)
return the :nth-child(n) pseudo selector that uniquely finds the node within its siblings
@param {Element} elm			 The Element
@param {String} selector	 The selector
@return {String}					 The nth-child selector
Given an element and a selector that finds that element ( but possibly other sibling elements ) return the : nth - child ( n ) pseudo selector that uniquely finds the node within its siblings
Returns the nth child of the element that matches the selector