Unified · Split
| @@ -1,12 +1,3 @@ | ||
| 1 | −// TODO: This file was created by bulk-decaffeinate. | |
| 2 | −// Sanity-check the conversion and remove this comment. | |
| 3 | −/* | |
| 4 | − * decaffeinate suggestions: | |
| 5 | − * DS102: Remove unnecessary code created because of implicit returns | |
| 6 | − * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining | |
| 7 | − * DS205: Consider reworking code to avoid use of IIFEs | |
| 8 | − * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md | |
| 9 | − */ | |
| 10 | 1 | app.Shortcuts = class Shortcuts extends Events { |
| 11 | 2 | constructor() { |
| 12 | 3 | super(); |
| @@ -215,13 +206,13 @@ app.Shortcuts = class Shortcuts extends Events { · 202 unmodified lines | ||
| 215 | 206 | this.trigger("pageUp"); |
| 216 | 207 | return false; |
| 217 | 208 | case 38: |
| 218 | − if (!__guard__(getSelection(), (x) => x.toString())) { | |
| 209 | + if (!getSelection()?.toString()) { | |
| 219 | 210 | this.trigger("altUp"); |
| 220 | 211 | return false; |
| 221 | 212 | } |
| 222 | 213 | break; |
| 223 | 214 | case 40: |
| 224 | − if (!__guard__(getSelection(), (x1) => x1.toString())) { | |
| 215 | + if (!getSelection()?.toString()) { | |
| 225 | 216 | this.trigger("altDown"); |
| 226 | 217 | return false; |
| 227 | 218 | } |
| @@ -302,9 +293,3 @@ app.Shortcuts = class Shortcuts extends Events { · 74 unmodified lines | ||
| 302 | 293 | } |
| 303 | 294 | } |
| 304 | 295 | }; |
| 305 | − | |
| 306 | −function __guard__(value, transform) { | |
| 307 | − return typeof value !== "undefined" && value !== null | |
| 308 | − ? transform(value) | |
| 309 | − : undefined; | |
| 310 | −} | |