detachNodeFromParent = (node, parentNode) => {
  // avoid splice to not break for loops
  parentNode.children = parentNode.children.filter((child) => child !== node);
}
@param {import('./types.js').XastChild} node
@param {import('./types.js').XastParent} parentNode