@duplojs/utils 1.0.7 → 1.1.8

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 (364) 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 +45 -1
  22. package/dist/common/kind.d.ts +24 -4
  23. package/dist/common/kind.mjs +44 -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/kind.cjs +7 -0
  129. package/dist/dataParser/kind.d.ts +1 -0
  130. package/dist/dataParser/kind.mjs +5 -0
  131. package/dist/dataParser/parsers/array/checkers/index.d.ts +2 -0
  132. package/dist/dataParser/parsers/array/checkers/max.cjs +23 -0
  133. package/dist/dataParser/parsers/array/checkers/max.d.ts +11 -0
  134. package/dist/dataParser/parsers/array/checkers/max.mjs +20 -0
  135. package/dist/dataParser/parsers/array/checkers/min.cjs +23 -0
  136. package/dist/dataParser/parsers/array/checkers/min.d.ts +11 -0
  137. package/dist/dataParser/parsers/array/checkers/min.mjs +20 -0
  138. package/dist/dataParser/parsers/array/index.cjs +64 -0
  139. package/dist/dataParser/parsers/array/index.d.ts +20 -0
  140. package/dist/dataParser/parsers/array/index.mjs +61 -0
  141. package/dist/dataParser/parsers/bigint/checkers/index.d.ts +2 -0
  142. package/dist/dataParser/parsers/bigint/checkers/max.cjs +23 -0
  143. package/dist/dataParser/parsers/bigint/checkers/max.d.ts +11 -0
  144. package/dist/dataParser/parsers/bigint/checkers/max.mjs +20 -0
  145. package/dist/dataParser/parsers/bigint/checkers/min.cjs +23 -0
  146. package/dist/dataParser/parsers/bigint/checkers/min.d.ts +11 -0
  147. package/dist/dataParser/parsers/bigint/checkers/min.mjs +20 -0
  148. package/dist/dataParser/parsers/bigint/index.cjs +31 -0
  149. package/dist/dataParser/parsers/bigint/index.d.ts +18 -0
  150. package/dist/dataParser/parsers/bigint/index.mjs +28 -0
  151. package/dist/dataParser/parsers/boolean.cjs +40 -0
  152. package/dist/dataParser/parsers/boolean.d.ts +12 -0
  153. package/dist/dataParser/parsers/boolean.mjs +37 -0
  154. package/dist/dataParser/parsers/coerce/bigint.cjs +13 -0
  155. package/dist/dataParser/parsers/coerce/bigint.d.ts +6 -0
  156. package/dist/dataParser/parsers/coerce/bigint.mjs +11 -0
  157. package/dist/dataParser/parsers/coerce/boolean.cjs +13 -0
  158. package/dist/dataParser/parsers/coerce/boolean.d.ts +6 -0
  159. package/dist/dataParser/parsers/coerce/boolean.mjs +11 -0
  160. package/dist/dataParser/parsers/coerce/empty.cjs +13 -0
  161. package/dist/dataParser/parsers/coerce/empty.d.ts +6 -0
  162. package/dist/dataParser/parsers/coerce/empty.mjs +11 -0
  163. package/dist/dataParser/parsers/coerce/index.cjs +17 -0
  164. package/dist/dataParser/parsers/coerce/index.d.ts +6 -0
  165. package/dist/dataParser/parsers/coerce/index.mjs +6 -0
  166. package/dist/dataParser/parsers/coerce/nil.cjs +13 -0
  167. package/dist/dataParser/parsers/coerce/nil.d.ts +6 -0
  168. package/dist/dataParser/parsers/coerce/nil.mjs +11 -0
  169. package/dist/dataParser/parsers/coerce/number.cjs +13 -0
  170. package/dist/dataParser/parsers/coerce/number.d.ts +6 -0
  171. package/dist/dataParser/parsers/coerce/number.mjs +11 -0
  172. package/dist/dataParser/parsers/coerce/string.cjs +13 -0
  173. package/dist/dataParser/parsers/coerce/string.d.ts +6 -0
  174. package/dist/dataParser/parsers/coerce/string.mjs +11 -0
  175. package/dist/dataParser/parsers/empty.cjs +27 -0
  176. package/dist/dataParser/parsers/empty.d.ts +12 -0
  177. package/dist/dataParser/parsers/empty.mjs +24 -0
  178. package/dist/dataParser/parsers/index.d.ts +20 -0
  179. package/dist/dataParser/parsers/lazy.cjs +21 -0
  180. package/dist/dataParser/parsers/lazy.d.ts +14 -0
  181. package/dist/dataParser/parsers/lazy.mjs +18 -0
  182. package/dist/dataParser/parsers/literal.cjs +25 -0
  183. package/dist/dataParser/parsers/literal.d.ts +15 -0
  184. package/dist/dataParser/parsers/literal.mjs +22 -0
  185. package/dist/dataParser/parsers/nil.cjs +27 -0
  186. package/dist/dataParser/parsers/nil.d.ts +12 -0
  187. package/dist/dataParser/parsers/nil.mjs +24 -0
  188. package/dist/dataParser/parsers/nullable.cjs +31 -0
  189. package/dist/dataParser/parsers/nullable.d.ts +14 -0
  190. package/dist/dataParser/parsers/nullable.mjs +28 -0
  191. package/dist/dataParser/parsers/number/checkers/index.d.ts +3 -0
  192. package/dist/dataParser/parsers/number/checkers/int.cjs +27 -0
  193. package/dist/dataParser/parsers/number/checkers/int.d.ts +15 -0
  194. package/dist/dataParser/parsers/number/checkers/int.mjs +23 -0
  195. package/dist/dataParser/parsers/number/checkers/max.cjs +18 -0
  196. package/dist/dataParser/parsers/number/checkers/max.d.ts +11 -0
  197. package/dist/dataParser/parsers/number/checkers/max.mjs +15 -0
  198. package/dist/dataParser/parsers/number/checkers/min.cjs +18 -0
  199. package/dist/dataParser/parsers/number/checkers/min.d.ts +11 -0
  200. package/dist/dataParser/parsers/number/checkers/min.mjs +15 -0
  201. package/dist/dataParser/parsers/number/index.cjs +31 -0
  202. package/dist/dataParser/parsers/number/index.d.ts +18 -0
  203. package/dist/dataParser/parsers/number/index.mjs +28 -0
  204. package/dist/dataParser/parsers/object.cjs +74 -0
  205. package/dist/dataParser/parsers/object.d.ts +26 -0
  206. package/dist/dataParser/parsers/object.mjs +71 -0
  207. package/dist/dataParser/parsers/optional.cjs +31 -0
  208. package/dist/dataParser/parsers/optional.d.ts +14 -0
  209. package/dist/dataParser/parsers/optional.mjs +28 -0
  210. package/dist/dataParser/parsers/pipe.cjs +34 -0
  211. package/dist/dataParser/parsers/pipe.d.ts +16 -0
  212. package/dist/dataParser/parsers/pipe.mjs +31 -0
  213. package/dist/dataParser/parsers/record.cjs +83 -0
  214. package/dist/dataParser/parsers/record.d.ts +30 -0
  215. package/dist/dataParser/parsers/record.mjs +80 -0
  216. package/dist/dataParser/parsers/string/checkers/email.cjs +31 -0
  217. package/dist/dataParser/parsers/string/checkers/email.d.ts +17 -0
  218. package/dist/dataParser/parsers/string/checkers/email.mjs +27 -0
  219. package/dist/dataParser/parsers/string/checkers/index.d.ts +5 -0
  220. package/dist/dataParser/parsers/string/checkers/max.cjs +18 -0
  221. package/dist/dataParser/parsers/string/checkers/max.d.ts +11 -0
  222. package/dist/dataParser/parsers/string/checkers/max.mjs +15 -0
  223. package/dist/dataParser/parsers/string/checkers/min.cjs +18 -0
  224. package/dist/dataParser/parsers/string/checkers/min.d.ts +11 -0
  225. package/dist/dataParser/parsers/string/checkers/min.mjs +15 -0
  226. package/dist/dataParser/parsers/string/checkers/regex.cjs +20 -0
  227. package/dist/dataParser/parsers/string/checkers/regex.d.ts +11 -0
  228. package/dist/dataParser/parsers/string/checkers/regex.mjs +17 -0
  229. package/dist/dataParser/parsers/string/checkers/url.cjs +48 -0
  230. package/dist/dataParser/parsers/string/checkers/url.d.ts +18 -0
  231. package/dist/dataParser/parsers/string/checkers/url.mjs +44 -0
  232. package/dist/dataParser/parsers/string/index.cjs +31 -0
  233. package/dist/dataParser/parsers/string/index.d.ts +18 -0
  234. package/dist/dataParser/parsers/string/index.mjs +28 -0
  235. package/dist/dataParser/parsers/templateLiteral.cjs +45 -0
  236. package/dist/dataParser/parsers/templateLiteral.d.ts +49 -0
  237. package/dist/dataParser/parsers/templateLiteral.mjs +42 -0
  238. package/dist/dataParser/parsers/transform.cjs +43 -0
  239. package/dist/dataParser/parsers/transform.d.ts +17 -0
  240. package/dist/dataParser/parsers/transform.mjs +40 -0
  241. package/dist/dataParser/parsers/tuple.cjs +83 -0
  242. package/dist/dataParser/parsers/tuple.d.ts +33 -0
  243. package/dist/dataParser/parsers/tuple.mjs +80 -0
  244. package/dist/dataParser/parsers/union.cjs +38 -0
  245. package/dist/dataParser/parsers/union.d.ts +15 -0
  246. package/dist/dataParser/parsers/union.mjs +35 -0
  247. package/dist/dataParser/parsers/unknown.cjs +17 -0
  248. package/dist/dataParser/parsers/unknown.d.ts +11 -0
  249. package/dist/dataParser/parsers/unknown.mjs +14 -0
  250. package/dist/dataParser/types/addCheckersToDefinition.d.ts +5 -0
  251. package/dist/dataParser/types/checkers.d.ts +3 -0
  252. package/dist/dataParser/types/dataParsers.d.ts +5 -0
  253. package/dist/dataParser/types/index.d.ts +4 -0
  254. package/dist/dataParser/types/mergeDefinition.d.ts +5 -0
  255. package/dist/either/bool/base.cjs +2 -2
  256. package/dist/either/bool/base.d.ts +1 -1
  257. package/dist/either/bool/base.mjs +2 -2
  258. package/dist/either/bool/falsy.cjs +5 -5
  259. package/dist/either/bool/falsy.d.ts +4 -4
  260. package/dist/either/bool/falsy.mjs +5 -5
  261. package/dist/either/bool/truthy.cjs +4 -4
  262. package/dist/either/bool/truthy.d.ts +5 -5
  263. package/dist/either/bool/truthy.mjs +4 -4
  264. package/dist/either/future/base.cjs +2 -2
  265. package/dist/either/future/base.d.ts +1 -1
  266. package/dist/either/future/base.mjs +2 -2
  267. package/dist/either/future/error.cjs +3 -3
  268. package/dist/either/future/error.d.ts +1 -1
  269. package/dist/either/future/error.mjs +3 -3
  270. package/dist/either/future/success.cjs +3 -3
  271. package/dist/either/future/success.d.ts +2 -2
  272. package/dist/either/future/success.mjs +3 -3
  273. package/dist/either/hasInformation.cjs +3 -3
  274. package/dist/either/hasInformation.d.ts +1 -1
  275. package/dist/either/hasInformation.mjs +1 -1
  276. package/dist/either/index.cjs +3 -2
  277. package/dist/either/index.d.ts +1 -1
  278. package/dist/either/index.mjs +1 -1
  279. package/dist/either/kind.cjs +9 -0
  280. package/dist/either/kind.d.ts +2 -0
  281. package/dist/either/kind.mjs +6 -0
  282. package/dist/either/left/create.cjs +3 -4
  283. package/dist/either/left/create.d.ts +2 -2
  284. package/dist/either/left/create.mjs +3 -4
  285. package/dist/either/left/error.cjs +3 -3
  286. package/dist/either/left/error.d.ts +1 -1
  287. package/dist/either/left/error.mjs +3 -3
  288. package/dist/either/left/fail.cjs +3 -3
  289. package/dist/either/left/fail.d.ts +1 -1
  290. package/dist/either/left/fail.mjs +3 -3
  291. package/dist/either/left/is.cjs +2 -2
  292. package/dist/either/left/is.mjs +1 -1
  293. package/dist/either/nullable/base.cjs +2 -2
  294. package/dist/either/nullable/base.d.ts +1 -1
  295. package/dist/either/nullable/base.mjs +2 -2
  296. package/dist/either/nullable/empty.cjs +3 -3
  297. package/dist/either/nullable/empty.d.ts +1 -1
  298. package/dist/either/nullable/empty.mjs +3 -3
  299. package/dist/either/nullable/filled.cjs +3 -3
  300. package/dist/either/nullable/filled.d.ts +1 -1
  301. package/dist/either/nullable/filled.mjs +3 -3
  302. package/dist/either/nullish/base.cjs +2 -2
  303. package/dist/either/nullish/base.d.ts +1 -1
  304. package/dist/either/nullish/base.mjs +2 -2
  305. package/dist/either/nullish/empty.cjs +3 -3
  306. package/dist/either/nullish/empty.d.ts +2 -2
  307. package/dist/either/nullish/empty.mjs +3 -3
  308. package/dist/either/nullish/filled.cjs +4 -4
  309. package/dist/either/nullish/filled.d.ts +1 -1
  310. package/dist/either/nullish/filled.mjs +4 -4
  311. package/dist/either/optional/base.cjs +2 -2
  312. package/dist/either/optional/base.d.ts +1 -1
  313. package/dist/either/optional/base.mjs +2 -2
  314. package/dist/either/optional/empty.cjs +5 -5
  315. package/dist/either/optional/empty.d.ts +3 -3
  316. package/dist/either/optional/empty.mjs +5 -5
  317. package/dist/either/optional/filled.cjs +5 -5
  318. package/dist/either/optional/filled.d.ts +3 -3
  319. package/dist/either/optional/filled.mjs +5 -5
  320. package/dist/either/right/asyncPipe.d.ts +2 -2
  321. package/dist/either/right/create.cjs +3 -4
  322. package/dist/either/right/create.d.ts +2 -2
  323. package/dist/either/right/create.mjs +3 -4
  324. package/dist/either/right/is.cjs +2 -2
  325. package/dist/either/right/is.mjs +1 -1
  326. package/dist/either/right/ok.cjs +3 -3
  327. package/dist/either/right/ok.d.ts +1 -1
  328. package/dist/either/right/ok.mjs +3 -3
  329. package/dist/either/right/success.cjs +3 -3
  330. package/dist/either/right/success.d.ts +2 -2
  331. package/dist/either/right/success.mjs +3 -3
  332. package/dist/either/whenHasInformation.cjs +2 -2
  333. package/dist/either/whenHasInformation.d.ts +1 -1
  334. package/dist/either/whenHasInformation.mjs +1 -1
  335. package/dist/generator/reduce.cjs +1 -1
  336. package/dist/generator/reduce.mjs +1 -1
  337. package/dist/index.cjs +15 -0
  338. package/dist/index.d.ts +6 -0
  339. package/dist/index.mjs +12 -1
  340. package/dist/number/greater.cjs +12 -0
  341. package/dist/number/greater.d.ts +2 -0
  342. package/dist/number/greater.mjs +10 -0
  343. package/dist/number/greaterThan.cjs +12 -0
  344. package/dist/number/greaterThan.d.ts +2 -0
  345. package/dist/number/greaterThan.mjs +10 -0
  346. package/dist/number/index.cjs +8 -0
  347. package/dist/number/index.d.ts +4 -0
  348. package/dist/number/index.mjs +4 -0
  349. package/dist/number/less.cjs +12 -0
  350. package/dist/number/less.d.ts +2 -0
  351. package/dist/number/less.mjs +10 -0
  352. package/dist/number/lessThan.cjs +12 -0
  353. package/dist/number/lessThan.d.ts +2 -0
  354. package/dist/number/lessThan.mjs +10 -0
  355. package/dist/object/fromEntries.d.ts +1 -1
  356. package/dist/object/types/getPropsWithValueExtends.d.ts +1 -1
  357. package/dist/pattern/result.cjs +1 -1
  358. package/dist/pattern/result.mjs +1 -1
  359. package/dist/string/types/forbiddenCharacters.d.ts +5 -0
  360. package/dist/string/types/index.d.ts +1 -0
  361. package/package.json +57 -1
  362. package/dist/either/base.cjs +0 -7
  363. package/dist/either/base.d.ts +0 -1
  364. package/dist/either/base.mjs +0 -5
