Browse Source

extra signatures

n1073645 5 years ago
parent
commit
2ba37af109

+ 21 - 17
src/core/operations/EscapeUnicodeCharacters.mjs

@@ -44,23 +44,27 @@ class EscapeUnicodeCharacters extends Operation {
                 "value": true
             }
         ];
-        this.patterns = [
-            {
-                match: "\\\\u(?:[\\da-f]{4,6})",
-                flags: "i",
-                args: ["\\u"]
-            },
-            {
-                match: "%u(?:[\\da-f]{4,6})",
-                flags: "i",
-                args: ["%u"]
-            },
-            {
-                match: "U\\+(?:[\\da-f]{4,6})",
-                flags: "i",
-                args: ["U+"]
-            },
-        ];
+        this.checks = {
+            input: {
+                regex: [
+                    {
+                        match: "\\\\u(?:[\\da-f]{4,6})",
+                        flags: "i",
+                        args: ["\\u"]
+                    },
+                    {
+                        match: "%u(?:[\\da-f]{4,6})",
+                        flags: "i",
+                        args: ["%u"]
+                    },
+                    {
+                        match: "U\\+(?:[\\da-f]{4,6})",
+                        flags: "i",
+                        args: ["U+"]
+                    }
+                ]
+            }
+        };
     }
 
     /**

+ 41 - 37
src/core/operations/FromBinary.mjs

@@ -33,43 +33,47 @@ class FromBinary extends Operation {
                 "value": BIN_DELIM_OPTIONS
             }
         ];
-        this.patterns = [
-            {
-                match: "^(?:[01]{8})+$",
-                flags: "",
-                args: ["None"]
-            },
-            {
-                match: "^(?:[01]{8})(?: [01]{8})*$",
-                flags: "",
-                args: ["Space"]
-            },
-            {
-                match: "^(?:[01]{8})(?:,[01]{8})*$",
-                flags: "",
-                args: ["Comma"]
-            },
-            {
-                match: "^(?:[01]{8})(?:;[01]{8})*$",
-                flags: "",
-                args: ["Semi-colon"]
-            },
-            {
-                match: "^(?:[01]{8})(?::[01]{8})*$",
-                flags: "",
-                args: ["Colon"]
-            },
-            {
-                match: "^(?:[01]{8})(?:\\n[01]{8})*$",
-                flags: "",
-                args: ["Line feed"]
-            },
-            {
-                match: "^(?:[01]{8})(?:\\r\\n[01]{8})*$",
-                flags: "",
-                args: ["CRLF"]
-            },
-        ];
+        this.checks = {
+            input: {
+                regex: [
+                    {
+                        match: "^(?:[01]{8})+$",
+                        flags: "",
+                        args: ["None"]
+                    },
+                    {
+                        match: "^(?:[01]{8})(?: [01]{8})*$",
+                        flags: "",
+                        args: ["Space"]
+                    },
+                    {
+                        match: "^(?:[01]{8})(?:,[01]{8})*$",
+                        flags: "",
+                        args: ["Comma"]
+                    },
+                    {
+                        match: "^(?:[01]{8})(?:;[01]{8})*$",
+                        flags: "",
+                        args: ["Semi-colon"]
+                    },
+                    {
+                        match: "^(?:[01]{8})(?::[01]{8})*$",
+                        flags: "",
+                        args: ["Colon"]
+                    },
+                    {
+                        match: "^(?:[01]{8})(?:\\n[01]{8})*$",
+                        flags: "",
+                        args: ["Line feed"]
+                    },
+                    {
+                        match: "^(?:[01]{8})(?:\\r\\n[01]{8})*$",
+                        flags: "",
+                        args: ["CRLF"]
+                    },
+                ]
+            }
+        };
     }
 
     /**

+ 11 - 7
src/core/operations/ParseQRCode.mjs

@@ -33,14 +33,18 @@ class ParseQRCode extends Operation {
                 "value": false
             }
         ];
-        this.patterns = [
-            {
-                "match": "^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)",
-                "flags": "",
-                "args": [false],
-                "useful": true
+        this.checks = {
+            input: {
+                regex: [
+                    {
+                        "match": "^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)",
+                        "flags": "",
+                        "args": [false],
+                        "useful": true
+                    }
+                ]
             }
-        ];
+        };
     }
 
     /**