浏览代码

Quick fix for empty recipe error. Changed deflate back to compression module

d98762625 7 年之前
父节点
当前提交
bbc580e71b

+ 5 - 3
src/core/Recipe.mjs

@@ -189,9 +189,11 @@ class Recipe  {
         }
 
         // Present the results of the final operation
-        // TODO try/catch
-        output = await lastRunOp.present(output);
-        dish.set(output, lastRunOp.presentType);
+        if (lastRunOp) {
+            // TODO try/catch
+            output = await lastRunOp.present(output);
+            dish.set(output, lastRunOp.presentType);
+        }
 
         log.debug("Recipe complete");
         return this.opList.length;

+ 1 - 1
src/core/config/OperationConfig.json

@@ -227,7 +227,7 @@
         ]
     },
     "Raw Deflate": {
-        "module": "Default",
+        "module": "Compression",
         "description": "Compresses data using the deflate algorithm with no headers.",
         "inputType": "byteArray",
         "outputType": "byteArray",

+ 2 - 0
src/core/config/modules/Compression.mjs

@@ -7,6 +7,7 @@
 */
 import Gunzip from "../../operations/Gunzip";
 import Gzip from "../../operations/Gzip";
+import RawDeflate from "../../operations/RawDeflate";
 import RawInflate from "../../operations/RawInflate";
 import Unzip from "../../operations/Unzip";
 import Zip from "../../operations/Zip";
@@ -18,6 +19,7 @@ const OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
 OpModules.Compression = {
     "Gunzip": Gunzip,
     "Gzip": Gzip,
+    "Raw Deflate": RawDeflate,
     "Raw Inflate": RawInflate,
     "Unzip": Unzip,
     "Zip": Zip,

+ 0 - 2
src/core/config/modules/Default.mjs

@@ -12,7 +12,6 @@ import FromHex from "../../operations/FromHex";
 import PowerSet from "../../operations/PowerSet";
 import ROT13 from "../../operations/ROT13";
 import ROT47 from "../../operations/ROT47";
-import RawDeflate from "../../operations/RawDeflate";
 import RotateLeft from "../../operations/RotateLeft";
 import RotateRight from "../../operations/RotateRight";
 import SetDifference from "../../operations/SetDifference";
@@ -34,7 +33,6 @@ OpModules.Default = {
     "Power Set": PowerSet,
     "ROT13": ROT13,
     "ROT47": ROT47,
-    "Raw Deflate": RawDeflate,
     "Rotate left": RotateLeft,
     "Rotate right": RotateRight,
     "Set Difference": SetDifference,

+ 1 - 1
src/core/operations/RawDeflate.mjs

@@ -28,7 +28,7 @@ class RawDeflate extends Operation {
         super();
 
         this.name = "Raw Deflate";
-        this.module = "Default";
+        this.module = "Compression";
         this.description = "Compresses data using the deflate algorithm with no headers.";
         this.inputType = "byteArray";
         this.outputType = "byteArray";