From 262a0b9d56a1207805aa93f4de24ae7a8eeca513 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sat, 6 Jan 2024 15:49:14 +0100 Subject: [PATCH] Sanity-check decaffeinate app.collections.Types --- assets/javascripts/collections/types.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/assets/javascripts/collections/types.js b/assets/javascripts/collections/types.js index dfd7c9b3..0d23be09 100644 --- a/assets/javascripts/collections/types.js +++ b/assets/javascripts/collections/types.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS104: Avoid inline assignments - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ app.collections.Types = class Types extends app.Collection { static model = "Type"; static GUIDES_RGX = @@ -14,8 +7,9 @@ app.collections.Types = class Types extends app.Collection { groups() { const result = []; for (var type of this.models) { - var name; - (result[(name = this._groupFor(type))] || (result[name] = [])).push(type); + const name = this._groupFor(type); + result[name] ||= []; + result[name].push(type); } return result.filter((e) => e.length > 0); }