MCPcopy Create free account
hub / github.com/developit/undom / insertBefore

Method insertBefore

src/undom.js:56–61  ·  view source on GitHub ↗
(child, ref)

Source from the content-addressed store, hash-verified

54 return child;
55 }
56 insertBefore(child, ref) {
57 child.remove();
58 child.parentNode = this;
59 !ref ? this.childNodes.push(child) : splice(this.childNodes, ref, child);
60 return child;
61 }
62 replaceChild(child, ref) {
63 if (ref.parentNode===this) {
64 this.insertBefore(child, ref);

Callers 2

appendChildMethod · 0.95
replaceChildMethod · 0.95

Calls 2

spliceFunction · 0.90
removeMethod · 0.80

Tested by

no test coverage detected