@fncts/base 0.0.33 → 0.0.35

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.
Files changed (239) hide show
  1. package/_cjs/collection/immutable/Conc/api.cjs +1 -4
  2. package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
  3. package/_cjs/collection/immutable/HashMap/api.cjs +4 -7
  4. package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
  5. package/_cjs/collection/immutable/HashSet/api.cjs +4 -7
  6. package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
  7. package/_cjs/collection/immutable/ImmutableArray/api.cjs +6 -9
  8. package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
  9. package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
  10. package/_cjs/control/Pure/api.cjs +8 -20
  11. package/_cjs/control/Pure/api.cjs.map +1 -1
  12. package/_cjs/data/Cause/api.cjs +2 -8
  13. package/_cjs/data/Cause/api.cjs.map +1 -1
  14. package/_cjs/data/Data.cjs +121 -0
  15. package/_cjs/data/Data.cjs.map +1 -0
  16. package/_cjs/data/Datum/api.cjs +2 -8
  17. package/_cjs/data/Datum/api.cjs.map +1 -1
  18. package/_cjs/data/DatumEither/api.cjs +2 -8
  19. package/_cjs/data/DatumEither/api.cjs.map +1 -1
  20. package/_cjs/data/Either/api.cjs +6 -24
  21. package/_cjs/data/Either/api.cjs.map +1 -1
  22. package/_cjs/data/Either/definition.cjs +1 -0
  23. package/_cjs/data/Either/definition.cjs.map +1 -1
  24. package/_cjs/data/Either/destructors.cjs +3 -3
  25. package/_cjs/data/Either/destructors.cjs.map +1 -1
  26. package/_cjs/data/Either/instances.cjs +7 -27
  27. package/_cjs/data/Either/instances.cjs.map +1 -1
  28. package/_cjs/data/EitherT/api.cjs +2 -8
  29. package/_cjs/data/EitherT/api.cjs.map +1 -1
  30. package/_cjs/data/Exit/api.cjs +3 -3
  31. package/_cjs/data/Exit/api.cjs.map +1 -1
  32. package/_cjs/data/Exit/constructors.cjs +1 -4
  33. package/_cjs/data/Exit/constructors.cjs.map +1 -1
  34. package/_cjs/data/Exit/definition.cjs +2 -0
  35. package/_cjs/data/Exit/definition.cjs.map +1 -1
  36. package/_cjs/data/Guard/api.cjs +4 -2
  37. package/_cjs/data/Guard/api.cjs.map +1 -1
  38. package/_cjs/data/Maybe/api.cjs +1 -4
  39. package/_cjs/data/Maybe/api.cjs.map +1 -1
  40. package/_cjs/data/Maybe/definition.cjs +1 -0
  41. package/_cjs/data/Maybe/definition.cjs.map +1 -1
  42. package/_cjs/data/Maybe/instances.cjs +13 -46
  43. package/_cjs/data/Maybe/instances.cjs.map +1 -1
  44. package/_cjs/data/Showable/show.cjs.map +1 -1
  45. package/_cjs/data/Tag/definition.cjs +8 -0
  46. package/_cjs/data/Tag/definition.cjs.map +1 -1
  47. package/_cjs/data/These/instances.cjs +0 -11
  48. package/_cjs/data/These/instances.cjs.map +1 -1
  49. package/_cjs/json/EitherJson.cjs +0 -18
  50. package/_cjs/json/EitherJson.cjs.map +1 -1
  51. package/_cjs/json/MaybeJson.cjs +0 -16
  52. package/_cjs/json/MaybeJson.cjs.map +1 -1
  53. package/_cjs/json/TheseJson.cjs +0 -22
  54. package/_cjs/json/TheseJson.cjs.map +1 -1
  55. package/_cjs/optics/Optional/definition.cjs +1 -4
  56. package/_cjs/optics/Optional/definition.cjs.map +1 -1
  57. package/_cjs/optics/Prism/definition.cjs +1 -4
  58. package/_cjs/optics/Prism/definition.cjs.map +1 -1
  59. package/_cjs/typeclass/MonadExcept.cjs +1 -4
  60. package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
  61. package/_mjs/collection/immutable/Conc/api.mjs +1 -4
  62. package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
  63. package/_mjs/collection/immutable/HashMap/api.mjs +4 -7
  64. package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
  65. package/_mjs/collection/immutable/HashSet/api.mjs +4 -7
  66. package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
  67. package/_mjs/collection/immutable/ImmutableArray/api.mjs +6 -9
  68. package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
  69. package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
  70. package/_mjs/control/Pure/api.mjs +8 -20
  71. package/_mjs/control/Pure/api.mjs.map +1 -1
  72. package/_mjs/data/Cause/api.mjs +2 -8
  73. package/_mjs/data/Cause/api.mjs.map +1 -1
  74. package/_mjs/data/Data.mjs +110 -0
  75. package/_mjs/data/Data.mjs.map +1 -0
  76. package/_mjs/data/Datum/api.mjs +2 -8
  77. package/_mjs/data/Datum/api.mjs.map +1 -1
  78. package/_mjs/data/DatumEither/api.mjs +2 -8
  79. package/_mjs/data/DatumEither/api.mjs.map +1 -1
  80. package/_mjs/data/Either/api.mjs +6 -24
  81. package/_mjs/data/Either/api.mjs.map +1 -1
  82. package/_mjs/data/Either/definition.mjs +1 -0
  83. package/_mjs/data/Either/definition.mjs.map +1 -1
  84. package/_mjs/data/Either/destructors.mjs +3 -3
  85. package/_mjs/data/Either/destructors.mjs.map +1 -1
  86. package/_mjs/data/Either/instances.mjs +6 -25
  87. package/_mjs/data/Either/instances.mjs.map +1 -1
  88. package/_mjs/data/EitherT/api.mjs +2 -8
  89. package/_mjs/data/EitherT/api.mjs.map +1 -1
  90. package/_mjs/data/Exit/api.mjs +2 -2
  91. package/_mjs/data/Exit/api.mjs.map +1 -1
  92. package/_mjs/data/Exit/constructors.mjs +1 -4
  93. package/_mjs/data/Exit/constructors.mjs.map +1 -1
  94. package/_mjs/data/Exit/definition.mjs +2 -0
  95. package/_mjs/data/Exit/definition.mjs.map +1 -1
  96. package/_mjs/data/Guard/api.mjs +5 -3
  97. package/_mjs/data/Guard/api.mjs.map +1 -1
  98. package/_mjs/data/Maybe/api.mjs +1 -4
  99. package/_mjs/data/Maybe/api.mjs.map +1 -1
  100. package/_mjs/data/Maybe/definition.mjs +1 -0
  101. package/_mjs/data/Maybe/definition.mjs.map +1 -1
  102. package/_mjs/data/Maybe/instances.mjs +0 -31
  103. package/_mjs/data/Maybe/instances.mjs.map +1 -1
  104. package/_mjs/data/Showable/show.mjs.map +1 -1
  105. package/_mjs/data/Tag/definition.mjs +7 -0
  106. package/_mjs/data/Tag/definition.mjs.map +1 -1
  107. package/_mjs/data/These/instances.mjs +0 -10
  108. package/_mjs/data/These/instances.mjs.map +1 -1
  109. package/_mjs/json/EitherJson.mjs +0 -15
  110. package/_mjs/json/EitherJson.mjs.map +1 -1
  111. package/_mjs/json/MaybeJson.mjs +0 -13
  112. package/_mjs/json/MaybeJson.mjs.map +1 -1
  113. package/_mjs/json/TheseJson.mjs +0 -19
  114. package/_mjs/json/TheseJson.mjs.map +1 -1
  115. package/_mjs/optics/Optional/definition.mjs +1 -4
  116. package/_mjs/optics/Optional/definition.mjs.map +1 -1
  117. package/_mjs/optics/Prism/definition.mjs +1 -4
  118. package/_mjs/optics/Prism/definition.mjs.map +1 -1
  119. package/_mjs/typeclass/MonadExcept.mjs +1 -4
  120. package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
  121. package/_src/collection/immutable/Conc/api.ts +4 -4
  122. package/_src/collection/immutable/HashMap/api.ts +4 -4
  123. package/_src/collection/immutable/HashSet/api.ts +4 -4
  124. package/_src/collection/immutable/ImmutableArray/api.ts +4 -4
  125. package/_src/collection/immutable/ImmutableArray/instances.ts +0 -2
  126. package/_src/control/Pure/api.ts +4 -7
  127. package/_src/control.ts +0 -2
  128. package/_src/data/Cause/api.ts +8 -8
  129. package/_src/data/Data.ts +144 -0
  130. package/_src/data/Datum/api.ts +8 -8
  131. package/_src/data/DatumEither/api.ts +8 -8
  132. package/_src/data/Either/api.ts +18 -18
  133. package/_src/data/Either/definition.ts +2 -1
  134. package/_src/data/Either/destructors.ts +3 -3
  135. package/_src/data/Either/instances.ts +12 -31
  136. package/_src/data/EitherT/api.ts +8 -8
  137. package/_src/data/Exit/api.ts +2 -2
  138. package/_src/data/Exit/constructors.ts +1 -1
  139. package/_src/data/Exit/definition.ts +2 -0
  140. package/_src/data/Guard/api.ts +6 -3
  141. package/_src/data/Maybe/api.ts +4 -4
  142. package/_src/data/Maybe/definition.ts +1 -0
  143. package/_src/data/Maybe/instances.ts +0 -39
  144. package/_src/data/Showable/show.ts +1 -1
  145. package/_src/data/Tag/definition.ts +8 -0
  146. package/_src/data/These/instances.ts +0 -22
  147. package/_src/data.ts +1 -0
  148. package/_src/global.ts +0 -8
  149. package/_src/json/EitherJson.ts +0 -7
  150. package/_src/json/MaybeJson.ts +0 -7
  151. package/_src/json/TheseJson.ts +0 -7
  152. package/_src/optics/Optional/definition.ts +4 -4
  153. package/_src/optics/Prism/definition.ts +1 -1
  154. package/_src/typeclass/MonadExcept.ts +1 -1
  155. package/control.d.ts +0 -2
  156. package/data/Data.d.ts +31 -0
  157. package/data/Either/definition.d.ts +2 -1
  158. package/data/Either/destructors.d.ts +1 -4
  159. package/data/Either/instances.d.ts +0 -6
  160. package/data/Exit/api.d.ts +2 -2
  161. package/data/Exit/definition.d.ts +2 -0
  162. package/data/Guard/api.d.ts +1 -2
  163. package/data/Maybe/definition.d.ts +1 -0
  164. package/data/Maybe/instances.d.ts +0 -12
  165. package/data/Showable/show.d.ts +1 -1
  166. package/data/Tag/definition.d.ts +5 -0
  167. package/data/These/instances.d.ts +0 -6
  168. package/data.d.ts +1 -0
  169. package/global.d.ts +0 -8
  170. package/json/EitherJson.d.ts +0 -6
  171. package/json/MaybeJson.d.ts +0 -6
  172. package/json/TheseJson.d.ts +0 -6
  173. package/package.json +2 -2
  174. package/_cjs/control/CompletablePromise.cjs +0 -21
  175. package/_cjs/control/CompletablePromise.cjs.map +0 -1
  176. package/_cjs/control/InterruptiblePromise.cjs +0 -23
  177. package/_cjs/control/InterruptiblePromise.cjs.map +0 -1
  178. package/_cjs/data/DecodeError/definition.cjs +0 -240
  179. package/_cjs/data/DecodeError/definition.cjs.map +0 -1
  180. package/_cjs/data/DecodeError/instances.cjs +0 -6
  181. package/_cjs/data/DecodeError/instances.cjs.map +0 -1
  182. package/_cjs/data/DecodeError.cjs +0 -28
  183. package/_cjs/data/DecodeError.cjs.map +0 -1
  184. package/_cjs/data/Decoder/api.cjs +0 -572
  185. package/_cjs/data/Decoder/api.cjs.map +0 -1
  186. package/_cjs/data/Decoder/definition.cjs +0 -30
  187. package/_cjs/data/Decoder/definition.cjs.map +0 -1
  188. package/_cjs/data/Decoder.cjs +0 -28
  189. package/_cjs/data/Decoder.cjs.map +0 -1
  190. package/_cjs/data/Encoder/api.cjs +0 -315
  191. package/_cjs/data/Encoder/api.cjs.map +0 -1
  192. package/_cjs/data/Encoder/definition.cjs +0 -22
  193. package/_cjs/data/Encoder/definition.cjs.map +0 -1
  194. package/_cjs/data/Encoder.cjs +0 -28
  195. package/_cjs/data/Encoder.cjs.map +0 -1
  196. package/_mjs/control/CompletablePromise.mjs +0 -15
  197. package/_mjs/control/CompletablePromise.mjs.map +0 -1
  198. package/_mjs/control/InterruptiblePromise.mjs +0 -15
  199. package/_mjs/control/InterruptiblePromise.mjs.map +0 -1
  200. package/_mjs/data/DecodeError/definition.mjs +0 -209
  201. package/_mjs/data/DecodeError/definition.mjs.map +0 -1
  202. package/_mjs/data/DecodeError/instances.mjs +0 -2
  203. package/_mjs/data/DecodeError/instances.mjs.map +0 -1
  204. package/_mjs/data/DecodeError.mjs +0 -5
  205. package/_mjs/data/DecodeError.mjs.map +0 -1
  206. package/_mjs/data/Decoder/api.mjs +0 -542
  207. package/_mjs/data/Decoder/api.mjs.map +0 -1
  208. package/_mjs/data/Decoder/definition.mjs +0 -22
  209. package/_mjs/data/Decoder/definition.mjs.map +0 -1
  210. package/_mjs/data/Decoder.mjs +0 -5
  211. package/_mjs/data/Decoder.mjs.map +0 -1
  212. package/_mjs/data/Encoder/api.mjs +0 -279
  213. package/_mjs/data/Encoder/api.mjs.map +0 -1
  214. package/_mjs/data/Encoder/definition.mjs +0 -15
  215. package/_mjs/data/Encoder/definition.mjs.map +0 -1
  216. package/_mjs/data/Encoder.mjs +0 -5
  217. package/_mjs/data/Encoder.mjs.map +0 -1
  218. package/_src/control/CompletablePromise.ts +0 -23
  219. package/_src/control/InterruptiblePromise.ts +0 -23
  220. package/_src/data/DecodeError/definition.ts +0 -267
  221. package/_src/data/DecodeError/instances.ts +0 -0
  222. package/_src/data/DecodeError.ts +0 -5
  223. package/_src/data/Decoder/api.ts +0 -696
  224. package/_src/data/Decoder/definition.ts +0 -31
  225. package/_src/data/Decoder.ts +0 -5
  226. package/_src/data/Encoder/api.ts +0 -381
  227. package/_src/data/Encoder/definition.ts +0 -16
  228. package/_src/data/Encoder.ts +0 -5
  229. package/control/CompletablePromise.d.ts +0 -13
  230. package/control/InterruptiblePromise.d.ts +0 -12
  231. package/data/DecodeError/definition.d.ts +0 -148
  232. package/data/DecodeError/instances.d.ts +0 -1
  233. package/data/DecodeError.d.ts +0 -2
  234. package/data/Decoder/api.d.ts +0 -214
  235. package/data/Decoder/definition.d.ts +0 -27
  236. package/data/Decoder.d.ts +0 -2
  237. package/data/Encoder/api.d.ts +0 -214
  238. package/data/Encoder/definition.d.ts +0 -16
  239. package/data/Encoder.d.ts +0 -2
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _definition = /*#__PURE__*/require("./Decoder/definition.cjs");
7
- Object.keys(_definition).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _definition[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _definition[key];
14
- }
15
- });
16
- });
17
- var _api = /*#__PURE__*/require("./Decoder/api.cjs");
18
- Object.keys(_api).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _api[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _api[key];
25
- }
26
- });
27
- });
28
- //# sourceMappingURL=Decoder.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Decoder.cjs","names":["_definition","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_api"],"sources":["../../_src/data/Decoder.ts"],"sourcesContent":[null],"mappings":";;;;;AAEA,IAAAA,WAAA,gBAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,gBAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
@@ -1,315 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports._undefined = exports._null = void 0;
7
- exports.array = array;
8
- exports.boolean = exports.bigint = void 0;
9
- exports.conc = conc;
10
- exports.deriveDictionary = exports.deriveConc = exports.deriveArray = exports.date = void 0;
11
- exports.deriveEmptyRecord = deriveEmptyRecord;
12
- exports.deriveImmutableNonEmptyArray = exports.deriveImmutableArray = void 0;
13
- exports.deriveLazy = deriveLazy;
14
- exports.deriveLiteral = deriveLiteral;
15
- exports.deriveReadonlyArray = void 0;
16
- exports.deriveRecord = deriveRecord;
17
- exports.deriveStruct = deriveStruct;
18
- exports.deriveTuple = deriveTuple;
19
- exports.deriveUnion = deriveUnion;
20
- exports.deriveValidation = deriveValidation;
21
- exports.immutableArray = immutableArray;
22
- exports.immutableNonEmptyArray = immutableNonEmptyArray;
23
- exports.literal = literal;
24
- exports.makeEncoder = void 0;
25
- exports.nullable = nullable;
26
- exports.number = void 0;
27
- exports.partial = partial;
28
- exports.readonlyArray = readonlyArray;
29
- exports.record = record;
30
- exports.string = void 0;
31
- exports.struct = struct;
32
- exports.tuple = tuple;
33
- exports.unknown = void 0;
34
- exports.validation = validation;
35
- var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/function/api"));
36
- var _definition = /*#__PURE__*/require("./definition.cjs");
37
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
38
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
39
- const makeEncoder = exports.makeEncoder = makeEncoder_1;
40
- const deriveArray = exports.deriveArray = deriveArray_1;
41
- const deriveReadonlyArray = exports.deriveReadonlyArray = deriveReadonlyArray_1;
42
- const deriveDictionary = exports.deriveDictionary = deriveDictionary_1;
43
- const deriveImmutableArray = exports.deriveImmutableArray = deriveImmutableArray_1;
44
- const deriveImmutableNonEmptyArray = exports.deriveImmutableNonEmptyArray = deriveImmutableNonEmptyArray_1;
45
- const deriveConc = exports.deriveConc = deriveConc_1;
46
- /**
47
- * @tsplus static fncts.EncoderOps __call
48
- */
49
- function makeEncoder_1(encode) {
50
- return new _definition.Encoder(encode);
51
- }
52
- /**
53
- * @tsplus static fncts.EncoderOps unknown
54
- */
55
- const unknown = exports.unknown = /*#__PURE__*/makeEncoder_1(tsplus_module_1.identity);
56
- /**
57
- * @tsplus implicit
58
- * @tsplus static fncts.EncoderOps boolean
59
- */
60
- const boolean = exports.boolean = /*#__PURE__*/makeEncoder_1(tsplus_module_1.identity);
61
- /**
62
- * @tsplus implicit
63
- * @tsplus static fncts.EncoderOps number
64
- */
65
- const number = exports.number = /*#__PURE__*/makeEncoder_1(tsplus_module_1.identity);
66
- /**
67
- * @tsplus implicit
68
- * @tsplus static fncts.EncoderOps string
69
- */
70
- const string = exports.string = /*#__PURE__*/makeEncoder_1(tsplus_module_1.identity);
71
- /**
72
- * @tsplus implicit
73
- * @tsplus static fncts.EncoderOps bigint
74
- */
75
- const bigint = exports.bigint = /*#__PURE__*/makeEncoder_1(n => n.toString(10));
76
- /**
77
- * @tsplus implicit
78
- * @tsplus static fncts.EncoderOps null
79
- */
80
- const _null = exports._null = /*#__PURE__*/makeEncoder_1(tsplus_module_1.identity);
81
- /**
82
- * @tsplus implicit
83
- * @tsplus static fncts.EncoderOps undefined
84
- */
85
- const _undefined = exports._undefined = /*#__PURE__*/makeEncoder_1(tsplus_module_1.identity);
86
- /**
87
- * @tsplus implicit
88
- * @tsplus static fncts.EncoderOps date
89
- */
90
- const date = exports.date = /*#__PURE__*/makeEncoder_1(d => d.toISOString());
91
- /**
92
- * @tsplus derive fncts.Encoder lazy
93
- * @tsplus static fncts.EncoderOps lazy
94
- */
95
- function deriveLazy(fn) {
96
- let cached;
97
- const encoder = makeEncoder_1(a => {
98
- if (!cached) {
99
- cached = fn(encoder);
100
- }
101
- return cached.encode(a);
102
- });
103
- return encoder;
104
- }
105
- function deriveLiteral(...[value]) {
106
- return makeEncoder_1(tsplus_module_1.identity);
107
- }
108
- /**
109
- * @tsplus static fncts.EncoderOps literal
110
- */
111
- function literal(value) {
112
- return makeEncoder_1(tsplus_module_1.identity);
113
- }
114
- /**
115
- * @tsplus static fncts.EncoderOps nullable
116
- */
117
- function nullable( /** @tsplus implicit local */base) {
118
- return makeEncoder_1(inp => inp == null ? inp : base.encode(inp));
119
- }
120
- /**
121
- * @tsplus derive fncts.Encoder<_> 20
122
- */
123
- function deriveStruct(...[requiredFields, optionalFields]) {
124
- return makeEncoder_1(inp => {
125
- const encoded = {};
126
- for (const field of Object.keys(requiredFields)) {
127
- // @ts-expect-error
128
- encoded[field] = requiredFields[field].encode(inp[field]);
129
- }
130
- if (optionalFields) {
131
- for (const field of Object.keys(optionalFields)) {
132
- if (field in inp && typeof inp[field] !== undefined) {
133
- // @ts-expect-error
134
- encoded[field] = optionalFields[field].encode(inp[field]);
135
- }
136
- }
137
- }
138
- return encoded;
139
- });
140
- }
141
- /**
142
- * @tsplus static fncts.EncoderOps struct
143
- */
144
- function struct(fields) {
145
- return makeEncoder_1(inp => {
146
- const encoded = {};
147
- for (const field of Object.keys(fields)) {
148
- // @ts-expect-error
149
- encoded[field] = fields[field].encode(inp[field]);
150
- }
151
- return encoded;
152
- });
153
- }
154
- /**
155
- * @tsplus static fncts.EncoderOps partial
156
- */
157
- function partial(fields) {
158
- return makeEncoder_1(inp => {
159
- const encoded = {};
160
- for (const field of Object.keys(fields)) {
161
- if (field in inp && typeof inp[field] !== undefined) {
162
- // @ts-expect-error
163
- encoded[field] = fields[field].encode(inp[field]);
164
- }
165
- }
166
- return encoded;
167
- });
168
- }
169
- /**
170
- * @tsplus derive fncts.Encoder<|> 30
171
- */
172
- function deriveUnion(...elements) {
173
- return makeEncoder_1(inp => {
174
- for (const [guard, encoder] of elements) {
175
- if (guard.is(inp)) {
176
- return encoder.encode(inp);
177
- }
178
- }
179
- });
180
- }
181
- /**
182
- * @tsplus derive fncts.Encoder<_> 10
183
- */
184
- function deriveEmptyRecord(..._) {
185
- return makeEncoder_1(tsplus_module_1.identity);
186
- }
187
- /**
188
- * @tsplus derive fncts.Encoder[fncts.Array]<_> 10
189
- */
190
- function deriveArray_1(...[element]) {
191
- return makeEncoder_1(inp => inp.map(a => element.encode(a)));
192
- }
193
- /**
194
- * @tsplus static fncts.EncoderOps array
195
- */
196
- function array( /** @tsplus implicit local */base) {
197
- const base_1 = base;
198
- return deriveArray_1(base_1);
199
- }
200
- /**
201
- * @tsplus derive fncts.Encoder[fncts.ReadonlyArray]<_> 10
202
- */
203
- function deriveReadonlyArray_1(...[element]) {
204
- return makeEncoder_1(inp => inp.map(a => element.encode(a)));
205
- }
206
- /**
207
- * @tsplus static fncts.EncoderOps readonlyArray
208
- */
209
- function readonlyArray( /** @tsplus implicit local */base) {
210
- const base_2 = base;
211
- return deriveReadonlyArray_1(base_2);
212
- }
213
- /**
214
- * @tsplus derive fncts.Encoder<_> 15
215
- */
216
- function deriveDictionary_1(...[value]) {
217
- return makeEncoder_1(inp => {
218
- const encoded = {};
219
- for (const k of Object.keys(inp)) {
220
- // @ts-expect-error
221
- encoded[k] = value.encode(inp[k]);
222
- }
223
- return encoded;
224
- });
225
- }
226
- /**
227
- * @tsplus derive fncts.Encoder<_> 15
228
- */
229
- function deriveRecord(...[value, requiredKeys]) {
230
- return makeEncoder_1(inp => {
231
- const encoded = {};
232
- for (const k of Object.keys(requiredKeys)) {
233
- // @ts-expect-error
234
- encoded[k] = value.encode(inp[k]);
235
- }
236
- return encoded;
237
- });
238
- }
239
- /**
240
- * @tsplus static fncts.EncoderOps record
241
- */
242
- function record(codomain) {
243
- const codomain_1 = codomain;
244
- return deriveDictionary_1(codomain_1);
245
- }
246
- /**
247
- * @tsplus derive fncts.Encoder[fncts.ImmutableArray]<_> 10
248
- */
249
- function deriveImmutableArray_1(...[element]) {
250
- return makeEncoder_1(inp => inp._array.map(a => element.encode(a)));
251
- }
252
- /**
253
- * @tsplus static fncts.EncoderOps immutableArray
254
- */
255
- function immutableArray(base) {
256
- const base_3 = base;
257
- return deriveImmutableArray_1(base_3);
258
- }
259
- /**
260
- * @tsplus derive fncts.Encoder[fncts.ImmutableNonEmptyArray]<_> 10
261
- */
262
- function deriveImmutableNonEmptyArray_1(...[element]) {
263
- return makeEncoder_1(inp => inp._array.map(a => element.encode(a)));
264
- }
265
- /**
266
- * @tsplus static fncts.EncoderOps immutableNonEmptyArray
267
- */
268
- function immutableNonEmptyArray(base) {
269
- const base_4 = base;
270
- return deriveImmutableNonEmptyArray_1(base_4);
271
- }
272
- /**
273
- * @tsplus derive fncts.Encoder[fncts.Conc]<_> 10
274
- */
275
- function deriveConc_1(...[element]) {
276
- return makeEncoder_1(inp => Array.from(inp).map(a => element.encode(a)));
277
- }
278
- /**
279
- * @tsplus static fncts.EncoderOps conc
280
- */
281
- function conc(base) {
282
- const base_5 = base;
283
- return deriveConc_1(base_5);
284
- }
285
- /**
286
- * @tsplus derive fncts.Encoder<_> 10
287
- */
288
- function deriveValidation(...[base]) {
289
- return makeEncoder_1(inp => base.encode(inp.unsafeCoerce()));
290
- }
291
- /**
292
- * @tsplus static fncts.EncoderOps validation
293
- */
294
- function validation(..._validations) {
295
- return base => makeEncoder_1(base.encode.unsafeCoerce());
296
- }
297
- /**
298
- * @tsplus derive fncts.Encoder<_> 10
299
- */
300
- function deriveTuple(...[components]) {
301
- return makeEncoder_1(inp => {
302
- const out = Array(inp.length);
303
- for (let i = 0; i < inp.length; i++) {
304
- out[i] = components[i].encode(inp[i]);
305
- }
306
- return out;
307
- });
308
- }
309
- /**
310
- * @tsplus static fncts.EncoderOps tuple
311
- */
312
- function tuple(...components) {
313
- return deriveTuple(components).unsafeCoerce();
314
- }
315
- //# sourceMappingURL=api.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.cjs","names":["_definition","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeEncoder","exports","makeEncoder_1","deriveArray","deriveArray_1","deriveReadonlyArray","deriveReadonlyArray_1","deriveDictionary","deriveDictionary_1","deriveImmutableArray","deriveImmutableArray_1","deriveImmutableNonEmptyArray","deriveImmutableNonEmptyArray_1","deriveConc","deriveConc_1","encode","Encoder","unknown","tsplus_module_1","identity","boolean","number","string","bigint","toString","_null","_undefined","date","d","toISOString","deriveLazy","fn","cached","encoder","deriveLiteral","value","literal","nullable","base","inp","deriveStruct","requiredFields","optionalFields","encoded","field","keys","undefined","struct","fields","partial","deriveUnion","elements","guard","is","deriveEmptyRecord","_","element","map","array","base_1","readonlyArray","base_2","k","deriveRecord","requiredKeys","record","codomain","codomain_1","_array","immutableArray","base_3","immutableNonEmptyArray","base_4","Array","from","conc","base_5","deriveValidation","unsafeCoerce","validation","_validations","deriveTuple","components","out","length","tuple"],"sources":["../../../_src/data/Encoder/api.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAAA,WAAA,gBAAAC,OAAA;AAA0C,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,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H,OAAOhF,aAAA,CAASqC,GAAG,IAAI;IACrB,MAAM4C,GAAG,GAAGV,KAAK,CAAClC,GAAG,CAAC6C,MAAM,CAAC;IAC7B,KAAK,IAAItF,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGyC,GAAG,CAAC6C,MAAM,EAAEtF,CAAC,EAAE,EAAE;MACnCqF,GAAG,CAACrF,CAAC,CAAC,GAAGoF,UAAU,CAACpF,CAAC,CAAE,CAACiB,MAAM,CAACwB,GAAG,CAACzC,CAAC,CAAC,CAAC;IACxC;IACA,OAAOqF,GAAG;EACZ,CAAC,CAAC;AACJ;AAEA;;;AAGM,SAAUE,KAAKA,CAAmC,GAAGH,UAA6C;EACtG,OAAOD,WAAW,CAACC,UAAqB,CAAC,CAACJ,YAAY,EAAE;AAC1D"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EncoderTypeId = exports.Encoder = void 0;
7
- var _a;
8
- const EncoderTypeId = exports.EncoderTypeId = /*#__PURE__*/Symbol.for("fncts.Encoder");
9
- /**
10
- * @tsplus type fncts.Encoder
11
- * @tsplus companion fncts.EncoderOps
12
- * @tsplus derive nominal
13
- */
14
- class Encoder {
15
- constructor(encode) {
16
- this.encode = encode;
17
- this[_a] = EncoderTypeId;
18
- }
19
- }
20
- exports.Encoder = Encoder;
21
- _a = EncoderTypeId;
22
- //# sourceMappingURL=definition.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"definition.cjs","names":["EncoderTypeId","exports","Symbol","for","Encoder","constructor","encode","_a"],"sources":["../../../_src/data/Encoder/definition.ts"],"sourcesContent":[null],"mappings":";;;;;;;AAAO,MAAMA,aAAa,GAAAC,OAAA,CAAAD,aAAA,gBAAGE,MAAM,CAACC,GAAG,CAAC,eAAe,CAAC;AAGxD;;;;;AAKM,MAAOC,OAAO;EAElBC,YAAqBC,MAA2B;IAA3B,KAAAA,MAAM,GAANA,MAAM;IADlB,KAAAC,EAAA,CAAe,GAAkBP,aAAa;EACJ;;AACpDC,OAAA,CAAAG,OAAA,GAAAA,OAAA;KAFWJ,aAAa"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _definition = /*#__PURE__*/require("./Encoder/definition.cjs");
7
- Object.keys(_definition).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _definition[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _definition[key];
14
- }
15
- });
16
- });
17
- var _api = /*#__PURE__*/require("./Encoder/api.cjs");
18
- Object.keys(_api).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _api[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _api[key];
25
- }
26
- });
27
- });
28
- //# sourceMappingURL=Encoder.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Encoder.cjs","names":["_definition","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_api"],"sources":["../../_src/data/Encoder.ts"],"sourcesContent":[null],"mappings":";;;;;AAEA,IAAAA,WAAA,gBAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,gBAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
@@ -1,15 +0,0 @@
1
- /**
2
- * @tsplus static fncts.CompletablePromiseOps __call
3
- */
4
- export function make() {
5
- let outerResolve = () => {};
6
- let outerReject = () => {};
7
- const promise = new Promise((resolve, reject) => {
8
- outerResolve = resolve;
9
- outerReject = reject;
10
- });
11
- promise.resolve = outerResolve;
12
- promise.reject = outerReject;
13
- return promise;
14
- }
15
- //# sourceMappingURL=CompletablePromise.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CompletablePromise.mjs","names":["make","outerResolve","outerReject","promise","Promise","resolve","reject"],"sources":["../../_src/control/CompletablePromise.ts"],"sourcesContent":[null],"mappings":"AASA;;;AAGA,OAAM,SAAUA,IAAIA,CAAA;EAClB,IAAIC,YAAY,GAA6BA,CAAA,KAAK,CAAE,CAAC;EACrD,IAAIC,WAAW,GAA8BA,CAAA,KAAK,CAAE,CAAC;EACrD,MAAMC,OAAO,GAAgC,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAI;IAC3EL,YAAY,GAAGI,OAAO;IACtBH,WAAW,GAAII,MAAM;EACvB,CAAC,CAAQ;EACTH,OAAO,CAACE,OAAO,GAAGJ,YAAY;EAC9BE,OAAO,CAACG,MAAM,GAAIJ,WAAW;EAC7B,OAAOC,OAAO;AAChB"}
@@ -1,15 +0,0 @@
1
- import * as tsplus_module_1 from "@fncts/base/data/exceptions";
2
- /**
3
- * @tsplus static fncts.InterruptiblePromiseOps __call
4
- */
5
- export function make(executor) {
6
- const promise = new Promise((resolve, reject) => {
7
- const canceller = executor(resolve, reject);
8
- promise.interrupt = () => {
9
- canceller?.();
10
- reject(new tsplus_module_1.InterruptedException());
11
- };
12
- });
13
- return promise;
14
- }
15
- //# sourceMappingURL=InterruptiblePromise.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InterruptiblePromise.mjs","names":["make","executor","promise","Promise","resolve","reject","canceller","interrupt","tsplus_module_1","InterruptedException"],"sources":["../../_src/control/InterruptiblePromise.ts"],"sourcesContent":[null],"mappings":";AAQA;;;AAGA,OAAM,SAAUA,IAAIA,CAClBC,QAAmH;EAEnH,MAAMC,OAAO,GAA4B,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAI;IACvE,MAAMC,SAAS,GAAKL,QAAQ,CAACG,OAAO,EAAEC,MAAM,CAAC;IAC7CH,OAAO,CAACK,SAAS,GAAG,MAAK;MACvBD,SAAS,GAAE,CAAE;MACbD,MAAM,CAAC,IAAAG,eAAA,CAAIC,oBAAoB,EAAE,CAAC;IACpC,CAAC;EACH,CAAC,CAA4B;EAC7B,OAAOP,OAAO;AAChB"}
@@ -1,209 +0,0 @@
1
- var _a;
2
- import * as tsplus_module_1 from "@fncts/base/collection/immutable/Vector/api";
3
- import * as tsplus_module_2 from "@fncts/base/collection/immutable/RoseTree/api";
4
- import * as tsplus_module_3 from "@fncts/base/control/Eval/api";
5
- import * as tsplus_module_4 from "@fncts/base/control/Eval/constructors";
6
- import * as tsplus_module_5 from "@fncts/base/control/Eval/instance";
7
- import { show } from "@fncts/base/data/Showable";
8
- export const DecodeErrorTypeId = /*#__PURE__*/Symbol.for("fncts.DecodeError");
9
- export class DecodeError {
10
- constructor() {
11
- this[_a] = DecodeErrorTypeId;
12
- }
13
- }
14
- _a = DecodeErrorTypeId;
15
- export class RequiredKeyError extends DecodeError {
16
- constructor(key, error) {
17
- super();
18
- this.key = key;
19
- this.error = error;
20
- this._tag = "RequiredKey";
21
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(error => tsplus_module_2.make(`on required key ${this.key}`, tsplus_module_1.vector(error)))(this.error.render));
22
- }
23
- }
24
- export class OptionalKeyError extends DecodeError {
25
- constructor(key, error) {
26
- super();
27
- this.key = key;
28
- this.error = error;
29
- this._tag = "OptionalKey";
30
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(error => tsplus_module_2.make(`on optional key ${show(this.key)}`, tsplus_module_1.vector(error)))(this.error.render));
31
- }
32
- }
33
- export class RequiredIndexError extends DecodeError {
34
- constructor(index, error) {
35
- super();
36
- this.index = index;
37
- this.error = error;
38
- this._tag = "RequiredIndex";
39
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(error => tsplus_module_2.make(`on required index ${this.index}`, tsplus_module_1.vector(error)))(this.error.render));
40
- }
41
- }
42
- export class OptionalIndexError extends DecodeError {
43
- constructor(index, error) {
44
- super();
45
- this.index = index;
46
- this.error = error;
47
- this._tag = "RequiredIndex";
48
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(error => tsplus_module_2.make(`on optional index ${this.index}`, tsplus_module_1.vector(error)))(this.error.render));
49
- }
50
- }
51
- export class LazyError extends DecodeError {
52
- constructor(error) {
53
- super();
54
- this.error = error;
55
- this._tag = "Lazy";
56
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(error => tsplus_module_2.make("while decoding a lazy decoder", tsplus_module_1.vector(error)))(this.error.render));
57
- }
58
- }
59
- export class MemberError extends DecodeError {
60
- constructor(label, error) {
61
- super();
62
- this.label = label;
63
- this.error = error;
64
- this._tag = "Member";
65
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(error => tsplus_module_2.make(`on member ${this.label}`, tsplus_module_1.vector(error)))(this.error.render));
66
- }
67
- }
68
- const vowels = ["a", "e", "i", "o", "u", "y"];
69
- function startsWithVowel(s) {
70
- for (let i = 0; i < vowels.length; i++) {
71
- if (s.startsWith(vowels[i])) return true;
72
- }
73
- return false;
74
- }
75
- export class CompoundError extends DecodeError {
76
- constructor(name, errors) {
77
- super();
78
- this.name = name;
79
- this.errors = errors;
80
- this._tag = "Compound";
81
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(errors => tsplus_module_2.make(`${this.errors.length} error(s) found while decoding ${startsWithVowel(this.name) ? "an" : "a"} ${this.name}`, errors))(tsplus_module_1._traverse(this.errors)(tsplus_module_5.Applicative)(error => error.render)));
82
- }
83
- }
84
- export class CompositionError extends DecodeError {
85
- constructor(errors) {
86
- super();
87
- this.errors = errors;
88
- this._tag = "Composition";
89
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(errors => errors.length === 1 ? tsplus_module_1.unsafeGet(1)(errors) : tsplus_module_2.make(`${errors.length} errors found while decoding a composition`, errors))(tsplus_module_1._traverse(this.errors)(tsplus_module_5.Applicative)(error => error.render)));
90
- }
91
- }
92
- export class StringError extends DecodeError {
93
- constructor(actual) {
94
- super();
95
- this.actual = actual;
96
- this._tag = "String";
97
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(cannotDecode(this.actual, "a string")));
98
- }
99
- }
100
- export class NumberError extends DecodeError {
101
- constructor(actual) {
102
- super();
103
- this.actual = actual;
104
- this._tag = "Number";
105
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(cannotDecode(this.actual, "a number")));
106
- }
107
- }
108
- export class NaNError extends DecodeError {
109
- constructor() {
110
- super(...arguments);
111
- this._tag = "NaN";
112
- this.render = tsplus_module_4.now(tsplus_module_2.make("value is NaN"));
113
- }
114
- }
115
- export class InfinityError extends DecodeError {
116
- constructor() {
117
- super(...arguments);
118
- this._tag = "Infinity";
119
- this.render = tsplus_module_4.always(() => tsplus_module_2.make("value is Infinity"));
120
- }
121
- }
122
- export class BooleanError extends DecodeError {
123
- constructor(actual) {
124
- super();
125
- this.actual = actual;
126
- this._tag = "Boolean";
127
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(cannotDecode(this.actual, "a boolean")));
128
- }
129
- }
130
- export class PrimitiveError extends DecodeError {
131
- constructor(actual, name) {
132
- super();
133
- this.actual = actual;
134
- this.name = name;
135
- this._tag = "Primitive";
136
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(cannotDecode(this.actual, this.name)));
137
- }
138
- }
139
- export class LiteralError extends DecodeError {
140
- constructor(actual, literals) {
141
- super();
142
- this.actual = actual;
143
- this.literals = literals;
144
- this._tag = "Literal";
145
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(cannotDecode(this.actual, `one of ${tsplus_module_1.join(", ")(tsplus_module_1.map(literal => show(literal))(this.literals))}`)));
146
- }
147
- }
148
- export class UnexpectedKeysError extends DecodeError {
149
- constructor(keys) {
150
- super();
151
- this.keys = keys;
152
- this._tag = "UnexpectedKeys";
153
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(`${this.keys.length} error(s) found while checking keys`, tsplus_module_1.map(key => tsplus_module_2.make(`unexpected key ${show(key)}`))(this.keys)));
154
- }
155
- }
156
- export class UnexpectedIndicesError extends DecodeError {
157
- constructor(indices) {
158
- super();
159
- this.indices = indices;
160
- this._tag = "UnexpectedIndices";
161
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(`${this.indices.length} error(s) found while checking indices`, tsplus_module_1.map(index => tsplus_module_2.make(`unexpected index ${show(index)}`))(this.indices)));
162
- }
163
- }
164
- export class MissingKeyError extends DecodeError {
165
- constructor(key) {
166
- super();
167
- this.key = key;
168
- this._tag = "MissingKeys";
169
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(`missing required key ${show(this.key)}`));
170
- }
171
- }
172
- export class MissingIndicesError extends DecodeError {
173
- constructor(keys) {
174
- super();
175
- this.keys = keys;
176
- this._tag = "MissingIndices";
177
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(`${this.keys.length} error(s) found while checking indices`, tsplus_module_1.map(key => tsplus_module_2.make(`missing required index ${show(key)}`))(this.keys)));
178
- }
179
- }
180
- function cannotDecode(u, expected) {
181
- return `cannot decode ${show(u)}, expected ${expected}`;
182
- }
183
- export class BrandedError extends DecodeError {
184
- constructor(name, brands) {
185
- super();
186
- this.name = name;
187
- this.brands = brands;
188
- this._tag = "BrandedError";
189
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(`${this.brands.length} brand(s) failed to be validated while decoding ${this.name}`, tsplus_module_1.map(brand => tsplus_module_2.make(brand))(this.brands)));
190
- }
191
- }
192
- export class UnionError extends DecodeError {
193
- constructor(label, errors) {
194
- super();
195
- this.label = label;
196
- this.errors = errors;
197
- this._tag = "UnionError";
198
- this.render = tsplus_module_4.defer(() => tsplus_module_3.map(errors => tsplus_module_2.make(`${this.errors.length} error(s) found while decoding ${this.label}`, errors))(tsplus_module_1._traverse(this.errors)(tsplus_module_5.Applicative)(error => error.render)));
199
- }
200
- }
201
- export class EmptyError extends DecodeError {
202
- constructor(actual) {
203
- super();
204
- this.actual = actual;
205
- this._tag = "EmptyError";
206
- this.render = tsplus_module_4.always(() => tsplus_module_2.make(cannotDecode(this.actual, "a collection containing at least one element")));
207
- }
208
- }
209
- //# sourceMappingURL=definition.mjs.map