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

Method replaceInDom

www/js/_hyperscript.esm.js:2484–2494  ·  view source on GitHub ↗
(target, value)

Source from the content-addressed store, hash-verified

2482 });
2483 }
2484 replaceInDom(target, value) {
2485 this.implicitLoop(target, (elt) => {
2486 var parent = elt.parentElement;
2487 if (value instanceof Node) {
2488 elt.replaceWith(value.cloneNode(true));
2489 } else {
2490 elt.replaceWith(this.convertValue(value, "Fragment"));
2491 }
2492 if (parent) this.processNode(parent);
2493 });
2494 }
2495 /**
2496 * Check if a method call is known to mutate its receiver, and notify if so.
2497 * @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