badmfck-api-server 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.7",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",