MCPcopy Index your code
hub / github.com/microsoft/SandDance / addHeader

Function addHeader

docs/app/js/sanddance-app.js:10795–10799  ·  view source on GitHub ↗
(element, header)

Source from the content-addressed store, hash-verified

10793 if (!condition && existing) existing.remove();
10794}
10795function addHeader(element, header) {
10796 const h = document.createElement("h4");
10797 h.innerHTML = header;
10798 element.insertAdjacentElement("beforebegin", h);
10799}
10800function existingHeader(element, header) {
10801 const { previousElementSibling } = element;
10802 if (previousElementSibling && previousElementSibling.innerHTML === header) return previousElementSibling;

Callers 1

conditionalHeaderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected