From 3ea1050e17cd053601f3f1810e7672c86a83ecec Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sat, 6 Jan 2024 16:10:32 +0100 Subject: [PATCH] Sanity-check decaffeinate app.templates.helpPage --- .../javascripts/templates/pages/help_tmpl.js | 52 ++++++------------- 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/assets/javascripts/templates/pages/help_tmpl.js b/assets/javascripts/templates/pages/help_tmpl.js index 55e0bd9e..2fa186c8 100644 --- a/assets/javascripts/templates/pages/help_tmpl.js +++ b/assets/javascripts/templates/pages/help_tmpl.js @@ -1,26 +1,12 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS205: Consider reworking code to avoid use of IIFEs - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ app.templates.helpPage = function () { - let key, value; const ctrlKey = $.isMac() ? "cmd" : "ctrl"; const navKey = $.isMac() ? "cmd" : "alt"; const arrowScroll = app.settings.get("arrowScroll"); - const aliases_one = {}; - const aliases_two = {}; - const keys = Object.keys(app.models.Entry.ALIASES); - const middle = Math.ceil(keys.length / 2) - 1; - for (let i = 0; i < keys.length; i++) { - key = keys[i]; - (i > middle ? aliases_two : aliases_one)[key] = - app.models.Entry.ALIASES[key]; - } + const aliases = Object.entries(app.models.Entry.ALIASES); + const middle = Math.ceil(aliases.length / 2); + const aliases_one = aliases.slice(0, middle); + const aliases_two = aliases.slice(middle); return `\