@trayio/commons 2.11.0 → 2.11.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.
@@ -1 +1 @@
1
- {"version":3,"file":"TypeCodec.d.ts","sourceRoot":"","sources":["../../src/codec/TypeCodec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAI3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,SAAS,CAAC,CAAC,CAAE,YAAW,KAAK,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAIlE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAEhC;IAEF,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAgD;IAC9E,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CAA4C;IACzE,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAElB;IAIhC,MAAM,CAAC,aAAa,oHAGoB;IAExC,OAAO,CAAC,UAAU,CAAqB;IAEvC,OAAO;IAIP,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;IAIzB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;CAQ1C"}
1
+ {"version":3,"file":"TypeCodec.d.ts","sourceRoot":"","sources":["../../src/codec/TypeCodec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAK3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,qBAAa,SAAS,CAAC,CAAC,CAAE,YAAW,KAAK,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAIlE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAEhC;IAEF,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAgD;IAC9E,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CAA4C;IACzE,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAElB;IAIhC,MAAM,CAAC,aAAa,oHAGoB;IAExC,OAAO,CAAC,UAAU,CAAqB;IAEvC,OAAO;IAIP,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;IAIzB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;CAQ1C"}
@@ -22,12 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.TypeCodec = void 0;
27
30
  const E = __importStar(require("fp-ts/lib/Either"));
28
31
  const t = __importStar(require("io-ts"));
32
+ const io_ts_reporters_1 = __importDefault(require("io-ts-reporters"));
29
33
  const Record_1 = require("fp-ts/Record");
30
- const PathReporter_1 = require("io-ts/PathReporter");
31
34
  const function_1 = require("fp-ts/function");
32
35
  class TypeCodec {
33
36
  static fromDescriptor(descriptor) {
@@ -41,8 +44,8 @@ class TypeCodec {
41
44
  }
42
45
  decode(value) {
43
46
  const result = this.descriptor.decode(value);
44
- const report = PathReporter_1.PathReporter.report(result);
45
- return (0, function_1.pipe)(result, E.mapLeft(() => new Error(report.join(', '))));
47
+ const report = io_ts_reporters_1.default.report(result);
48
+ return (0, function_1.pipe)(result, E.mapLeft((e) => new Error(report.join(', '))));
46
49
  }
47
50
  }
48
51
  exports.TypeCodec = TypeCodec;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/commons",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "Extensions to the standard/core libraries and basic features",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
@@ -20,6 +20,7 @@
20
20
  "formidable": "^3.5.1",
21
21
  "fp-ts": "2.12.3",
22
22
  "io-ts": "2.2.20",
23
+ "io-ts-reporters": "2.0.1",
23
24
  "io-ts-types": "0.5.19",
24
25
  "lodash": "4.17.21",
25
26
  "monocle-ts": "2.3.13",