MCPcopy Index your code
hub / github.com/pyscript/pyscript / createList

Function createList

core/rollup/build_test_index.cjs:31–50  ·  view source on GitHub ↗
(tree)

Source from the content-addressed store, hash-verified

29};
30
31const createList = (tree) => {
32 const ul = ["<ul>"];
33 for (const [key, value] of Object.entries(tree)) {
34 ul.push("<li>");
35 if (typeof value === "string") {
36 ul.push(`<a href=".${value}">${key}<small>.html</small></a>`);
37 } else {
38 if ("." in value) {
39 ul.push(`<strong><a href=".${value["."]}">${key}</a></strong>`);
40 delete value["."];
41 } else {
42 ul.push(`<strong><span>${key}</span></strong>`);
43 }
44 if (Reflect.ownKeys(value).length) ul.push(createList(value));
45 }
46 ul.push("</li>");
47 }
48 ul.push("</ul>");
49 return ul.join("");
50};
51
52writeFileSync(
53 TEST_INDEX,

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected