Browse Source

Sanity-check decaffeinate app.templates.render

Simon Legner 1 year ago
parent
commit
b4cf756669
1 changed files with 3 additions and 11 deletions
  1. 3 11
      assets/javascripts/templates/base.js

+ 3 - 11
assets/javascripts/templates/base.js

@@ -1,22 +1,14 @@
-// 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
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 app.templates.render = function (name, value, ...args) {
   const template = app.templates[name];
 
   if (Array.isArray(value)) {
     let result = "";
-    for (var val of Array.from(value)) {
-      result += template(val, ...Array.from(args));
+    for (var val of value) {
+      result += template(val, ...args);
     }
     return result;
   } else if (typeof template === "function") {
-    return template(value, ...Array.from(args));
+    return template(value, ...args);
   } else {
     return template;
   }