MCPcopy Create free account
hub / github.com/openai/plugins / renderList

Function renderList

plugins/plugin-eval/src/renderers/html.js:9–14  ·  view source on GitHub ↗
(items)

Source from the content-addressed store, hash-verified

7}
8
9function renderList(items) {
10 if (items.length === 0) {
11 return "<p>None.</p>";
12 }
13 return `<ul>${items.map((item) => `<li>${escapeHtml(item)}</li>`).join("")}</ul>`;
14}
15
16function renderOptionalList(items, emptyLabel = "None.") {
17 return renderList(Array.isArray(items) && items.length > 0 ? items : [emptyLabel]);

Callers 5

renderOptionalListFunction · 0.85
renderObservedUsageFunction · 0.85
renderWorkflowGuideFunction · 0.85
renderNextActionFunction · 0.85
renderHtmlFunction · 0.85

Calls 2

mapMethod · 0.80
escapeHtmlFunction · 0.70

Tested by

no test coverage detected