snabbdom-decontextify

Get a decontextified (sans data etc.) VNode from a snabbdom VNode

Usage no npm install needed!

<script type="module">
  import snabbdomDecontextify from 'https://cdn.skypack.dev/snabbdom-decontextify';
</script>

README

snabbdom-decontextify

Build Status codecov

decontextify(vnode: VNode) => VNode

Returns a clone of the provided VNode tree, that has no context.

A VNode that has no context (decontextified) has only

  • sel; only the tagName part.
  • key
  • text
  • children and the same for the children, recursively.

See test for example.