function nodeBounds(node) {
  let elPos;
  let doc = node.ownerDocument;

  if (node.nodeType == Node.TEXT_NODE) {
    let elRange = doc.createRange();
    elRange.selectNodeContents(node);
    elPos = elRange.getBoundingClientRect();
  } else {
    elPos = node.getBoundingClientRect();
  }

  return elPos;
}
Find the bounds of any node
allows for getting bounds of text nodes by wrapping them in a range
@param {node} node
@returns {BoundingClientRect}
@memberof Core