Sanity-check decaffeinate app.templates.aboutPage

pull/1441/head
Simon Legner 1 year ago
parent b4cf756669
commit bcb6f896b5

@ -1,21 +1,9 @@
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS101: Remove unnecessary use of Array.from
* DS102: Remove unnecessary code created because of implicit returns
* DS205: Consider reworking code to avoid use of IIFEs
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
app.templates.aboutPage = function () { app.templates.aboutPage = function () {
let doc; let doc;
const all_docs = app.docs const all_docs = app.docs.all().concat(...(app.disabledDocs.all() || []));
.all()
.concat(...Array.from(app.disabledDocs.all() || []));
// de-duplicate docs by doc.name // de-duplicate docs by doc.name
const docs = []; const docs = [];
for (doc of Array.from(all_docs)) { for (doc of all_docs) {
if (!docs.find((d) => d.name === doc.name)) { if (!docs.find((d) => d.name === doc.name)) {
docs.push(doc); docs.push(doc);
} }
@ -85,23 +73,12 @@ app.templates.aboutPage = function () {
<th>Documentation <th>Documentation
<th>Copyright/License <th>Copyright/License
<th>Source code <th>Source code
${(() => { ${docs
const result = []; .map(
(doc) =>
for (doc of Array.from(docs)) { `<tr><td><a href="${doc.links?.home}">${doc.name}</a></td><td>${doc.attribution}</td><td><a href="${doc.links?.code}">Source code</a></td></tr>`,
result.push(`<tr> \ )
<td><a href=\"${doc.links != null ? doc.links.home : undefined}\">${ .join("")}
doc.name
}</a></td> \
<td>${doc.attribution}</td> \
<td><a href=\"${
doc.links != null ? doc.links.code : undefined
}\">Source code</a></td> \
</tr>`);
}
return result;
})().join("")}
</table> </table>
</div> </div>

Loading…
Cancel
Save