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

Method replaceInDom

www/js/_hyperscript.js:2486–2496  ·  view source on GitHub ↗
(target, value)

Source from the content-addressed store, hash-verified

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