This example unwraps the node el, which can be any existing element with a parent node
import {
DOMParser,
Node,
Document,
} from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
const parent = el.parentNode;
while (el.firstChild) parent.insertBefore(el.firstChild, el);
parent.removeChild(el);
parent.normalize();
// Error: Property 'normalize' does not exist on type 'Node'.
The method
normalize
seems to be missing fromNode
. It "merges" child text nodes, so that no text nodes are adjacent to another: https://developer.mozilla.org/en-US/docs/Web/API/Node/normalizeThis example unwraps the node
el
, which can be any existing element with a parent node