瀏覽代碼

Fixed module replacement issue.

n1474335 6 年之前
父節點
當前提交
29cb273d08
共有 2 個文件被更改,包括 4 次插入5 次删除
  1. 2 2
      Gruntfile.js
  2. 2 3
      src/core/operations/Subsection.mjs

+ 2 - 2
Gruntfile.js

@@ -171,7 +171,7 @@ module.exports = function (grunt) {
                     },
                     },
                     resolve: {
                     resolve: {
                         alias: {
                         alias: {
-                            "./config/modules/OpModules": "./config/modules/Default"
+                            "./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
                         }
                         }
                     },
                     },
                     plugins: [
                     plugins: [
@@ -268,7 +268,7 @@ module.exports = function (grunt) {
                     }, moduleEntryPoints),
                     }, moduleEntryPoints),
                     resolve: {
                     resolve: {
                         alias: {
                         alias: {
-                            "./config/modules/OpModules": "./config/modules/Default"
+                            "./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
                         }
                         }
                     },
                     },
                     plugins: [
                     plugins: [

+ 2 - 3
src/core/operations/Subsection.mjs

@@ -4,7 +4,6 @@
  * @license Apache-2.0
  * @license Apache-2.0
  */
  */
 
 
-import XRegExp from "xregexp";
 import Operation from "../Operation.mjs";
 import Operation from "../Operation.mjs";
 import Recipe from "../Recipe.mjs";
 import Recipe from "../Recipe.mjs";
 import Dish from "../Dish.mjs";
 import Dish from "../Dish.mjs";
@@ -22,7 +21,7 @@ class Subsection extends Operation {
 
 
         this.name = "Subsection";
         this.name = "Subsection";
         this.flowControl = true;
         this.flowControl = true;
-        this.module = "Regex";
+        this.module = "Default";
         this.description = "Select a part of the input data using a regular expression (regex), and run all subsequent operations on each match separately.<br><br>You can use up to one capture group, where the recipe will only be run on the data in the capture group. If there's more than one capture group, only the first one will be operated on.";
         this.description = "Select a part of the input data using a regular expression (regex), and run all subsequent operations on each match separately.<br><br>You can use up to one capture group, where the recipe will only be run on the data in the capture group. If there's more than one capture group, only the first one will be operated on.";
         this.infoURL = "";
         this.infoURL = "";
         this.inputType = "string";
         this.inputType = "string";
@@ -87,7 +86,7 @@ class Subsection extends Operation {
             if (!caseSensitive) flags += "i";
             if (!caseSensitive) flags += "i";
             if (global) flags += "g";
             if (global) flags += "g";
 
 
-            const regex = new XRegExp(section, flags),
+            const regex = new RegExp(section, flags),
                 recipe = new Recipe();
                 recipe = new Recipe();
 
 
             recipe.addOperations(subOpList);
             recipe.addOperations(subOpList);