dl-commons 0.1.2 → 0.1.3

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.
@@ -4,10 +4,18 @@ exports.validationExceptionFactory = validationExceptionFactory;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const custom_exception_1 = require("../exceptions/custom.exception");
6
6
  const rest_wrapper_class_1 = require("../models/dtos/wrappers/rest-wrapper.class");
7
+ function sanitize(error) {
8
+ var _a;
9
+ return {
10
+ property: error.property,
11
+ constraints: error.constraints,
12
+ children: ((_a = error.children) === null || _a === void 0 ? void 0 : _a.length) ? error.children.map(sanitize) : error.children,
13
+ };
14
+ }
7
15
  function validationExceptionFactory(_errors) {
8
16
  const error = new rest_wrapper_class_1.RESTError('data_validation');
9
17
  _errors.forEach((i) => {
10
- error.validation = i;
18
+ error.validation = sanitize(i);
11
19
  });
12
20
  return new custom_exception_1.HandledException([error], common_1.HttpStatus.UNPROCESSABLE_ENTITY);
13
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"exception.factory.js","sourceRoot":"","sources":["../../src/factories/exception.factory.ts"],"names":[],"mappings":";;AAaS,gEAA0B;AAbnC,2CAA4C;AAE5C,qEAAkE;AAClE,mFAAuE;AAEvE,SAAS,0BAA0B,CAAC,OAA0B;IAC1D,MAAM,KAAK,GAAG,IAAI,8BAAS,CAAC,iBAAiB,CAAC,CAAC;IAC/C,OAAO,CAAC,OAAO,CAAC,CAAC,CAAM,EAAE,EAAE;QACvB,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,mCAAgB,CAAC,CAAC,KAAK,CAAC,EAAE,mBAAU,CAAC,oBAAoB,CAAC,CAAC;AAC1E,CAAC"}
1
+ {"version":3,"file":"exception.factory.js","sourceRoot":"","sources":["../../src/factories/exception.factory.ts"],"names":[],"mappings":";;AA+BS,gEAA0B;AA/BnC,2CAA4C;AAE5C,qEAAkE;AAClE,mFAAuE;AAQvE,SAAS,QAAQ,CAAC,KAAsB;;IACpC,OAAO;QACH,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,EAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ;KACnF,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B,CAAC,OAA0B;IAC1D,MAAM,KAAK,GAAG,IAAI,8BAAS,CAAC,iBAAiB,CAAC,CAAC;IAK/C,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QAClB,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,mCAAgB,CAAC,CAAC,KAAK,CAAC,EAAE,mBAAU,CAAC,oBAAoB,CAAC,CAAC;AAC1E,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "dl-commons",
3
3
  "type": "commonjs",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "description": "distance learning commons",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist"
10
- ],
10
+ ],
11
11
  "engines": {
12
12
  "node": ">=20.19.0"
13
13
  },
@@ -46,17 +46,18 @@
46
46
  "@nestjs/mongoose": "^10.1.0",
47
47
  "@types/express": "^4.17.25",
48
48
  "@types/node": "^20.19.43",
49
- "@typescript-eslint/eslint-plugin": "^6.21.0",
50
- "@typescript-eslint/parser": "^6.21.0",
51
49
  "axios": "^1.7.2",
52
50
  "bson": "^6.10.4",
53
51
  "class-transformer": "^0.5.1",
54
52
  "class-validator": "^0.14.4",
55
- "eslint": "^8.57.1",
53
+ "eslint": "^10.8.0",
54
+ "eslint-plugin-prettier": "^5.5.6",
56
55
  "express": "^4.18.2",
56
+ "globals": "^17.9.0",
57
57
  "mongoose": "^8.24.2",
58
58
  "reflect-metadata": "^0.2.2",
59
59
  "rxjs": "^7.8.1",
60
- "typescript": "^5.9.3"
60
+ "typescript": "^5.9.3",
61
+ "typescript-eslint": "^8.66.0"
61
62
  }
62
63
  }