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

Method replaceInDom

tools/common/_hyperscript.iife.js:2477–2487  ·  view source on GitHub ↗
(target, value)

Source from the content-addressed store, hash-verified

2475 });
2476 }
2477 replaceInDom(target, value) {
2478 this.implicitLoop(target, (elt) => {
2479 var parent = elt.parentElement;
2480 if (value instanceof Node) {
2481 elt.replaceWith(value.cloneNode(true));
2482 } else {
2483 elt.replaceWith(this.convertValue(value, "Fragment"));
2484 }
2485 if (parent) this.processNode(parent);
2486 });
2487 }
2488 /**
2489 * Check if a method call is known to mutate its receiver, and notify if so.
2490 * @param {Object} target - The object the method was called on

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