@duplojs/utils 1.0.7 → 1.1.7

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 (294) hide show
  1. package/dist/array/coalescing.cjs +9 -0
  2. package/dist/array/coalescing.d.ts +3 -0
  3. package/dist/array/coalescing.mjs +7 -0
  4. package/dist/array/index.cjs +2 -0
  5. package/dist/array/index.d.ts +1 -0
  6. package/dist/array/index.mjs +1 -0
  7. package/dist/array/map.cjs +1 -1
  8. package/dist/array/map.d.ts +2 -2
  9. package/dist/array/map.mjs +1 -1
  10. package/dist/array/reduce.cjs +1 -1
  11. package/dist/array/reduce.mjs +1 -1
  12. package/dist/array/types/ArrayCoalescing.d.ts +1 -0
  13. package/dist/array/types/index.d.ts +1 -0
  14. package/dist/common/escapeRegExp.cjs +2 -2
  15. package/dist/common/escapeRegExp.d.ts +1 -1
  16. package/dist/common/escapeRegExp.mjs +2 -2
  17. package/dist/common/index.d.ts +2 -0
  18. package/dist/common/instanceOf.cjs +20 -0
  19. package/dist/common/instanceOf.d.ts +3 -0
  20. package/dist/common/instanceOf.mjs +18 -0
  21. package/dist/common/kind.cjs +38 -1
  22. package/dist/common/kind.d.ts +21 -3
  23. package/dist/common/kind.mjs +38 -2
  24. package/dist/common/memo.cjs +16 -0
  25. package/dist/common/memo.d.ts +5 -0
  26. package/dist/common/memo.mjs +14 -0
  27. package/dist/common/simpleClone.cjs +2 -2
  28. package/dist/common/simpleClone.mjs +2 -2
  29. package/dist/common/types/anyConstructor.d.ts +1 -0
  30. package/dist/common/types/anyPredicate.d.ts +1 -0
  31. package/dist/common/types/index.d.ts +2 -0
  32. package/dist/common/types/objectEntry.d.ts +1 -1
  33. package/dist/common/types/predicate.d.ts +1 -0
  34. package/dist/common/types/unionContain.d.ts +1 -1
  35. package/dist/dataParser/base.cjs +116 -0
  36. package/dist/dataParser/base.d.ts +44 -0
  37. package/dist/dataParser/base.mjs +109 -0
  38. package/dist/dataParser/baseExtended.cjs +55 -0
  39. package/dist/dataParser/baseExtended.d.ts +45 -0
  40. package/dist/dataParser/baseExtended.mjs +52 -0
  41. package/dist/dataParser/error.cjs +54 -0
  42. package/dist/dataParser/error.d.ts +31 -0
  43. package/dist/dataParser/error.mjs +41 -0
  44. package/dist/dataParser/extended/array.cjs +20 -0
  45. package/dist/dataParser/extended/array.d.ts +21 -0
  46. package/dist/dataParser/extended/array.mjs +18 -0
  47. package/dist/dataParser/extended/bigint.cjs +20 -0
  48. package/dist/dataParser/extended/bigint.d.ts +19 -0
  49. package/dist/dataParser/extended/bigint.mjs +18 -0
  50. package/dist/dataParser/extended/boolean.cjs +11 -0
  51. package/dist/dataParser/extended/boolean.d.ts +9 -0
  52. package/dist/dataParser/extended/boolean.mjs +9 -0
  53. package/dist/dataParser/extended/coerce/bigint.cjs +13 -0
  54. package/dist/dataParser/extended/coerce/bigint.d.ts +7 -0
  55. package/dist/dataParser/extended/coerce/bigint.mjs +11 -0
  56. package/dist/dataParser/extended/coerce/boolean.cjs +13 -0
  57. package/dist/dataParser/extended/coerce/boolean.d.ts +7 -0
  58. package/dist/dataParser/extended/coerce/boolean.mjs +11 -0
  59. package/dist/dataParser/extended/coerce/empty.cjs +13 -0
  60. package/dist/dataParser/extended/coerce/empty.d.ts +7 -0
  61. package/dist/dataParser/extended/coerce/empty.mjs +11 -0
  62. package/dist/dataParser/extended/coerce/index.cjs +17 -0
  63. package/dist/dataParser/extended/coerce/index.d.ts +6 -0
  64. package/dist/dataParser/extended/coerce/index.mjs +6 -0
  65. package/dist/dataParser/extended/coerce/nil.cjs +13 -0
  66. package/dist/dataParser/extended/coerce/nil.d.ts +7 -0
  67. package/dist/dataParser/extended/coerce/nil.mjs +11 -0
  68. package/dist/dataParser/extended/coerce/number.cjs +13 -0
  69. package/dist/dataParser/extended/coerce/number.d.ts +7 -0
  70. package/dist/dataParser/extended/coerce/number.mjs +11 -0
  71. package/dist/dataParser/extended/coerce/string.cjs +13 -0
  72. package/dist/dataParser/extended/coerce/string.d.ts +7 -0
  73. package/dist/dataParser/extended/coerce/string.mjs +11 -0
  74. package/dist/dataParser/extended/empty.cjs +11 -0
  75. package/dist/dataParser/extended/empty.d.ts +9 -0
  76. package/dist/dataParser/extended/empty.mjs +9 -0
  77. package/dist/dataParser/extended/index.cjs +48 -0
  78. package/dist/dataParser/extended/index.d.ts +22 -0
  79. package/dist/dataParser/extended/index.mjs +21 -0
  80. package/dist/dataParser/extended/lazy.cjs +11 -0
  81. package/dist/dataParser/extended/lazy.d.ts +11 -0
  82. package/dist/dataParser/extended/lazy.mjs +9 -0
  83. package/dist/dataParser/extended/literal.cjs +11 -0
  84. package/dist/dataParser/extended/literal.d.ts +11 -0
  85. package/dist/dataParser/extended/literal.mjs +9 -0
  86. package/dist/dataParser/extended/nil.cjs +11 -0
  87. package/dist/dataParser/extended/nil.d.ts +9 -0
  88. package/dist/dataParser/extended/nil.mjs +9 -0
  89. package/dist/dataParser/extended/nullable.cjs +11 -0
  90. package/dist/dataParser/extended/nullable.d.ts +11 -0
  91. package/dist/dataParser/extended/nullable.mjs +9 -0
  92. package/dist/dataParser/extended/number.cjs +27 -0
  93. package/dist/dataParser/extended/number.d.ts +24 -0
  94. package/dist/dataParser/extended/number.mjs +24 -0
  95. package/dist/dataParser/extended/object.cjs +11 -0
  96. package/dist/dataParser/extended/object.d.ts +11 -0
  97. package/dist/dataParser/extended/object.mjs +9 -0
  98. package/dist/dataParser/extended/optional.cjs +11 -0
  99. package/dist/dataParser/extended/optional.d.ts +11 -0
  100. package/dist/dataParser/extended/optional.mjs +9 -0
  101. package/dist/dataParser/extended/pipe.cjs +11 -0
  102. package/dist/dataParser/extended/pipe.d.ts +12 -0
  103. package/dist/dataParser/extended/pipe.mjs +9 -0
  104. package/dist/dataParser/extended/record.cjs +11 -0
  105. package/dist/dataParser/extended/record.d.ts +12 -0
  106. package/dist/dataParser/extended/record.mjs +9 -0
  107. package/dist/dataParser/extended/string.cjs +38 -0
  108. package/dist/dataParser/extended/string.d.ts +32 -0
  109. package/dist/dataParser/extended/string.mjs +34 -0
  110. package/dist/dataParser/extended/templateLiteral.cjs +10 -0
  111. package/dist/dataParser/extended/templateLiteral.d.ts +11 -0
  112. package/dist/dataParser/extended/templateLiteral.mjs +8 -0
  113. package/dist/dataParser/extended/transform.cjs +11 -0
  114. package/dist/dataParser/extended/transform.d.ts +14 -0
  115. package/dist/dataParser/extended/transform.mjs +9 -0
  116. package/dist/dataParser/extended/tuple.cjs +11 -0
  117. package/dist/dataParser/extended/tuple.d.ts +11 -0
  118. package/dist/dataParser/extended/tuple.mjs +9 -0
  119. package/dist/dataParser/extended/union.cjs +11 -0
  120. package/dist/dataParser/extended/union.d.ts +11 -0
  121. package/dist/dataParser/extended/union.mjs +9 -0
  122. package/dist/dataParser/extended/unknown.cjs +11 -0
  123. package/dist/dataParser/extended/unknown.d.ts +9 -0
  124. package/dist/dataParser/extended/unknown.mjs +9 -0
  125. package/dist/dataParser/index.cjs +128 -0
  126. package/dist/dataParser/index.d.ts +6 -0
  127. package/dist/dataParser/index.mjs +38 -0
  128. package/dist/dataParser/parsers/array/checkers/index.d.ts +2 -0
  129. package/dist/dataParser/parsers/array/checkers/max.cjs +23 -0
  130. package/dist/dataParser/parsers/array/checkers/max.d.ts +11 -0
  131. package/dist/dataParser/parsers/array/checkers/max.mjs +20 -0
  132. package/dist/dataParser/parsers/array/checkers/min.cjs +23 -0
  133. package/dist/dataParser/parsers/array/checkers/min.d.ts +11 -0
  134. package/dist/dataParser/parsers/array/checkers/min.mjs +20 -0
  135. package/dist/dataParser/parsers/array/index.cjs +64 -0
  136. package/dist/dataParser/parsers/array/index.d.ts +20 -0
  137. package/dist/dataParser/parsers/array/index.mjs +61 -0
  138. package/dist/dataParser/parsers/bigint/checkers/index.d.ts +2 -0
  139. package/dist/dataParser/parsers/bigint/checkers/max.cjs +23 -0
  140. package/dist/dataParser/parsers/bigint/checkers/max.d.ts +11 -0
  141. package/dist/dataParser/parsers/bigint/checkers/max.mjs +20 -0
  142. package/dist/dataParser/parsers/bigint/checkers/min.cjs +23 -0
  143. package/dist/dataParser/parsers/bigint/checkers/min.d.ts +11 -0
  144. package/dist/dataParser/parsers/bigint/checkers/min.mjs +20 -0
  145. package/dist/dataParser/parsers/bigint/index.cjs +31 -0
  146. package/dist/dataParser/parsers/bigint/index.d.ts +18 -0
  147. package/dist/dataParser/parsers/bigint/index.mjs +28 -0
  148. package/dist/dataParser/parsers/boolean.cjs +40 -0
  149. package/dist/dataParser/parsers/boolean.d.ts +12 -0
  150. package/dist/dataParser/parsers/boolean.mjs +37 -0
  151. package/dist/dataParser/parsers/coerce/bigint.cjs +13 -0
  152. package/dist/dataParser/parsers/coerce/bigint.d.ts +6 -0
  153. package/dist/dataParser/parsers/coerce/bigint.mjs +11 -0
  154. package/dist/dataParser/parsers/coerce/boolean.cjs +13 -0
  155. package/dist/dataParser/parsers/coerce/boolean.d.ts +6 -0
  156. package/dist/dataParser/parsers/coerce/boolean.mjs +11 -0
  157. package/dist/dataParser/parsers/coerce/empty.cjs +13 -0
  158. package/dist/dataParser/parsers/coerce/empty.d.ts +6 -0
  159. package/dist/dataParser/parsers/coerce/empty.mjs +11 -0
  160. package/dist/dataParser/parsers/coerce/index.cjs +17 -0
  161. package/dist/dataParser/parsers/coerce/index.d.ts +6 -0
  162. package/dist/dataParser/parsers/coerce/index.mjs +6 -0
  163. package/dist/dataParser/parsers/coerce/nil.cjs +13 -0
  164. package/dist/dataParser/parsers/coerce/nil.d.ts +6 -0
  165. package/dist/dataParser/parsers/coerce/nil.mjs +11 -0
  166. package/dist/dataParser/parsers/coerce/number.cjs +13 -0
  167. package/dist/dataParser/parsers/coerce/number.d.ts +6 -0
  168. package/dist/dataParser/parsers/coerce/number.mjs +11 -0
  169. package/dist/dataParser/parsers/coerce/string.cjs +13 -0
  170. package/dist/dataParser/parsers/coerce/string.d.ts +6 -0
  171. package/dist/dataParser/parsers/coerce/string.mjs +11 -0
  172. package/dist/dataParser/parsers/empty.cjs +27 -0
  173. package/dist/dataParser/parsers/empty.d.ts +12 -0
  174. package/dist/dataParser/parsers/empty.mjs +24 -0
  175. package/dist/dataParser/parsers/index.d.ts +20 -0
  176. package/dist/dataParser/parsers/lazy.cjs +21 -0
  177. package/dist/dataParser/parsers/lazy.d.ts +14 -0
  178. package/dist/dataParser/parsers/lazy.mjs +18 -0
  179. package/dist/dataParser/parsers/literal.cjs +25 -0
  180. package/dist/dataParser/parsers/literal.d.ts +15 -0
  181. package/dist/dataParser/parsers/literal.mjs +22 -0
  182. package/dist/dataParser/parsers/nil.cjs +27 -0
  183. package/dist/dataParser/parsers/nil.d.ts +12 -0
  184. package/dist/dataParser/parsers/nil.mjs +24 -0
  185. package/dist/dataParser/parsers/nullable.cjs +31 -0
  186. package/dist/dataParser/parsers/nullable.d.ts +14 -0
  187. package/dist/dataParser/parsers/nullable.mjs +28 -0
  188. package/dist/dataParser/parsers/number/checkers/index.d.ts +3 -0
  189. package/dist/dataParser/parsers/number/checkers/int.cjs +27 -0
  190. package/dist/dataParser/parsers/number/checkers/int.d.ts +15 -0
  191. package/dist/dataParser/parsers/number/checkers/int.mjs +23 -0
  192. package/dist/dataParser/parsers/number/checkers/max.cjs +18 -0
  193. package/dist/dataParser/parsers/number/checkers/max.d.ts +11 -0
  194. package/dist/dataParser/parsers/number/checkers/max.mjs +15 -0
  195. package/dist/dataParser/parsers/number/checkers/min.cjs +18 -0
  196. package/dist/dataParser/parsers/number/checkers/min.d.ts +11 -0
  197. package/dist/dataParser/parsers/number/checkers/min.mjs +15 -0
  198. package/dist/dataParser/parsers/number/index.cjs +31 -0
  199. package/dist/dataParser/parsers/number/index.d.ts +18 -0
  200. package/dist/dataParser/parsers/number/index.mjs +28 -0
  201. package/dist/dataParser/parsers/object.cjs +74 -0
  202. package/dist/dataParser/parsers/object.d.ts +26 -0
  203. package/dist/dataParser/parsers/object.mjs +71 -0
  204. package/dist/dataParser/parsers/optional.cjs +31 -0
  205. package/dist/dataParser/parsers/optional.d.ts +14 -0
  206. package/dist/dataParser/parsers/optional.mjs +28 -0
  207. package/dist/dataParser/parsers/pipe.cjs +34 -0
  208. package/dist/dataParser/parsers/pipe.d.ts +16 -0
  209. package/dist/dataParser/parsers/pipe.mjs +31 -0
  210. package/dist/dataParser/parsers/record.cjs +83 -0
  211. package/dist/dataParser/parsers/record.d.ts +30 -0
  212. package/dist/dataParser/parsers/record.mjs +80 -0
  213. package/dist/dataParser/parsers/string/checkers/email.cjs +31 -0
  214. package/dist/dataParser/parsers/string/checkers/email.d.ts +17 -0
  215. package/dist/dataParser/parsers/string/checkers/email.mjs +27 -0
  216. package/dist/dataParser/parsers/string/checkers/index.d.ts +5 -0
  217. package/dist/dataParser/parsers/string/checkers/max.cjs +18 -0
  218. package/dist/dataParser/parsers/string/checkers/max.d.ts +11 -0
  219. package/dist/dataParser/parsers/string/checkers/max.mjs +15 -0
  220. package/dist/dataParser/parsers/string/checkers/min.cjs +18 -0
  221. package/dist/dataParser/parsers/string/checkers/min.d.ts +11 -0
  222. package/dist/dataParser/parsers/string/checkers/min.mjs +15 -0
  223. package/dist/dataParser/parsers/string/checkers/regex.cjs +20 -0
  224. package/dist/dataParser/parsers/string/checkers/regex.d.ts +11 -0
  225. package/dist/dataParser/parsers/string/checkers/regex.mjs +17 -0
  226. package/dist/dataParser/parsers/string/checkers/url.cjs +48 -0
  227. package/dist/dataParser/parsers/string/checkers/url.d.ts +18 -0
  228. package/dist/dataParser/parsers/string/checkers/url.mjs +44 -0
  229. package/dist/dataParser/parsers/string/index.cjs +31 -0
  230. package/dist/dataParser/parsers/string/index.d.ts +18 -0
  231. package/dist/dataParser/parsers/string/index.mjs +28 -0
  232. package/dist/dataParser/parsers/templateLiteral.cjs +45 -0
  233. package/dist/dataParser/parsers/templateLiteral.d.ts +49 -0
  234. package/dist/dataParser/parsers/templateLiteral.mjs +42 -0
  235. package/dist/dataParser/parsers/transform.cjs +43 -0
  236. package/dist/dataParser/parsers/transform.d.ts +17 -0
  237. package/dist/dataParser/parsers/transform.mjs +40 -0
  238. package/dist/dataParser/parsers/tuple.cjs +83 -0
  239. package/dist/dataParser/parsers/tuple.d.ts +33 -0
  240. package/dist/dataParser/parsers/tuple.mjs +80 -0
  241. package/dist/dataParser/parsers/union.cjs +38 -0
  242. package/dist/dataParser/parsers/union.d.ts +15 -0
  243. package/dist/dataParser/parsers/union.mjs +35 -0
  244. package/dist/dataParser/parsers/unknown.cjs +17 -0
  245. package/dist/dataParser/parsers/unknown.d.ts +11 -0
  246. package/dist/dataParser/parsers/unknown.mjs +14 -0
  247. package/dist/dataParser/types/addCheckersToDefinition.d.ts +5 -0
  248. package/dist/dataParser/types/checkers.d.ts +3 -0
  249. package/dist/dataParser/types/dataParsers.d.ts +5 -0
  250. package/dist/dataParser/types/index.d.ts +4 -0
  251. package/dist/dataParser/types/mergeDefinition.d.ts +5 -0
  252. package/dist/either/bool/falsy.cjs +1 -1
  253. package/dist/either/bool/falsy.mjs +1 -1
  254. package/dist/either/bool/truthy.cjs +1 -1
  255. package/dist/either/bool/truthy.mjs +1 -1
  256. package/dist/either/future/error.cjs +1 -1
  257. package/dist/either/future/error.mjs +1 -1
  258. package/dist/either/future/success.cjs +1 -1
  259. package/dist/either/future/success.mjs +1 -1
  260. package/dist/either/left/create.cjs +1 -1
  261. package/dist/either/left/create.mjs +1 -1
  262. package/dist/either/left/error.cjs +1 -1
  263. package/dist/either/left/error.mjs +1 -1
  264. package/dist/either/left/fail.cjs +1 -1
  265. package/dist/either/left/fail.mjs +1 -1
  266. package/dist/either/nullable/empty.cjs +1 -1
  267. package/dist/either/nullable/empty.mjs +1 -1
  268. package/dist/either/nullable/filled.cjs +1 -1
  269. package/dist/either/nullable/filled.mjs +1 -1
  270. package/dist/either/nullish/empty.cjs +1 -1
  271. package/dist/either/nullish/empty.mjs +1 -1
  272. package/dist/either/nullish/filled.cjs +1 -1
  273. package/dist/either/nullish/filled.mjs +1 -1
  274. package/dist/either/optional/empty.cjs +1 -1
  275. package/dist/either/optional/empty.mjs +1 -1
  276. package/dist/either/optional/filled.cjs +1 -1
  277. package/dist/either/optional/filled.mjs +1 -1
  278. package/dist/either/right/asyncPipe.d.ts +2 -2
  279. package/dist/either/right/create.cjs +1 -1
  280. package/dist/either/right/create.mjs +1 -1
  281. package/dist/either/right/ok.cjs +1 -1
  282. package/dist/either/right/ok.mjs +1 -1
  283. package/dist/either/right/success.cjs +1 -1
  284. package/dist/either/right/success.mjs +1 -1
  285. package/dist/generator/reduce.cjs +1 -1
  286. package/dist/generator/reduce.mjs +1 -1
  287. package/dist/index.cjs +14 -0
  288. package/dist/index.d.ts +6 -0
  289. package/dist/index.mjs +12 -1
  290. package/dist/object/fromEntries.d.ts +1 -1
  291. package/dist/object/types/getPropsWithValueExtends.d.ts +1 -1
  292. package/dist/pattern/result.cjs +1 -1
  293. package/dist/pattern/result.mjs +1 -1
  294. package/package.json +57 -1
