MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / replaceInDom

Method replaceInDom

src/core/runtime/runtime.js:472–482  ·  view source on GitHub ↗
(target, value)

Source from the content-addressed store, hash-verified

470 }
471
472 replaceInDom(target, value) {
473 this.implicitLoop(target, (elt) => {
474 var parent = elt.parentElement;
475 if (value instanceof Node) {
476 elt.replaceWith(value.cloneNode(true));
477 } else {
478 elt.replaceWith(this.convertValue(value, "Fragment"));
479 }
480 if (parent) this.processNode(parent);
481 });
482 }
483
484 /**
485 * Check if a method call is known to mutate its receiver, and notify if so.

Callers 5

setMethod · 0.45
setMethod · 0.45
setMethod · 0.45
setMethod · 0.45
setMethod · 0.45

Calls 3

implicitLoopMethod · 0.95
convertValueMethod · 0.95
processNodeMethod · 0.95

Tested by

no test coverage detected