function nextPointWithEmptyNode(point, isSkipInnerOffset) {
  let node, offset = 0;

  if (nodeLength(point.node) === point.offset) {
    if (isEditable(point.node)) {
      return null;
    }

    node = point.node.parentNode;
    offset = position(point.node) + 1;

    // if parent node is editable,  return current node's sibling node.
    if (isEditable(node)) {
      node = point.node.nextSibling;
      offset = 0;
    }
  } else if (hasChildren(point.node)) {
    node = point.node.childNodes[point.offset];
    offset = 0;
  } else {
    node = point.node;
    offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;
  }

  return {
    node: node,
    offset: offset,
  };
}
Find next boundaryPoint for preorder / depth first traversal of the DOM
returns next boundaryPoint with empty node

@param {BoundaryPoint} point
@param {Boolean} isSkipInnerOffset
@return {BoundaryPoint}