@@ -0,0 +1,83 @@
1
+ 'use strict';
2
+
3
+ var kind = require('../../common/kind.cjs');
4
+ var base = require('../base.cjs');
5
+ var error = require('../error.cjs');
6
+
7
+ const dataParserTupleKind = kind.createKind("data-parser-tuple");
8
+ function tuple(shape, definition) {
9
+ return base.dataParserInit(dataParserTupleKind, {
10
+ definition: {
11
+ errorMessage: definition?.errorMessage,
12
+ checkers: definition?.checkers ?? [],
13
+ rest: definition?.rest,
14
+ shape,
15
+ },
16
+ }, {
17
+ sync: (data, error$1, self) => {
18
+ if (!(data instanceof Array)) {
19
+ return error.SymbolDataParserErrorIssue;
20
+ }
21
+ let output = [];
22
+ const currentIndexPath = error$1.currentPath.length;
23
+ for (let index = 0; index < self.definition.shape.length; index++) {
24
+ error.setErrorPath(error$1, `[${index}]`, currentIndexPath);
25
+ const result = self.definition.shape[index]?.exec(data[index], error$1);
26
+ if (result === base.SymbolDataParserError) {
27
+ output = base.SymbolDataParserError;
28
+ }
29
+ else if (output !== base.SymbolDataParserError) {
30
+ output.push(result);
31
+ }
32
+ }
33
+ if (self.definition.rest) {
34
+ for (let index = self.definition.shape.length; index < data.length; index++) {
35
+ error.setErrorPath(error$1, `[${index}]`, currentIndexPath);
36
+ const result = self.definition.rest.exec(data[index], error$1);
37
+ if (result === base.SymbolDataParserError) {
38
+ output = base.SymbolDataParserError;
39
+ }
40
+ else if (output !== base.SymbolDataParserError) {
41
+ output.push(result);
42
+ }
43
+ }
44
+ }
45
+ error.popErrorPath(error$1);
46
+ return output;
47
+ },
48
+ async: async (data, error$1, self) => {
49
+ if (!(data instanceof Array)) {
50
+ return error.SymbolDataParserErrorIssue;
51
+ }
52
+ let output = [];
53
+ const currentIndexPath = error$1.currentPath.length;
54
+ for (let index = 0; index < self.definition.shape.length; index++) {
55
+ error.setErrorPath(error$1, `[${index}]`, currentIndexPath);
56
+ const result = await self.definition.shape[index]?.asyncExec(data[index], error$1);
57
+ if (result === base.SymbolDataParserError) {
58
+ output = base.SymbolDataParserError;
59
+ }
60
+ else if (output !== base.SymbolDataParserError) {
61
+ output.push(result);
62
+ }
63
+ }
64
+ if (self.definition?.rest) {
65
+ for (let index = self.definition.shape.length; index < data.length; index++) {
66
+ error.setErrorPath(error$1, `[${index}]`, currentIndexPath);
67
+ const result = await self.definition.rest.asyncExec(data[index], error$1);
68
+ if (result === base.SymbolDataParserError) {
69
+ output = base.SymbolDataParserError;
70
+ }
71
+ else if (output !== base.SymbolDataParserError) {
72
+ output.push(result);
73
+ }
74
+ }
75
+ }
76
+ error.popErrorPath(error$1);
77
+ return output;
78
+ },
79
+ });
80
+ }
81
+
82
+ exports.dataParserTupleKind = dataParserTupleKind;
83
+ exports.tuple = tuple;
@@ -0,0 +1,33 @@
1
+ import { type UnionContain, type IsEqual, type Kind, type Adaptor, type NeverCoalescing } from "../../common";
2
+ import { type DataParserDefinition, type DataParser, type Output, type Input } from "../base";
3
+ import { type AddCheckersToDefinition, type DataParsers, type MergeDefinition } from "../../dataParser/types";
4
+ import { type DataParserCheckerArrayMax, type DataParserCheckerArrayMin } from "./array";
5
+ export type TupleShape = readonly [DataParsers, ...DataParsers[]];
6
+ export type DataParserTupleShapeOutput<GenericShape extends TupleShape, GenericRest extends DataParsers | undefined> = IsEqual<GenericShape, TupleShape> extends true ? TupleShape : GenericShape extends [
7
+ infer InferredFirst extends DataParsers,
8
+ ...infer InferredRest extends DataParsers[]
9
+ ] ? [
10
+ Output<InferredFirst>,
11
+ ...(InferredRest extends TupleShape ? DataParserTupleShapeOutput<InferredRest, GenericRest> : UnionContain<GenericRest, undefined> extends true ? [] : Output<Adaptor<GenericRest, DataParser>>[])
12
+ ] : never;
13
+ export type DataParserTupleShapeInput<GenericShape extends TupleShape, GenericRest extends DataParsers | undefined> = IsEqual<GenericShape, TupleShape> extends true ? TupleShape : GenericShape extends [
14
+ infer InferredFirst extends DataParsers,
15
+ ...infer InferredRest extends DataParsers[]
16
+ ] ? [
17
+ Input<InferredFirst>,
18
+ ...(InferredRest extends TupleShape ? DataParserTupleShapeOutput<InferredRest, GenericRest> : UnionContain<GenericRest, undefined> extends true ? [] : Input<Adaptor<GenericRest, DataParser>>[])
19
+ ] : never;
20
+ export type DataParserTupleCheckers = (DataParserCheckerArrayMin | DataParserCheckerArrayMax);
21
+ export interface DataParserDefinitionTuple extends DataParserDefinition<DataParserTupleCheckers> {
22
+ readonly shape: TupleShape;
23
+ readonly rest?: DataParsers;
24
+ }
25
+ export declare const dataParserTupleKind: import("../../common").KindHandler<import("../../common").KindDefinition<"data-parser-tuple", unknown>>;
26
+ type _DataParserTuple<GenericDefinition extends DataParserDefinitionTuple> = (DataParser<GenericDefinition, DataParserTupleShapeOutput<GenericDefinition["shape"], GenericDefinition["rest"]>, DataParserTupleShapeInput<GenericDefinition["shape"], GenericDefinition["rest"]>> & Kind<typeof dataParserTupleKind.definition>);
27
+ export interface DataParserTuple<GenericDefinition extends DataParserDefinitionTuple = DataParserDefinitionTuple> extends _DataParserTuple<GenericDefinition> {
28
+ addChecker<GenericChecker extends [DataParserTupleCheckers, ...DataParserTupleCheckers[]]>(...args: GenericChecker): DataParserTuple<AddCheckersToDefinition<GenericDefinition, GenericChecker>>;
29
+ }
30
+ export declare function tuple<GenericShape extends TupleShape, const GenericDefinition extends Partial<Omit<DataParserDefinitionTuple, "shape">> = never>(shape: GenericShape, definition?: GenericDefinition): DataParserTuple<MergeDefinition<DataParserDefinitionTuple, NeverCoalescing<GenericDefinition, {}> & {
31
+ shape: GenericShape;
32
+ }>>;
33
+ export {};
@@ -0,0 +1,80 @@
1
+ import { createKind } from '../../common/kind.mjs';
2
+ import { dataParserInit, SymbolDataParserError } from '../base.mjs';
3
+ import { SymbolDataParserErrorIssue, setErrorPath, popErrorPath } from '../error.mjs';
4
+
5
+ const dataParserTupleKind = createKind("data-parser-tuple");
6
+ function tuple(shape, definition) {
7
+ return dataParserInit(dataParserTupleKind, {
8
+ definition: {
9
+ errorMessage: definition?.errorMessage,
10
+ checkers: definition?.checkers ?? [],
11
+ rest: definition?.rest,
12
+ shape,
13
+ },
14
+ }, {
15
+ sync: (data, error, self) => {
16
+ if (!(data instanceof Array)) {
17
+ return SymbolDataParserErrorIssue;
18
+ }
19
+ let output = [];
20
+ const currentIndexPath = error.currentPath.length;
21
+ for (let index = 0; index < self.definition.shape.length; index++) {
22
+ setErrorPath(error, `[${index}]`, currentIndexPath);
23
+ const result = self.definition.shape[index]?.exec(data[index], error);
24
+ if (result === SymbolDataParserError) {
25
+ output = SymbolDataParserError;
26
+ }
27
+ else if (output !== SymbolDataParserError) {
28
+ output.push(result);
29
+ }
30
+ }
31
+ if (self.definition.rest) {
32
+ for (let index = self.definition.shape.length; index < data.length; index++) {
33
+ setErrorPath(error, `[${index}]`, currentIndexPath);
34
+ const result = self.definition.rest.exec(data[index], error);
35
+ if (result === SymbolDataParserError) {
36
+ output = SymbolDataParserError;
37
+ }
38
+ else if (output !== SymbolDataParserError) {
39
+ output.push(result);
40
+ }
41
+ }
42
+ }
43
+ popErrorPath(error);
44
+ return output;
45
+ },
46
+ async: async (data, error, self) => {
47
+ if (!(data instanceof Array)) {
48
+ return SymbolDataParserErrorIssue;
49
+ }
50
+ let output = [];
51
+ const currentIndexPath = error.currentPath.length;
52
+ for (let index = 0; index < self.definition.shape.length; index++) {
53
+ setErrorPath(error, `[${index}]`, currentIndexPath);
54
+ const result = await self.definition.shape[index]?.asyncExec(data[index], error);
55
+ if (result === SymbolDataParserError) {
56
+ output = SymbolDataParserError;
57
+ }
58
+ else if (output !== SymbolDataParserError) {
59
+ output.push(result);
60
+ }
61
+ }
62
+ if (self.definition?.rest) {
63
+ for (let index = self.definition.shape.length; index < data.length; index++) {
64
+ setErrorPath(error, `[${index}]`, currentIndexPath);
65
+ const result = await self.definition.rest.asyncExec(data[index], error);
66
+ if (result === SymbolDataParserError) {
67
+ output = SymbolDataParserError;
68
+ }
69
+ else if (output !== SymbolDataParserError) {
70
+ output.push(result);
71
+ }
72
+ }
73
+ }
74
+ popErrorPath(error);
75
+ return output;
76
+ },
77
+ });
78
+ }
79
+
80
+ export { dataParserTupleKind, tuple };
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ var kind = require('../../common/kind.cjs');
4
+ var base = require('../base.cjs');
5
+ var error = require('../error.cjs');
6
+
7
+ const dataParserUnionKind = kind.createKind("data-parser-union");
8
+ function union(options, definition) {
9
+ return base.dataParserInit(dataParserUnionKind, {
10
+ definition: {
11
+ errorMessage: definition?.errorMessage,
12
+ checkers: definition?.checkers ?? [],
13
+ options,
14
+ },
15
+ }, {
16
+ sync: (data, error$1, self) => {
17
+ for (const dataParser of self.definition.options) {
18
+ const result = dataParser.exec(data, error$1);
19
+ if (result !== base.SymbolDataParserError) {
20
+ return result;
21
+ }
22
+ }
23
+ return error.SymbolDataParserErrorIssue;
24
+ },
25
+ async: async (data, error$1, self) => {
26
+ for (const dataParser of self.definition.options) {
27
+ const result = await dataParser.asyncExec(data, error$1);
28
+ if (result !== base.SymbolDataParserError) {
29
+ return result;
30
+ }
31
+ }
32
+ return error.SymbolDataParserErrorIssue;
33
+ },
34
+ });
35
+ }
36
+
37
+ exports.dataParserUnionKind = dataParserUnionKind;
38
+ exports.union = union;
@@ -0,0 +1,15 @@
1
+ import { type NeverCoalescing, type Kind } from "../../common";
2
+ import { type DataParserDefinition, type DataParser, type Output, type Input } from "../base";
3
+ import { type DataParsers, type MergeDefinition } from "../../dataParser/types";
4
+ export type UnionOptions = readonly [DataParsers, ...DataParsers[]];
5
+ export interface DataParserDefinitionUnion extends DataParserDefinition<never> {
6
+ readonly options: UnionOptions;
7
+ }
8
+ export declare const dataParserUnionKind: import("../../common").KindHandler<import("../../common").KindDefinition<"data-parser-union", unknown>>;
9
+ type _DataParserUnion<GenericDefinition extends DataParserDefinitionUnion> = (DataParser<GenericDefinition, Output<GenericDefinition["options"][number]>, Input<GenericDefinition["options"][number]>> & Kind<typeof dataParserUnionKind.definition>);
10
+ export interface DataParserUnion<GenericDefinition extends DataParserDefinitionUnion = DataParserDefinitionUnion> extends _DataParserUnion<GenericDefinition> {
11
+ }
12
+ export declare function union<GenericOptions extends UnionOptions, const GenericDefinition extends Partial<Omit<DataParserDefinitionUnion, "options">> = never>(options: GenericOptions, definition?: GenericDefinition): DataParserUnion<MergeDefinition<DataParserDefinitionUnion, NeverCoalescing<GenericDefinition, {}> & {
13
+ options: GenericOptions;
14
+ }>>;
15
+ export {};
@@ -0,0 +1,35 @@
1
+ import { createKind } from '../../common/kind.mjs';
2
+ import { dataParserInit, SymbolDataParserError } from '../base.mjs';
3
+ import { SymbolDataParserErrorIssue } from '../error.mjs';
4
+
5
+ const dataParserUnionKind = createKind("data-parser-union");
6
+ function union(options, definition) {
7
+ return dataParserInit(dataParserUnionKind, {
8
+ definition: {
9
+ errorMessage: definition?.errorMessage,
10
+ checkers: definition?.checkers ?? [],
11
+ options,
12
+ },
13
+ }, {
14
+ sync: (data, error, self) => {
15
+ for (const dataParser of self.definition.options) {
16
+ const result = dataParser.exec(data, error);
17
+ if (result !== SymbolDataParserError) {
18
+ return result;
19
+ }
20
+ }
21
+ return SymbolDataParserErrorIssue;
22
+ },
23
+ async: async (data, error, self) => {
24
+ for (const dataParser of self.definition.options) {
25
+ const result = await dataParser.asyncExec(data, error);
26
+ if (result !== SymbolDataParserError) {
27
+ return result;
28
+ }
29
+ }
30
+ return SymbolDataParserErrorIssue;
31
+ },
32
+ });
33
+ }
34
+
35
+ export { dataParserUnionKind, union };
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var kind = require('../../common/kind.cjs');
4
+ var base = require('../base.cjs');
5
+
6
+ const dataParserUnknownKind = kind.createKind("data-parser-unknown");
7
+ function unknown(definition) {
8
+ return base.dataParserInit(dataParserUnknownKind, {
9
+ definition: {
10
+ errorMessage: definition?.errorMessage,
11
+ checkers: definition?.checkers ?? [],
12
+ },
13
+ }, (data) => data);
14
+ }
15
+
16
+ exports.dataParserUnknownKind = dataParserUnknownKind;
17
+ exports.unknown = unknown;
@@ -0,0 +1,11 @@
1
+ import { type NeverCoalescing, type Kind } from "../../common";
2
+ import { type DataParserDefinition, type DataParser } from "../base";
3
+ import { type MergeDefinition } from "../../dataParser/types";
4
+ export interface DataParserDefinitionUnknown extends DataParserDefinition<never> {
5
+ }
6
+ export declare const dataParserUnknownKind: import("../../common").KindHandler<import("../../common").KindDefinition<"data-parser-unknown", unknown>>;
7
+ type _DataParserUnknown<GenericDefinition extends DataParserDefinitionUnknown> = (DataParser<GenericDefinition, unknown, unknown> & Kind<typeof dataParserUnknownKind.definition>);
8
+ export interface DataParserUnknown<GenericDefinition extends DataParserDefinitionUnknown = DataParserDefinitionUnknown> extends _DataParserUnknown<GenericDefinition> {
9
+ }
10
+ export declare function unknown<const GenericDefinition extends Partial<DataParserDefinitionUnknown> = never>(definition?: GenericDefinition): DataParserUnknown<MergeDefinition<DataParserDefinitionUnknown, NeverCoalescing<GenericDefinition, {}>>>;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { createKind } from '../../common/kind.mjs';
2
+ import { dataParserInit } from '../base.mjs';
3
+
4
+ const dataParserUnknownKind = createKind("data-parser-unknown");
5
+ function unknown(definition) {
6
+ return dataParserInit(dataParserUnknownKind, {
7
+ definition: {
8
+ errorMessage: definition?.errorMessage,
9
+ checkers: definition?.checkers ?? [],
10
+ },
11
+ }, (data) => data);
12
+ }
13
+
14
+ export { dataParserUnknownKind, unknown };
@@ -0,0 +1,5 @@
1
+ import { type AnyTuple, type SimplifyTopLevel } from "../../common";
2
+ import { type DataParserChecker, type DataParserDefinition } from "../base";
3
+ export type AddCheckersToDefinition<GenericDefinition extends DataParserDefinition, GenericChecker extends readonly [DataParserChecker, ...DataParserChecker[]]> = SimplifyTopLevel<Omit<GenericDefinition, "checkers"> & {
4
+ readonly checkers: GenericDefinition["checkers"] extends AnyTuple ? readonly [...GenericDefinition["checkers"], ...GenericChecker] : GenericChecker;
5
+ }>;
@@ -0,0 +1,3 @@
1
+ import { type DataParserChecker } from "../base";
2
+ import type * as AllDataParser from "../parsers";
3
+ export type Checkers = (DataParserChecker | AllDataParser.DataParserCheckerUrl | AllDataParser.DataParserCheckerArrayMax | AllDataParser.DataParserCheckerArrayMin | AllDataParser.DataParserCheckerBigIntMax | AllDataParser.DataParserCheckerBigIntMin | AllDataParser.DataParserCheckerNumberMax | AllDataParser.DataParserCheckerNumberMin | AllDataParser.DataParserCheckerInt | AllDataParser.DataParserCheckerEmail);
@@ -0,0 +1,5 @@
1
+ import { type DataParser } from "../base";
2
+ import type * as AllDataParser from "../parsers";
3
+ export interface DataParserCustom {
4
+ }
5
+ export type DataParsers = (DataParserCustom[keyof DataParserCustom] | DataParser | AllDataParser.DataParserString | AllDataParser.DataParserObject | AllDataParser.DataParserNumber | AllDataParser.DataParserLiteral | AllDataParser.DataParserUnion | AllDataParser.DataParserArray | AllDataParser.DataParserBigInt | AllDataParser.DataParserTuple | AllDataParser.DataParserTransform | AllDataParser.DataParserBoolean | AllDataParser.DataParserNil | AllDataParser.DataParserEmpty | AllDataParser.DataParserTemplateLiteral | AllDataParser.DataParserPipe | AllDataParser.DataParserNullable | AllDataParser.DataParserOptional | AllDataParser.DataParserLazy | AllDataParser.DataParserUnknown | AllDataParser.DataParserRecord);
@@ -0,0 +1,4 @@
1
+ export * from "./mergeDefinition";
2
+ export * from "./dataParsers";
3
+ export * from "./checkers";
4
+ export * from "./addCheckersToDefinition";
@@ -0,0 +1,5 @@
1
+ import { type UnionContain, type SimplifyTopLevel } from "../../common";
2
+ import { type DataParserCheckerDefinition, type DataParserDefinition } from "../base";
3
+ export type MergeDefinition<GenericDefinition extends DataParserDefinition | DataParserCheckerDefinition, GenericPartialDefinition extends Partial<GenericDefinition>> = SimplifyTopLevel<Readonly<GenericPartialDefinition & Omit<GenericDefinition, keyof GenericPartialDefinition | "checkers"> & (UnionContain<keyof GenericPartialDefinition, "checkers"> extends true ? {} : {
4
+ checkers: readonly [];
5
+ })>> extends infer InferredResult extends GenericDefinition ? InferredResult : never;
@@ -10,7 +10,7 @@ var base = require('./base.cjs');
10
10
 
