(tag, attrs, children)
| 90 | } |
| 91 | // Helper: build an HTML element from a tag + attrs object. |
| 92 | function htmlEl(tag, attrs, children) { |
| 93 | const el = document.createElement(tag); |
| 94 | if (attrs) |
| 95 | for (const k in attrs) { |
| 96 | if (k === "style" && typeof attrs[k] === "object") { |
| 97 | Object.assign(el.style, attrs[k]); |
| 98 | } else if (k === "class") { |
| 99 | el.className = attrs[k]; |
| 100 | } else if (k === "html") { |
| 101 | el.innerHTML = attrs[k]; |
| 102 | } else { |
| 103 | el.setAttribute(k, attrs[k]); |
| 104 | } |
| 105 | } |
| 106 | if (children) { |
| 107 | (Array.isArray(children) ? children : [children]).forEach((c) => { |
| 108 | if (c == null) return; |
| 109 | el.appendChild(typeof c === "string" ? document.createTextNode(c) : c); |
| 110 | }); |
| 111 | } |
| 112 | return el; |
| 113 | } |
| 114 | |
| 115 | // ─────────────────────────────────────────── 1. TRANSCRIPT ────────────── |
| 116 |
no outgoing calls
no test coverage detected