src/document/doc-utils.js/getInnerParts
function getInnerParts(doc) {
  let { parts } = doc;
  let lastPart;
  // Avoid a falsy element like ""
  for (let i = doc.parts.length; i > 0 && !lastPart; i--) {
    lastPart = parts[i - 1];
  }
  if (lastPart.type === "group") {
    parts = lastPart.contents.parts;
  }
  return parts;
}