c2-http 1.0.121 → 1.0.122

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,8 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const body_parser_1 = __importDefault(require("body-parser"));
7
- // import moment from "moment";
8
- const moment_timezone_1 = __importDefault(require("moment-timezone"));
9
7
  class MiddlewareBody {
10
8
  config(expressApplication) {
11
9
  expressApplication.use(body_parser_1.default.json({ limit: "5mb" }));
@@ -33,26 +31,25 @@ class MiddlewareBody {
33
31
  // }
34
32
  // }
35
33
  convertDates(obj, headers) {
36
- if (Array.isArray(obj)) {
37
- // percorre arrays também
38
- for (let i = 0; i < obj.length; i++) {
39
- this.convertDates(obj[i], headers);
40
- }
41
- }
42
- else if (typeof obj === "object" && obj !== null) {
43
- for (const key in obj) {
44
- if (!obj.hasOwnProperty(key))
45
- continue;
46
- const value = obj[key];
47
- if (key.endsWith("Date") || key.endsWith("DateTime")) {
48
- const tz = headers["timezone"] || "America/Sao_Paulo"; // fallback padrão
49
- obj[key] = moment_timezone_1.default.tz(value, "YYYY-MM-DD", tz).utc();
50
- }
51
- else {
52
- this.convertDates(value, headers); // recursivo
53
- }
54
- }
55
- }
34
+ // if (Array.isArray(obj)) {
35
+ // // percorre arrays também
36
+ // for (let i = 0; i < obj.length; i++) {
37
+ // this.convertDates(obj[i], headers);
38
+ // }
39
+ // }
40
+ // else if (typeof obj === "object" && obj !== null) {
41
+ // for (const key in obj) {
42
+ // if (!obj.hasOwnProperty(key)) continue;
43
+ // const value = obj[key];
44
+ // if (key.endsWith("Date") || key.endsWith("DateTime")) {
45
+ // const tz = headers["timezone"] || "America/Sao_Paulo"; // fallback padrão
46
+ // obj[key] = moment.tz(value, "YYYY-MM-DD", tz).utc();
47
+ // }
48
+ // else {
49
+ // this.convertDates(value, headers); // recursivo
50
+ // }
51
+ // }
52
+ // }
56
53
  }
57
54
  }
58
55
  exports.default = new MiddlewareBody;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-http",
3
- "version": "1.0.121",
3
+ "version": "1.0.122",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",