Unified · Split
| @@ -1,23 +1,11 @@ | ||
| 1 | −// TODO: This file was created by bulk-decaffeinate. | |
| 2 | −// Sanity-check the conversion and remove this comment. | |
| 3 | −/* | |
| 4 | − * decaffeinate suggestions: | |
| 5 | − * DS101: Remove unnecessary use of Array.from | |
| 6 | − * DS102: Remove unnecessary code created because of implicit returns | |
| 7 | − * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining | |
| 8 | − * DS206: Consider reworking classes to avoid initClass | |
| 9 | − * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md | |
| 10 | − */ | |
| 11 | 1 | app.views.TypeList = class TypeList extends app.View { |
| 12 | − static initClass() { | |
| 13 | − this.tagName = "div"; | |
| 14 | − this.className = "_list _list-sub"; | |
| 2 | + static tagName = "div"; | |
| 3 | + static className = "_list _list-sub"; | |
| 15 | 4 | |
| 16 | − this.events = { | |
| 17 | − open: "onOpen", | |
| 18 | − close: "onClose", | |
| 19 | − }; | |
| 20 | − } | |
| 5 | + static events = { | |
| 6 | + open: "onOpen", | |
| 7 | + close: "onClose", | |
| 8 | + }; | |
| 21 | 9 | |
| 22 | 10 | constructor(doc) { |
| 23 | 11 | super(); |
| @@ -52,7 +40,7 @@ app.views.TypeList = class TypeList extends app.View { · 28 unmodified lines | ||
| 52 | 40 | |
| 53 | 41 | render() { |
| 54 | 42 | let html = ""; |
| 55 | − for (var group of Array.from(this.doc.types.groups())) { | |
| 43 | + for (var group of this.doc.types.groups()) { | |
| 56 | 44 | html += this.tmpl("sidebarType", group); |
| 57 | 45 | } |
| 58 | 46 | return this.html(html); |
| @@ -86,14 +74,7 @@ app.views.TypeList = class TypeList extends app.View { · 27 unmodified lines | ||
| 86 | 74 | |
| 87 | 75 | paginateTo(model) { |
| 88 | 76 | if (model.type) { |
| 89 | − __guard__(this.lists[model.getType().slug], (x) => x.paginateTo(model)); | |
| 77 | + this.lists[model.getType().slug]?.paginateTo(model); | |
| 90 | 78 | } |
| 91 | 79 | } |
| 92 | 80 | }; |
| 93 | −app.views.TypeList.initClass(); | |
| 94 | − | |
| 95 | −function __guard__(value, transform) { | |
| 96 | − return typeof value !== "undefined" && value !== null | |
| 97 | − ? transform(value) | |
| 98 | − : undefined; | |
| 99 | −} | |