11
11
  const eitherBoolFalsyKind = kind.createKind("either-bool-falsy");
12
12
  function boolFalsy(value = undefined) {
13
- return base.eitherBoolKind.addTo(eitherBoolFalsyKind.addTo(create.left("bool", value)));
13
+ return base.eitherBoolKind.setTo(eitherBoolFalsyKind.setTo(create.left("bool", value)));
14
14
  }
15
15
  function isBoolFalsy(input) {
16
16
  return is.isLeft(input)
@@ -8,7 +8,7 @@ import { eitherBoolKind } from './base.mjs';
8
8
 
9
9
  const eitherBoolFalsyKind = createKind("either-bool-falsy");
10
10
  function boolFalsy(value = undefined) {
11
- return eitherBoolKind.addTo(eitherBoolFalsyKind.addTo(left("bool", value)));
11
+ return eitherBoolKind.setTo(eitherBoolFalsyKind.setTo(left("bool", value)));
12
12
  }
13
13
  function isBoolFalsy(input) {
14
14
  return isLeft(input)
@@ -10,7 +10,7 @@ var base = require('./base.cjs');
10
10
 
11
11
  const eitherBoolTruthyKind = kind.createKind("either-bool-truthy");
12
12
  function boolTruthy(value) {
13
- return base.eitherBoolKind.addTo(eitherBoolTruthyKind.addTo(create.right("bool", value)));
13
+ return base.eitherBoolKind.setTo(eitherBoolTruthyKind.setTo(create.right("bool", value)));
14
14
  }
15
15
  function isBoolTruthy(input) {
16
16
  return is.isRight(input)
@@ -8,7 +8,7 @@ import { eitherBoolKind } from './base.mjs';
8
8
 
9
9
  const eitherBoolTruthyKind = createKind("either-bool-truthy");
10
10
  function boolTruthy(value) {
11
- return eitherBoolKind.addTo(eitherBoolTruthyKind.addTo(right("bool", value)));
11
+ return eitherBoolKind.setTo(eitherBoolTruthyKind.setTo(right("bool", value)));
12
12
  }
13
13
  function isBoolTruthy(input) {
14
14
  return isRight(input)
@@ -6,7 +6,7 @@ var base = require('./base.cjs');
6
6
 
7
7
  const eitherFutureErrorKind = kind.createKind("either-future-error");
8
8
  function futureError(value) {
9
- return base.eitherFutureKind.addTo(eitherFutureErrorKind.addTo(create.left("future", value)));
9
+ return base.eitherFutureKind.setTo(eitherFutureErrorKind.setTo(create.left("future", value)));
10
10
  }
11
11
 
12
12
  exports.eitherFutureErrorKind = eitherFutureErrorKind;
@@ -4,7 +4,7 @@ import { eitherFutureKind } from './base.mjs';
4
4
 
5
5
  const eitherFutureErrorKind = createKind("either-future-error");
6
6
  function futureError(value) {
7
- return eitherFutureKind.addTo(eitherFutureErrorKind.addTo(left("future", value)));
7
+ return eitherFutureKind.setTo(eitherFutureErrorKind.setTo(left("future", value)));
8
8
  }
9
9
 
10
10
  export { eitherFutureErrorKind, futureError };
@@ -6,7 +6,7 @@ var create = require('../right/create.cjs');
6
6
 
7
7
  const eitherFutureSuccessKind = kind.createKind("either-future-success");
8
8
  function futureSuccess(value) {
9
- return base.eitherFutureKind.addTo(eitherFutureSuccessKind.addTo(create.right("future", value)));
9
+ return base.eitherFutureKind.setTo(eitherFutureSuccessKind.setTo(create.right("future", value)));
10
10
  }
11
11
 
12
12
  exports.eitherFutureSuccessKind = eitherFutureSuccessKind;
@@ -4,7 +4,7 @@ import { right } from '../right/create.mjs';
4
4
 
5
5
  const eitherFutureSuccessKind = createKind("either-future-success");
6
6
  function futureSuccess(value) {
7
- return eitherFutureKind.addTo(eitherFutureSuccessKind.addTo(right("future", value)));
7
+ return eitherFutureKind.setTo(eitherFutureSuccessKind.setTo(right("future", value)));
8
8
  }
9
9
 
10
10
  export { eitherFutureSuccessKind, futureSuccess };
@@ -6,7 +6,7 @@ var base = require('../base.cjs');
6
6
 
7
7
  const eitherLeftKind = kind.createKind("either-left");
8
8
  function left(information, value = undefined) {
9
- return eitherLeftKind.addTo(base.eitherInformationKind.addTo(wrapValue.wrapValue(value), information));
9
+ return eitherLeftKind.setTo(base.eitherInformationKind.setTo(wrapValue.wrapValue(value), information));
10
10
  }
11
11
 
12
12
  exports.eitherLeftKind = eitherLeftKind;
@@ -4,7 +4,7 @@ import { eitherInformationKind } from '../base.mjs';
4
4
 
5
5
  const eitherLeftKind = createKind("either-left");
6
6
  function left(information, value = undefined) {
7
- return eitherLeftKind.addTo(eitherInformationKind.addTo(wrapValue(value), information));
7
+ return eitherLeftKind.setTo(eitherInformationKind.setTo(wrapValue(value), information));
8
8
  }
9
9
 
10
10
  export { eitherLeftKind, left };
@@ -5,7 +5,7 @@ var create = require('./create.cjs');
5
5
 
6
6
  const eitherErrorKind = kind.createKind("either-error");
7
7
  function error(value) {
8
- return eitherErrorKind.addTo(create.left("error", value));
8
+ return eitherErrorKind.setTo(create.left("error", value));
9
9
  }
10
10
 
11
11
  exports.eitherErrorKind = eitherErrorKind;
@@ -3,7 +3,7 @@ import { left } from './create.mjs';
3
3
 
4
4
  const eitherErrorKind = createKind("either-error");
5
5
  function error(value) {
6
- return eitherErrorKind.addTo(left("error", value));
6
+ return eitherErrorKind.setTo(left("error", value));
7
7
  }
8
8
 
9
9
  export { eitherErrorKind, error };
@@ -5,7 +5,7 @@ var create = require('./create.cjs');
5
5
 
6
6
  const eitherFailKind = kind.createKind("either-fail");
7
7
  function fail() {
8
- return eitherFailKind.addTo(create.left("fail", undefined));
8
+ return eitherFailKind.setTo(create.left("fail", undefined));
9
9
  }
10
10
 
11
11
  exports.eitherFailKind = eitherFailKind;
@@ -3,7 +3,7 @@ import { left } from './create.mjs';
3
3
 
4
4
  const eitherFailKind = createKind("either-fail");
5
5
  function fail() {
6
- return eitherFailKind.addTo(left("fail", undefined));
6
+ return eitherFailKind.setTo(left("fail", undefined));
7
7
  }
8
8
 
9
9
  export { eitherFailKind, fail };
@@ -10,7 +10,7 @@ var base = require('./base.cjs');
10
10
 
11
11
  const eitherNullableEmptyKind = kind.createKind("either-nullable-empty");
12
12
  function nullableEmpty() {
13
- return base.eitherNullableKind.addTo(eitherNullableEmptyKind.addTo(create.left("nullable", null)));
13
+ return base.eitherNullableKind.setTo(eitherNullableEmptyKind.setTo(create.left("nullable", null)));
14
14
  }
15
15
  function isNullableEmpty(input) {
16
16
  return is.isLeft(input)
@@ -8,7 +8,7 @@ import { eitherNullableKind } from './base.mjs';
8
8
 
9
9
  const eitherNullableEmptyKind = createKind("either-nullable-empty");
10
10
  function nullableEmpty() {
11
- return eitherNullableKind.addTo(eitherNullableEmptyKind.addTo(left("nullable", null)));
11
+ return eitherNullableKind.setTo(eitherNullableEmptyKind.setTo(left("nullable", null)));
12
12
  }
13
13
  function isNullableEmpty(input) {
14
14
  return isLeft(input)
@@ -10,7 +10,7 @@ var base = require('./base.cjs');
10
10
 
11
11
  const eitherNullableFilledKind = kind.createKind("either-nullable-filled");
12
12
  function nullableFilled(value) {
13
- return base.eitherNullableKind.addTo(eitherNullableFilledKind.addTo(create.right("nullable", value)));
13
+ return base.eitherNullableKind.setTo(eitherNullableFilledKind.setTo(create.right("nullable", value)));
14
14
  }
15
15
  function isNullableFilled(input) {
16
16
  return is.isRight(input)
@@ -8,7 +8,7 @@ import { eitherNullableKind } from './base.mjs';
8
8
 
9
9
  const eitherNullableFilledKind = createKind("either-nullable-filled");
10
10
  function nullableFilled(value) {
11
- return eitherNullableKind.addTo(eitherNullableFilledKind.addTo(right("nullable", value)));
11
+ return eitherNullableKind.setTo(eitherNullableFilledKind.setTo(right("nullable", value)));
12
12
  }
13
13
  function isNullableFilled(input) {
14
14
  return isRight(input)
@@ -10,7 +10,7 @@ var base = require('./base.cjs');
10
10
 
11
11
  const eitherNullishEmptyKind = kind.createKind("either-nullish-empty");
12
12
  function nullishEmpty(value = undefined) {
13
- return base.eitherNullishKind.addTo(eitherNullishEmptyKind.addTo(create.left("nullish", value)));
13
+ return base.eitherNullishKind.setTo(eitherNullishEmptyKind.setTo(create.left("nullish", value)));
14
14
  }
15
15
  function isNullishEmpty(input) {
16
16
  return is.isLeft(input)
@@ -8,7 +8,7 @@ import { eitherNullishKind } from './base.mjs';
8
8
 
9
9
  const eitherNullishEmptyKind = createKind("either-nullish-empty");
10
10
  function nullishEmpty(value = undefined) {
11
- return eitherNullishKind.addTo(eitherNullishEmptyKind.addTo(left("nullish", value)));
11
+ return eitherNullishKind.setTo(eitherNullishEmptyKind.setTo(left("nullish", value)));
12
12
  }
13
13
  function isNullishEmpty(input) {
14
14
  return isLeft(input)
@@ -10,7 +10,7 @@ var base = require('./base.cjs');
10
10
 
11
11
  const eitherNullishFilledKind = kind.createKind("either-nullish-filled");
12
12
  function nullishFilled(value) {
13
- return base.eitherNullishKind.addTo(eitherNullishFilledKind.addTo(create.right("nullish", value)));
13
+ return base.eitherNullishKind.setTo(eitherNullishFilledKind.setTo(create.right("nullish", value)));
14
14
  }
15
15
  function isNullishFilled(input) {
16
16
  return is.isRight(input)
@@ -8,7 +8,7 @@ import { eitherNullishKind } from './base.mjs';
8
8
 
9
9
  const eitherNullishFilledKind = createKind("either-nullish-filled");
10
10
  function nullishFilled(value) {
11
- return eitherNullishKind.addTo(eitherNullishFilledKind.addTo(right("nullish", value)));
11
+ return eitherNullishKind.setTo(eitherNullishFilledKind.setTo(right("nullish", value)));
12
12
  }
13
13
  function isNullishFilled(input) {
14
14
  return isRight(input)
@@ -9,7 +9,7 @@ var base = require('./base.cjs');
9
9
 
10
10
  const eitherOptionalEmptyKind = kind.createKind("either-optional-empty");
11
11
  function optionalEmpty() {
12
- return base.eitherOptionalKind.addTo(eitherOptionalEmptyKind.addTo(create.left("optional", undefined)));
12
+ return base.eitherOptionalKind.setTo(eitherOptionalEmptyKind.setTo(create.left("optional", undefined)));
13
13
  }
14
14
  function isOptionalEmpty(input) {
15
15
  return is.isLeft(input)
@@ -7,7 +7,7 @@ import { eitherOptionalKind } from './base.mjs';
7
7
 
8
8
  const eitherOptionalEmptyKind = createKind("either-optional-empty");
9
9
  function optionalEmpty() {
10
- return eitherOptionalKind.addTo(eitherOptionalEmptyKind.addTo(left("optional", undefined)));
10
+ return eitherOptionalKind.setTo(eitherOptionalEmptyKind.setTo(left("optional", undefined)));
11
11
  }
12
12
  function isOptionalEmpty(input) {
13
13
  return isLeft(input)
@@ -10,7 +10,7 @@ var base = require('./base.cjs');
10
10
 
11
11
  const eitherOptionalFilledKind = kind.createKind("either-optional-filled");
12
12
  function optionalFilled(value) {
13
- return base.eitherOptionalKind.addTo(eitherOptionalFilledKind.addTo(create.right("optional", value)));
13
+ return base.eitherOptionalKind.setTo(eitherOptionalFilledKind.setTo(create.right("optional", value)));
14
14
  }
15
15
  function isOptionalFilled(input) {
16
16
  return is.isRight(input)