@@ -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<"@DataParser/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 { dataParserInit, SymbolDataParserError } from '../base.mjs';
2
+ import { SymbolDataParserErrorIssue, setErrorPath, popErrorPath } from '../error.mjs';
3
+ import { createDataParserKind } from '../kind.mjs';
4
+
5
+ const dataParserTupleKind = createDataParserKind("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 base = require('../base.cjs');
4
+ var error = require('../error.cjs');
5
+ var kind = require('../kind.cjs');
6
+
7
+ const dataParserUnionKind = kind.createDataParserKind("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<"@DataParser/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 { dataParserInit, SymbolDataParserError } from '../base.mjs';
2
+ import { SymbolDataParserErrorIssue } from '../error.mjs';
3
+ import { createDataParserKind } from '../kind.mjs';
4
+
5
+ const dataParserUnionKind = createDataParserKind("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 base = require('../base.cjs');
4
+ var kind = require('../kind.cjs');
5
+
6
+ const dataParserUnknownKind = kind.createDataParserKind("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<"@DataParser/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 { dataParserInit } from '../base.mjs';
2
+ import { createDataParserKind } from '../kind.mjs';
3
+
4
+ const dataParserUnknownKind = createDataParserKind("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;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var kind = require('../../common/kind.cjs');
3
+ var kind = require('../kind.cjs');
4
4
 
5
- const eitherBoolKind = kind.createKind("either-bool");
5
+ const eitherBoolKind = kind.createEitherKind("bool");
6
6
 
7
7
  exports.eitherBoolKind = eitherBoolKind;
@@ -1 +1 @@
1
- export declare const eitherBoolKind: import("../../common").KindHandler<import("../../common").KindDefinition<"either-bool", unknown>>;
1
+ export declare const eitherBoolKind: import("../..").KindHandler<import("../..").KindDefinition<"@Either/bool", unknown>>;
@@ -1,5 +1,5 @@
1
- import { createKind } from '../../common/kind.mjs';
1
+ import { createEitherKind } from '../kind.mjs';
2
2
 
3
- const eitherBoolKind = createKind("either-bool");
3
+ const eitherBoolKind = createEitherKind("bool");
4
4
 
5
5
  export { eitherBoolKind };
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var kind = require('../../common/kind.cjs');
4
3
  var unwrap = require('../../common/unwrap.cjs');
4
+ var kind = require('../kind.cjs');
5
+ var base = require('./base.cjs');
6
+ var create$1 = require('./create.cjs');
5
7
  var create = require('../left/create.cjs');
6
8
  var is = require('../left/is.cjs');
7
9
  var is$1 = require('../right/is.cjs');
8
- var create$1 = require('./create.cjs');
9
- var base = require('./base.cjs');
10
10
 
11
- const eitherBoolFalsyKind = kind.createKind("either-bool-falsy");
11
+ const eitherBoolFalsyKind = kind.createEitherKind("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)
@@ -1,11 +1,11 @@
1
1
  import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
2
- import { type EitherLeft } from "../left";
3
- import { type EitherRight } from "../right";
4
- import { bool } from "./create";
5
2
  import { type Kind } from "../../common/kind";
6
3
  import { eitherBoolKind } from "./base";
4
+ import { bool } from "./create";
5
+ import { type EitherLeft } from "../left";
6
+ import { type EitherRight } from "../right";
7
7
  export type BoolFalsyValue = 0 | "" | undefined | null | false;
8
- export declare const eitherBoolFalsyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"either-bool-falsy", unknown>>;
8
+ export declare const eitherBoolFalsyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/bool-falsy", unknown>>;
9
9
  type _EitherBoolFalsy<GenericValue extends BoolFalsyValue = BoolFalsyValue> = (EitherLeft<"bool", GenericValue> & Kind<typeof eitherBoolKind.definition> & Kind<typeof eitherBoolFalsyKind.definition>);
10
10
  export interface EitherBoolFalsy<GenericValue extends BoolFalsyValue = BoolFalsyValue> extends _EitherBoolFalsy<GenericValue> {
11
11
  }
@@ -1,14 +1,14 @@
1
- import { createKind } from '../../common/kind.mjs';
2
1
  import { unwrap } from '../../common/unwrap.mjs';
2
+ import { createEitherKind } from '../kind.mjs';
3
+ import { eitherBoolKind } from './base.mjs';
4
+ import { bool } from './create.mjs';
3
5
  import { left } from '../left/create.mjs';
4
6
  import { isLeft } from '../left/is.mjs';
5
7
  import { isRight } from '../right/is.mjs';
6
- import { bool } from './create.mjs';
7
- import { eitherBoolKind } from './base.mjs';
8
8
 
9
- const eitherBoolFalsyKind = createKind("either-bool-falsy");
9
+ const eitherBoolFalsyKind = createEitherKind("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)
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var kind = require('../../common/kind.cjs');
4
3
  var unwrap = require('../../common/unwrap.cjs');
4
+ var base = require('./base.cjs');
5
+ var kind = require('../kind.cjs');
5
6
  var is$1 = require('../left/is.cjs');
6
7
  var create = require('../right/create.cjs');
7
8
  var is = require('../right/is.cjs');
8
9
  var create$1 = require('./create.cjs');
9
- var base = require('./base.cjs');
10
10
 
11
- const eitherBoolTruthyKind = kind.createKind("either-bool-truthy");
11
+ const eitherBoolTruthyKind = kind.createEitherKind("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)
@@ -1,10 +1,10 @@
1
- import { type EitherRight } from "../right";
2
- import { bool } from "./create";
3
- import { type EitherLeft } from "../left";
4
- import { type Kind } from "../../common/kind";
5
1
  import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
2
+ import { type Kind } from "../../common/kind";
6
3
  import { eitherBoolKind } from "./base";
7
- export declare const eitherBoolTruthyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"either-bool-truthy", unknown>>;
4
+ import { type EitherLeft } from "../left";
5
+ import { type EitherRight } from "../right";
6
+ import { bool } from "./create";
7
+ export declare const eitherBoolTruthyKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@Either/bool-truthy", unknown>>;
8
8
  type _EitherBoolTruthy<GenericValue extends unknown = unknown> = (EitherRight<"bool", GenericValue> & Kind<typeof eitherBoolKind.definition> & Kind<typeof eitherBoolTruthyKind.definition>);
9
9
  export interface EitherBoolTruthy<GenericValue extends unknown = unknown> extends _EitherBoolTruthy<GenericValue> {
10
10
  }
@@ -1,14 +1,14 @@
1
- import { createKind } from '../../common/kind.mjs';
2
1
  import { unwrap } from '../../common/unwrap.mjs';
2
+ import { eitherBoolKind } from './base.mjs';
3
+ import { createEitherKind } from '../kind.mjs';
3
4
  import { isLeft } from '../left/is.mjs';
4
5
  import { right } from '../right/create.mjs';
5
6
  import { isRight } from '../right/is.mjs';
6
7
  import { bool } from './create.mjs';
7
- import { eitherBoolKind } from './base.mjs';
8
8
 
9
- const eitherBoolTruthyKind = createKind("either-bool-truthy");
9
+ const eitherBoolTruthyKind = createEitherKind("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)
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var kind = require('../../common/kind.cjs');
3
+ var kind = require('../kind.cjs');
4
4
 
5
- const eitherFutureKind = kind.createKind("either-future");
5
+ const eitherFutureKind = kind.createEitherKind("future");
6
6
 
7
7
  exports.eitherFutureKind = eitherFutureKind;
@@ -1 +1 @@
1
- export declare const eitherFutureKind: import("../../common").KindHandler<import("../../common").KindDefinition<"either-future", unknown>>;
1
+ export declare const eitherFutureKind: import("../..").KindHandler<import("../..").KindDefinition<"@Either/future", unknown>>;
@@ -1,5 +1,5 @@
1
- import { createKind } from '../../common/kind.mjs';
1
+ import { createEitherKind } from '../kind.mjs';
2
2
 
3
- const eitherFutureKind = createKind("either-future");
3
+ const eitherFutureKind = createEitherKind("future");
4
4
 
5
5
  export { eitherFutureKind };
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var kind = require('../../common/kind.cjs');
4
3
  var create = require('../left/create.cjs');
4
+ var kind = require('../kind.cjs');
5
5
  var base = require('./base.cjs');
6
6
 
7
- const eitherFutureErrorKind = kind.createKind("either-future-error");
7
+ const eitherFutureErrorKind = kind.createEitherKind("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;
@@ -1,7 +1,7 @@
1
1
  import { type Kind } from "../../common/kind";
2
2
  import { type EitherLeft } from "../left";
3
3
  import { eitherFutureKind } from "./base";
4
- export declare const eitherFutureErrorKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"either-future-error", unknown>>;
4
+ export declare const eitherFutureErrorKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/future-error", unknown>>;
5
5
  type _EitherFutureError = (EitherLeft<"future", unknown> & Kind<typeof eitherFutureKind.definition> & Kind<typeof eitherFutureErrorKind.definition>);
6
6
  export interface EitherFutureError extends _EitherFutureError {
7
7
  }
@@ -1,10 +1,10 @@
1
- import { createKind } from '../../common/kind.mjs';
2
1
  import { left } from '../left/create.mjs';
2
+ import { createEitherKind } from '../kind.mjs';
3
3
  import { eitherFutureKind } from './base.mjs';
4
4
 
5
- const eitherFutureErrorKind = createKind("either-future-error");
5
+ const eitherFutureErrorKind = createEitherKind("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 };
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var kind = require('../../common/kind.cjs');
3
+ var kind = require('../kind.cjs');
4
4
  var base = require('./base.cjs');
5
5
  var create = require('../right/create.cjs');
6
6
 
7
- const eitherFutureSuccessKind = kind.createKind("either-future-success");
7
+ const eitherFutureSuccessKind = kind.createEitherKind("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;
@@ -1,7 +1,7 @@
1
- import { type EitherRight } from "../right";
2
1
  import { type Kind } from "../../common/kind";
3
2
  import { eitherFutureKind } from "./base";
4
- export declare const eitherFutureSuccessKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"either-future-success", unknown>>;
3
+ import { type EitherRight } from "../right";
4
+ export declare const eitherFutureSuccessKind: import("../../common/kind").KindHandler<import("../../common/kind").KindDefinition<"@Either/future-success", unknown>>;
5
5
  type _EitherFutureSuccess<GenericValue extends unknown = unknown> = (EitherRight<"future", GenericValue> & Kind<typeof eitherFutureKind.definition> & Kind<typeof eitherFutureSuccessKind.definition>);
6
6
  export interface EitherFutureSuccess<GenericValue extends unknown = unknown> extends _EitherFutureSuccess<GenericValue> {
7
7
  }
@@ -1,10 +1,10 @@
1
- import { createKind } from '../../common/kind.mjs';
1
+ import { createEitherKind } from '../kind.mjs';
2
2
  import { eitherFutureKind } from './base.mjs';
3
3
  import { right } from '../right/create.mjs';
4
4
 
5
- const eitherFutureSuccessKind = createKind("either-future-success");
5
+ const eitherFutureSuccessKind = createEitherKind("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 };
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var base = require('./base.cjs');
3
+ var kind = require('./kind.cjs');
4
4
 
5
5
  function hasInformation(input, information) {
6
- return base.eitherInformationKind.has(input)
7
- && base.eitherInformationKind.getValue(input) === information;
6
+ return kind.eitherInformationKind.has(input)
7
+ && kind.eitherInformationKind.getValue(input) === information;
8
8
  }
9
9
 
10
10
  exports.hasInformation = hasInformation;
@@ -1,7 +1,7 @@
1
1
  import { type Kind } from "../common";
2
2
  import { type EitherLeft } from "./left";
3
3
  import { type EitherRight } from "./right";
4
- import { eitherInformationKind } from "./base";
4
+ import { eitherInformationKind } from "./kind";
5
5
  type Either = EitherRight | EitherLeft;
6
6
  export declare function hasInformation<const GenericInput extends unknown, GenericInformation extends (GenericInput extends Either ? ReturnType<typeof eitherInformationKind.getValue<GenericInput>> : never)>(input: GenericInput, information: GenericInformation): input is Extract<GenericInput, Kind<typeof eitherInformationKind.definition, GenericInformation>>;
7
7
  export {};
@@ -1,4 +1,4 @@
1
- import { eitherInformationKind } from './base.mjs';
1
+ import { eitherInformationKind } from './kind.mjs';
2
2
 
3
3
  function hasInformation(input, information) {
4
4
  return eitherInformationKind.has(input)
@@ -34,7 +34,7 @@ var success$1 = require('./right/success.cjs');
34
34
  var when$1 = require('./right/when.cjs');
35
35
  var hasInformation = require('./hasInformation.cjs');
36
36
  var whenHasInformation = require('./whenHasInformation.cjs');
37
- var base$5 = require('./base.cjs');
37
+ var kind = require('./kind.cjs');
38
38
 
39
39
 
40
40
 
@@ -105,4 +105,5 @@ exports.success = success$1.success;
105
105
  exports.whenIsRight = when$1.whenIsRight;
106
106
  exports.hasInformation = hasInformation.hasInformation;
107
107
  exports.whenHasInformation = whenHasInformation.whenHasInformation;
108
- exports.eitherInformationKind = base$5.eitherInformationKind;
108
+ exports.createEitherKind = kind.createEitherKind;
109
+ exports.eitherInformationKind = kind.eitherInformationKind;
@@ -7,4 +7,4 @@ export * from "./optional";
7
7
  export * from "./right";
8
8
  export * from "./hasInformation";
9
9
  export * from "./whenHasInformation";
10
- export * from "./base";
10
+ export * from "./kind";
@@ -32,4 +32,4 @@ export { eitherSuccessKind, success } from './right/success.mjs';
32
32
  export { whenIsRight } from './right/when.mjs';
33
33
  export { hasInformation } from './hasInformation.mjs';
34
34
  export { whenHasInformation } from './whenHasInformation.mjs';
35
- export { eitherInformationKind } from './base.mjs';
35
+ export { createEitherKind, eitherInformationKind } from './kind.mjs';
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var kind = require('../common/kind.cjs');
4
+
5
+ const createEitherKind = kind.createKindNamespace("Either");
6
+ const eitherInformationKind = createEitherKind("information");
7
+
8
+ exports.createEitherKind = createEitherKind;
9
+ exports.eitherInformationKind = eitherInformationKind;
@@ -0,0 +1,2 @@
1
+ export declare const createEitherKind: <GenericName extends string, GenericKindValue extends unknown = unknown>(name: GenericName & import("../string").ForbiddenCharacters<GenericName, "@" | "/">) => import("../common").KindHandler<import("../common").KindDefinition<`@Either/${GenericName}`, GenericKindValue>>;
2
+ export declare const eitherInformationKind: import("../common").KindHandler<import("../common").KindDefinition<"@Either/information", string>>;