From bcb6f896b526d03f272e881c84c59518c8da04a4 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sat, 6 Jan 2024 16:06:49 +0100 Subject: [PATCH] Sanity-check decaffeinate app.templates.aboutPage --- .../javascripts/templates/pages/about_tmpl.js | 39 ++++--------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.js b/assets/javascripts/templates/pages/about_tmpl.js index 9fd09042..3d97d8f0 100644 --- a/assets/javascripts/templates/pages/about_tmpl.js +++ b/assets/javascripts/templates/pages/about_tmpl.js @@ -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 () { let doc; - const all_docs = app.docs - .all() - .concat(...Array.from(app.disabledDocs.all() || [])); + const all_docs = app.docs.all().concat(...(app.disabledDocs.all() || [])); // de-duplicate docs by doc.name const docs = []; - for (doc of Array.from(all_docs)) { + for (doc of all_docs) { if (!docs.find((d) => d.name === doc.name)) { docs.push(doc); } @@ -85,23 +73,12 @@ app.templates.aboutPage = function () { Documentation Copyright/License Source code - ${(() => { - const result = []; - - for (doc of Array.from(docs)) { - result.push(` \ -${ - doc.name - } \ -${doc.attribution} \ -Source code \ -`); - } - - return result; - })().join("")} + ${docs + .map( + (doc) => + `${doc.name}${doc.attribution}Source code`, + ) + .join("")}