瀏覽代碼

Tweaks to 'Filter' operation.

n1474335 8 年之前
父節點
當前提交
216d8f1f7a
共有 6 個文件被更改,包括 12 次插入11 次删除
  1. 0 0
      build/prod/cyberchef.htm
  2. 0 0
      build/prod/index.html
  3. 0 0
      build/prod/scripts.js
  4. 2 1
      src/js/config/OperationConfig.js
  5. 5 5
      src/js/operations/StrUtils.js
  6. 5 5
      src/static/stats.txt

文件差異過大導致無法顯示
+ 0 - 0
build/prod/cyberchef.htm


文件差異過大導致無法顯示
+ 0 - 0
build/prod/index.html


文件差異過大導致無法顯示
+ 0 - 0
build/prod/scripts.js


+ 2 - 1
src/js/config/OperationConfig.js

@@ -1765,8 +1765,9 @@ const OperationConfig = {
         ]
     },
     "Filter": {
-        description: "Filter the string with an regular expression",
+        description: "Splits up the input using the specified delimiter and then filters each branch based on a regular expression.",
         run: StrUtils.run_filter,
+        manual_bake: true,
         input_type: "string",
         output_type: "string",
         args: [

+ 5 - 5
src/js/operations/StrUtils.js

@@ -262,18 +262,18 @@ var StrUtils = {
         return sections.join(join_delim);
     },
 
+
     /**
-     * Filter by regex operation.
+     * Filter operation.
      *
      * @author Mikescher (https://github.com/Mikescher | https://mikescher.com)
-     *
      * @param {string} input
      * @param {Object[]} args
      * @returns {string}
      */
     run_filter: function(input, args) {
-        var delim = Utils.char_rep[args[0]];
-        var reverse = args[2];
+        var delim = Utils.char_rep[args[0]],
+            reverse = args[2];
 
         try {
             var regex = new RegExp(args[1]);
@@ -283,7 +283,7 @@ var StrUtils = {
 
         const regex_filter = function(value) {
             return reverse ^ regex.test(value);
-        }
+        };
 
         return input.split(delim).filter(regex_filter).join(delim);
     },

+ 5 - 5
src/static/stats.txt

@@ -1,9 +1,9 @@
 206	source files
-113411	lines
+113462	lines
 4.2M	size
 
 137	JavaScript source files
-104253	lines
+104304	lines
 3.7M	size
 
 79	third party JavaScript source files
@@ -11,11 +11,11 @@
 3.0M	size
 
 58	first party JavaScript source files
-19201	lines
-724K	size
+19252	lines
+728K	size
 
 3.4M	uncompressed JavaScript size
 1.8M	compressed JavaScript size
 
 15	categories
-158	operations
+159	operations

部分文件因文件數量過多而無法顯示