From b61fd59b60cb82cb2b28c17f769e982b8022d963 Mon Sep 17 00:00:00 2001 From: n1073645 Date: Wed, 4 Dec 2019 09:28:22 +0000 Subject: [PATCH] Linting --- src/core/lib/Magic.mjs | 20 ++++++++++---------- src/core/lib/Test.mjs | 2 +- src/core/operations/DefangIPAddresses.mjs | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core/lib/Magic.mjs b/src/core/lib/Magic.mjs index b36e44d6..db436009 100644 --- a/src/core/lib/Magic.mjs +++ b/src/core/lib/Magic.mjs @@ -262,15 +262,15 @@ class Magic { // method on the resulting data, recording the properties of each option. await Promise.all(sensible.map(async op => { const opConfig = { - op: op.op, - args: op.args - }; - let output; - try { - output = await this._runRecipe([opConfig]); - } catch(err) { - return; - } + op: op.op, + args: op.args + }; + let output; + try { + output = await this._runRecipe([opConfig]); + } catch (err) { + return; + } // If the recipe is repeating and returning the same data, do not continue if (prevOp && op.op === prevOp.op && _buffersEqual(output, this.inputBuffer)) { return; @@ -280,7 +280,7 @@ class Magic { if (_buffersEqual(output, new ArrayBuffer())) { return; } - + const outputRegexes = OperationConfig[op.op].outputRegexes; switch (flag) { case "Input": diff --git a/src/core/lib/Test.mjs b/src/core/lib/Test.mjs index e12ae841..7bd9a3c9 100644 --- a/src/core/lib/Test.mjs +++ b/src/core/lib/Test.mjs @@ -120,7 +120,7 @@ class potentialOps { }); }); } - console.log(opPatterns); + return opPatterns; } diff --git a/src/core/operations/DefangIPAddresses.mjs b/src/core/operations/DefangIPAddresses.mjs index 658d2589..a55d21f8 100644 --- a/src/core/operations/DefangIPAddresses.mjs +++ b/src/core/operations/DefangIPAddresses.mjs @@ -26,13 +26,13 @@ class DefangIPAddresses extends Operation { this.inputType = "string"; this.outputType = "string"; this.args = []; - this.checks = new magicObject(/*[ + this.checks = new magicObject([ { match: "^\\s*(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-f]{4}:){7}[0-9a-f]{4})\\s*$", flags: "i", args: [], } - ],*/null, + ], [ { match: "^\\s*(([0-9]{1,3}\\[\\.\\]){3}[0-9]{1,3}|([0-9a-f]{4}\\[\\:\\]){7}[0-9a-f]{4})\\s*$",