Bladeren bron

From Base85 and From Braille signatures added for magic

n1073645 5 jaren geleden
bovenliggende
commit
1118ff598d
2 gewijzigde bestanden met toevoegingen van 24 en 0 verwijderingen
  1. 17 0
      src/core/operations/FromBase85.mjs
  2. 7 0
      src/core/operations/FromBraille.mjs

+ 17 - 0
src/core/operations/FromBase85.mjs

@@ -33,6 +33,23 @@ class FromBase85 extends Operation {
                 value: ALPHABET_OPTIONS
             },
         ];
+        this.patterns = [
+            {
+                match:  "^\\s*(<~)?([!-u]{4})+([!-u]{1,3})??(~>)?\\s*$",
+                flags:  "",
+                args:   ["!-u", true]
+            },
+            {
+                match:  "^\\s*(<~)?([0-9A-Z.-:+=^!/*?&<>()[]{}@%$#]{4})+([0-9A-Z.-:+=^!/*?&<>()[]{}@%$#]{1,3})??(~>)?\\s*$",
+                flags:  "i",
+                args:   ["0-9a-zA-Z.-:+=^!/*?&<>()[]{}@%$#", true]
+            },
+            {
+                match:  "^\\s*(<~)?([0-9A-Z.-:+=^!/*?&_<>()[]{}@%$#;`|~]{4})+([0-9A-Z.-:+=^!/*?&_<>()[]{}@%$#;`|~]{1,3})??(~>)?\\s*$",
+                flags:  "i",
+                args:   ["0-9A-Za-z!#$%&()*+-;<=>?@^_`{|~}", true]
+            }
+        ];
     }
 
     /**

+ 7 - 0
src/core/operations/FromBraille.mjs

@@ -25,6 +25,13 @@ class FromBraille extends Operation {
         this.inputType = "string";
         this.outputType = "string";
         this.args = [];
+        this.patterns = [
+            {
+                match:  "^\\s*[⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿]+\\s*$",
+                flags:  "i",
+                args:   [true]
+            }
+        ];
     }
 
     /**