(tree)
| 29 | }; |
| 30 | |
| 31 | const 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 | |
| 52 | writeFileSync( |
| 53 | TEST_INDEX, |
no test coverage detected