MCPcopy Index your code
hub / github.com/google/agents-cli / htmlEl

Function htmlEl

docs/src/javascripts/lifecycle.js:92–113  ·  view source on GitHub ↗
(tag, attrs, children)

Source from the content-addressed store, hash-verified

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

Callers 15

initTranscriptFunction · 0.85
turnNodeFunction · 0.85
initLoopFunction · 0.85
initFailureMuseumFunction · 0.85
initScaffoldFunction · 0.85
initTeamFunction · 0.85
initEvalLoopFunction · 0.85
renderCasesFunction · 0.85
initTraceFunction · 0.85
initModelCompareFunction · 0.85
initPlaygroundFunction · 0.85
renderTurnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected