badmfck-api-server 3.7.9 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,7 +95,7 @@ async function Initializer(services) {
95
95
  exports.Initializer = Initializer;
96
96
  class APIService extends BaseService_1.BaseService {
97
97
  static nextLogID = 0;
98
- version = "3.7.9";
98
+ version = "3.8.1";
99
99
  options;
100
100
  monitor = null;
101
101
  started = new Date();
@@ -98,7 +98,13 @@ class Validator {
98
98
  }
99
99
  else {
100
100
  if (!optional) {
101
- errors.push("no field '" + parentPath + i + "'");
101
+ if (Array.isArray(object) && !isNaN(parseInt(`${i}`))) {
102
+ const p = parentPath.length > 0 ? parentPath.slice(0, -1) : parentPath;
103
+ errors.push("no item for '" + p + "[" + i + "]'");
104
+ }
105
+ else {
106
+ errors.push("no field '" + parentPath + i + "'");
107
+ }
102
108
  continue;
103
109
  }
104
110
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "3.7.9",
3
+ "version": "3.8.1",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",