MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / replaceInDom

Method replaceInDom

www/js/_hyperscript-max.js:2485–2495  ·  view source on GitHub ↗
(target, value)

Source from the content-addressed store, hash-verified

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