src/xpath.js
function nodePosition(node) {
  let name = node.nodeName
  let position = 1
  while ((node = node.previousSibling)) {
    if (node.nodeName === name) position += 1
  }
  return position
}
function nodePosition(node) {
  let name = node.nodeName
  let position = 1
  while ((node = node.previousSibling)) {
    if (node.nodeName === name) position += 1
  }
  return position
}
function nodePosition ( node ) { let name = node . nodeName let position = 1 while ( ( node = node . previousSibling ) ) { if ( node . nodeName === name ) position += 1 } return position }
Get the ordinal position of this node among its siblings of the same name.
Get the ordinal position of this node among its siblings of the same name .