badmfck-api-server 2.0.6 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -82,7 +82,7 @@ async function Initializer(services) {
82
82
  exports.Initializer = Initializer;
83
83
  class APIService extends BaseService_1.BaseService {
84
84
  static nextLogID = 0;
85
- version = "1.9.6";
85
+ version = "2.0.8";
86
86
  options;
87
87
  monitor;
88
88
  monitorIndexFile;
@@ -90,7 +90,8 @@ class Validator {
90
90
  opt.regex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,6}$/g;
91
91
  }
92
92
  if (opt.regex) {
93
- const tmp = value.replaceAll(opt.regex, "");
93
+ const globalRegex = new RegExp(opt.regex.source, opt.regex.flags.includes('g') ? opt.regex.flags : opt.regex.flags + 'g');
94
+ const tmp = value.replaceAll(globalRegex, "");
94
95
  if (tmp.length !== 0)
95
96
  return ValidationReport.VALUE_INCORRECT;
96
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",