badmfck-api-server 2.0.5 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -403,7 +403,7 @@ class APIService extends BaseService_1.BaseService {
403
403
  result[i] = this.checkDataLength(data[i], result[i], lvl + 1);
404
404
  arrcnt--;
405
405
  if (arrcnt <= 0) {
406
- result["..."] = "...";
406
+ result["..."] = "... total: " + Array.isArray(data) ? data.length : Object.keys(data).length;
407
407
  break;
408
408
  }
409
409
  }
@@ -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.5",
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",