@duplojs/utils 1.0.6 → 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 (324) 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 +4 -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/justReturn.cjs +12 -0
  22. package/dist/common/justReturn.d.ts +3 -0
  23. package/dist/common/justReturn.mjs +10 -0
  24. package/dist/common/kind.cjs +38 -1
  25. package/dist/common/kind.d.ts +22 -4
  26. package/dist/common/kind.mjs +38 -2
  27. package/dist/common/memo.cjs +16 -0
  28. package/dist/common/memo.d.ts +5 -0
  29. package/dist/common/memo.mjs +14 -0
  30. package/dist/common/simpleClone.cjs +2 -2
  31. package/dist/common/simpleClone.mjs +2 -2
  32. package/dist/common/types/anyConstructor.d.ts +1 -0
  33. package/dist/common/types/anyPredicate.d.ts +1 -0
  34. package/dist/common/types/index.d.ts +2 -0
  35. package/dist/common/types/objectEntry.d.ts +1 -1
  36. package/dist/common/types/predicate.d.ts +1 -0
  37. package/dist/common/types/unionContain.d.ts +1 -1
  38. package/dist/common/when.d.ts +2 -2
  39. package/dist/common/whenElse.cjs +17 -0
  40. package/dist/common/whenElse.d.ts +5 -0
  41. package/dist/common/whenElse.mjs +15 -0
  42. package/dist/common/whenNot.d.ts +2 -2
  43. package/dist/dataParser/base.cjs +116 -0
  44. package/dist/dataParser/base.d.ts +44 -0
  45. package/dist/dataParser/base.mjs +109 -0
  46. package/dist/dataParser/baseExtended.cjs +55 -0
  47. package/dist/dataParser/baseExtended.d.ts +45 -0
  48. package/dist/dataParser/baseExtended.mjs +52 -0
  49. package/dist/dataParser/error.cjs +54 -0
  50. package/dist/dataParser/error.d.ts +31 -0
  51. package/dist/dataParser/error.mjs +41 -0
  52. package/dist/dataParser/extended/array.cjs +20 -0
  53. package/dist/dataParser/extended/array.d.ts +21 -0
  54. package/dist/dataParser/extended/array.mjs +18 -0
  55. package/dist/dataParser/extended/bigint.cjs +20 -0
  56. package/dist/dataParser/extended/bigint.d.ts +19 -0
  57. package/dist/dataParser/extended/bigint.mjs +18 -0
  58. package/dist/dataParser/extended/boolean.cjs +11 -0
  59. package/dist/dataParser/extended/boolean.d.ts +9 -0
  60. package/dist/dataParser/extended/boolean.mjs +9 -0
  61. package/dist/dataParser/extended/coerce/bigint.cjs +13 -0
  62. package/dist/dataParser/extended/coerce/bigint.d.ts +7 -0
  63. package/dist/dataParser/extended/coerce/bigint.mjs +11 -0
  64. package/dist/dataParser/extended/coerce/boolean.cjs +13 -0
  65. package/dist/dataParser/extended/coerce/boolean.d.ts +7 -0
  66. package/dist/dataParser/extended/coerce/boolean.mjs +11 -0
  67. package/dist/dataParser/extended/coerce/empty.cjs +13 -0
  68. package/dist/dataParser/extended/coerce/empty.d.ts +7 -0
  69. package/dist/dataParser/extended/coerce/empty.mjs +11 -0
  70. package/dist/dataParser/extended/coerce/index.cjs +17 -0
  71. package/dist/dataParser/extended/coerce/index.d.ts +6 -0
  72. package/dist/dataParser/extended/coerce/index.mjs +6 -0
  73. package/dist/dataParser/extended/coerce/nil.cjs +13 -0
  74. package/dist/dataParser/extended/coerce/nil.d.ts +7 -0
  75. package/dist/dataParser/extended/coerce/nil.mjs +11 -0
  76. package/dist/dataParser/extended/coerce/number.cjs +13 -0
  77. package/dist/dataParser/extended/coerce/number.d.ts +7 -0
  78. package/dist/dataParser/extended/coerce/number.mjs +11 -0
  79. package/dist/dataParser/extended/coerce/string.cjs +13 -0
  80. package/dist/dataParser/extended/coerce/string.d.ts +7 -0
  81. package/dist/dataParser/extended/coerce/string.mjs +11 -0
  82. package/dist/dataParser/extended/empty.cjs +11 -0
  83. package/dist/dataParser/extended/empty.d.ts +9 -0
  84. package/dist/dataParser/extended/empty.mjs +9 -0
  85. package/dist/dataParser/extended/index.cjs +48 -0
  86. package/dist/dataParser/extended/index.d.ts +22 -0
  87. package/dist/dataParser/extended/index.mjs +21 -0
  88. package/dist/dataParser/extended/lazy.cjs +11 -0
  89. package/dist/dataParser/extended/lazy.d.ts +11 -0
  90. package/dist/dataParser/extended/lazy.mjs +9 -0
  91. package/dist/dataParser/extended/literal.cjs +11 -0
  92. package/dist/dataParser/extended/literal.d.ts +11 -0
  93. package/dist/dataParser/extended/literal.mjs +9 -0
  94. package/dist/dataParser/extended/nil.cjs +11 -0
  95. package/dist/dataParser/extended/nil.d.ts +9 -0
  96. package/dist/dataParser/extended/nil.mjs +9 -0
  97. package/dist/dataParser/extended/nullable.cjs +11 -0
  98. package/dist/dataParser/extended/nullable.d.ts +11 -0
  99. package/dist/dataParser/extended/nullable.mjs +9 -0
  100. package/dist/dataParser/extended/number.cjs +27 -0
  101. package/dist/dataParser/extended/number.d.ts +24 -0
  102. package/dist/dataParser/extended/number.mjs +24 -0
  103. package/dist/dataParser/extended/object.cjs +11 -0
  104. package/dist/dataParser/extended/object.d.ts +11 -0
  105. package/dist/dataParser/extended/object.mjs +9 -0
  106. package/dist/dataParser/extended/optional.cjs +11 -0
  107. package/dist/dataParser/extended/optional.d.ts +11 -0
  108. package/dist/dataParser/extended/optional.mjs +9 -0
  109. package/dist/dataParser/extended/pipe.cjs +11 -0
  110. package/dist/dataParser/extended/pipe.d.ts +12 -0
  111. package/dist/dataParser/extended/pipe.mjs +9 -0
  112. package/dist/dataParser/extended/record.cjs +11 -0
  113. package/dist/dataParser/extended/record.d.ts +12 -0
  114. package/dist/dataParser/extended/record.mjs +9 -0
  115. package/dist/dataParser/extended/string.cjs +38 -0
  116. package/dist/dataParser/extended/string.d.ts +32 -0
  117. package/dist/dataParser/extended/string.mjs +34 -0
  118. package/dist/dataParser/extended/templateLiteral.cjs +10 -0
  119. package/dist/dataParser/extended/templateLiteral.d.ts +11 -0
  120. package/dist/dataParser/extended/templateLiteral.mjs +8 -0
  121. package/dist/dataParser/extended/transform.cjs +11 -0
  122. package/dist/dataParser/extended/transform.d.ts +14 -0
  123. package/dist/dataParser/extended/transform.mjs +9 -0
  124. package/dist/dataParser/extended/tuple.cjs +11 -0
  125. package/dist/dataParser/extended/tuple.d.ts +11 -0
  126. package/dist/dataParser/extended/tuple.mjs +9 -0
  127. package/dist/dataParser/extended/union.cjs +11 -0
  128. package/dist/dataParser/extended/union.d.ts +11 -0
  129. package/dist/dataParser/extended/union.mjs +9 -0
  130. package/dist/dataParser/extended/unknown.cjs +11 -0
  131. package/dist/dataParser/extended/unknown.d.ts +9 -0
  132. package/dist/dataParser/extended/unknown.mjs +9 -0
  133. package/dist/dataParser/index.cjs +128 -0
  134. package/dist/dataParser/index.d.ts +6 -0
  135. package/dist/dataParser/index.mjs +38 -0
  136. package/dist/dataParser/parsers/array/checkers/index.d.ts +2 -0
  137. package/dist/dataParser/parsers/array/checkers/max.cjs +23 -0
  138. package/dist/dataParser/parsers/array/checkers/max.d.ts +11 -0
  139. package/dist/dataParser/parsers/array/checkers/max.mjs +20 -0
  140. package/dist/dataParser/parsers/array/checkers/min.cjs +23 -0
  141. package/dist/dataParser/parsers/array/checkers/min.d.ts +11 -0
  142. package/dist/dataParser/parsers/array/checkers/min.mjs +20 -0
  143. package/dist/dataParser/parsers/array/index.cjs +64 -0
  144. package/dist/dataParser/parsers/array/index.d.ts +20 -0
  145. package/dist/dataParser/parsers/array/index.mjs +61 -0
  146. package/dist/dataParser/parsers/bigint/checkers/index.d.ts +2 -0
  147. package/dist/dataParser/parsers/bigint/checkers/max.cjs +23 -0
  148. package/dist/dataParser/parsers/bigint/checkers/max.d.ts +11 -0
  149. package/dist/dataParser/parsers/bigint/checkers/max.mjs +20 -0
  150. package/dist/dataParser/parsers/bigint/checkers/min.cjs +23 -0
  151. package/dist/dataParser/parsers/bigint/checkers/min.d.ts +11 -0
  152. package/dist/dataParser/parsers/bigint/checkers/min.mjs +20 -0
  153. package/dist/dataParser/parsers/bigint/index.cjs +31 -0
  154. package/dist/dataParser/parsers/bigint/index.d.ts +18 -0
  155. package/dist/dataParser/parsers/bigint/index.mjs +28 -0
  156. package/dist/dataParser/parsers/boolean.cjs +40 -0
  157. package/dist/dataParser/parsers/boolean.d.ts +12 -0
  158. package/dist/dataParser/parsers/boolean.mjs +37 -0
  159. package/dist/dataParser/parsers/coerce/bigint.cjs +13 -0
  160. package/dist/dataParser/parsers/coerce/bigint.d.ts +6 -0
  161. package/dist/dataParser/parsers/coerce/bigint.mjs +11 -0
  162. package/dist/dataParser/parsers/coerce/boolean.cjs +13 -0
  163. package/dist/dataParser/parsers/coerce/boolean.d.ts +6 -0
  164. package/dist/dataParser/parsers/coerce/boolean.mjs +11 -0
  165. package/dist/dataParser/parsers/coerce/empty.cjs +13 -0
  166. package/dist/dataParser/parsers/coerce/empty.d.ts +6 -0
  167. package/dist/dataParser/parsers/coerce/empty.mjs +11 -0
  168. package/dist/dataParser/parsers/coerce/index.cjs +17 -0
  169. package/dist/dataParser/parsers/coerce/index.d.ts +6 -0
  170. package/dist/dataParser/parsers/coerce/index.mjs +6 -0
  171. package/dist/dataParser/parsers/coerce/nil.cjs +13 -0
  172. package/dist/dataParser/parsers/coerce/nil.d.ts +6 -0
  173. package/dist/dataParser/parsers/coerce/nil.mjs +11 -0
  174. package/dist/dataParser/parsers/coerce/number.cjs +13 -0
  175. package/dist/dataParser/parsers/coerce/number.d.ts +6 -0
  176. package/dist/dataParser/parsers/coerce/number.mjs +11 -0
  177. package/dist/dataParser/parsers/coerce/string.cjs +13 -0
  178. package/dist/dataParser/parsers/coerce/string.d.ts +6 -0
  179. package/dist/dataParser/parsers/coerce/string.mjs +11 -0
  180. package/dist/dataParser/parsers/empty.cjs +27 -0
  181. package/dist/dataParser/parsers/empty.d.ts +12 -0
  182. package/dist/dataParser/parsers/empty.mjs +24 -0
  183. package/dist/dataParser/parsers/index.d.ts +20 -0
  184. package/dist/dataParser/parsers/lazy.cjs +21 -0
  185. package/dist/dataParser/parsers/lazy.d.ts +14 -0
  186. package/dist/dataParser/parsers/lazy.mjs +18 -0
  187. package/dist/dataParser/parsers/literal.cjs +25 -0
  188. package/dist/dataParser/parsers/literal.d.ts +15 -0
  189. package/dist/dataParser/parsers/literal.mjs +22 -0
  190. package/dist/dataParser/parsers/nil.cjs +27 -0
  191. package/dist/dataParser/parsers/nil.d.ts +12 -0
  192. package/dist/dataParser/parsers/nil.mjs +24 -0
  193. package/dist/dataParser/parsers/nullable.cjs +31 -0
  194. package/dist/dataParser/parsers/nullable.d.ts +14 -0
  195. package/dist/dataParser/parsers/nullable.mjs +28 -0
  196. package/dist/dataParser/parsers/number/checkers/index.d.ts +3 -0
  197. package/dist/dataParser/parsers/number/checkers/int.cjs +27 -0
  198. package/dist/dataParser/parsers/number/checkers/int.d.ts +15 -0
  199. package/dist/dataParser/parsers/number/checkers/int.mjs +23 -0
  200. package/dist/dataParser/parsers/number/checkers/max.cjs +18 -0
  201. package/dist/dataParser/parsers/number/checkers/max.d.ts +11 -0
  202. package/dist/dataParser/parsers/number/checkers/max.mjs +15 -0
  203. package/dist/dataParser/parsers/number/checkers/min.cjs +18 -0
  204. package/dist/dataParser/parsers/number/checkers/min.d.ts +11 -0
  205. package/dist/dataParser/parsers/number/checkers/min.mjs +15 -0
  206. package/dist/dataParser/parsers/number/index.cjs +31 -0
  207. package/dist/dataParser/parsers/number/index.d.ts +18 -0
  208. package/dist/dataParser/parsers/number/index.mjs +28 -0
  209. package/dist/dataParser/parsers/object.cjs +74 -0
  210. package/dist/dataParser/parsers/object.d.ts +26 -0
  211. package/dist/dataParser/parsers/object.mjs +71 -0
  212. package/dist/dataParser/parsers/optional.cjs +31 -0
  213. package/dist/dataParser/parsers/optional.d.ts +14 -0
  214. package/dist/dataParser/parsers/optional.mjs +28 -0
  215. package/dist/dataParser/parsers/pipe.cjs +34 -0
  216. package/dist/dataParser/parsers/pipe.d.ts +16 -0
  217. package/dist/dataParser/parsers/pipe.mjs +31 -0
  218. package/dist/dataParser/parsers/record.cjs +83 -0
  219. package/dist/dataParser/parsers/record.d.ts +30 -0
  220. package/dist/dataParser/parsers/record.mjs +80 -0
  221. package/dist/dataParser/parsers/string/checkers/email.cjs +31 -0
  222. package/dist/dataParser/parsers/string/checkers/email.d.ts +17 -0
  223. package/dist/dataParser/parsers/string/checkers/email.mjs +27 -0
  224. package/dist/dataParser/parsers/string/checkers/index.d.ts +5 -0
  225. package/dist/dataParser/parsers/string/checkers/max.cjs +18 -0
  226. package/dist/dataParser/parsers/string/checkers/max.d.ts +11 -0
  227. package/dist/dataParser/parsers/string/checkers/max.mjs +15 -0
  228. package/dist/dataParser/parsers/string/checkers/min.cjs +18 -0
  229. package/dist/dataParser/parsers/string/checkers/min.d.ts +11 -0
  230. package/dist/dataParser/parsers/string/checkers/min.mjs +15 -0
  231. package/dist/dataParser/parsers/string/checkers/regex.cjs +20 -0
  232. package/dist/dataParser/parsers/string/checkers/regex.d.ts +11 -0
  233. package/dist/dataParser/parsers/string/checkers/regex.mjs +17 -0
  234. package/dist/dataParser/parsers/string/checkers/url.cjs +48 -0
  235. package/dist/dataParser/parsers/string/checkers/url.d.ts +18 -0
  236. package/dist/dataParser/parsers/string/checkers/url.mjs +44 -0
  237. package/dist/dataParser/parsers/string/index.cjs +31 -0
  238. package/dist/dataParser/parsers/string/index.d.ts +18 -0
  239. package/dist/dataParser/parsers/string/index.mjs +28 -0
  240. package/dist/dataParser/parsers/templateLiteral.cjs +45 -0
  241. package/dist/dataParser/parsers/templateLiteral.d.ts +49 -0
  242. package/dist/dataParser/parsers/templateLiteral.mjs +42 -0
  243. package/dist/dataParser/parsers/transform.cjs +43 -0
  244. package/dist/dataParser/parsers/transform.d.ts +17 -0
  245. package/dist/dataParser/parsers/transform.mjs +40 -0
  246. package/dist/dataParser/parsers/tuple.cjs +83 -0
  247. package/dist/dataParser/parsers/tuple.d.ts +33 -0
  248. package/dist/dataParser/parsers/tuple.mjs +80 -0
  249. package/dist/dataParser/parsers/union.cjs +38 -0
  250. package/dist/dataParser/parsers/union.d.ts +15 -0
  251. package/dist/dataParser/parsers/union.mjs +35 -0
  252. package/dist/dataParser/parsers/unknown.cjs +17 -0
  253. package/dist/dataParser/parsers/unknown.d.ts +11 -0
  254. package/dist/dataParser/parsers/unknown.mjs +14 -0
  255. package/dist/dataParser/types/addCheckersToDefinition.d.ts +5 -0
  256. package/dist/dataParser/types/checkers.d.ts +3 -0
  257. package/dist/dataParser/types/dataParsers.d.ts +5 -0
  258. package/dist/dataParser/types/index.d.ts +4 -0
  259. package/dist/dataParser/types/mergeDefinition.d.ts +5 -0
  260. package/dist/either/bool/falsy.cjs +1 -1
  261. package/dist/either/bool/falsy.d.ts +2 -2
  262. package/dist/either/bool/falsy.mjs +1 -1
  263. package/dist/either/bool/truthy.cjs +1 -1
  264. package/dist/either/bool/truthy.d.ts +2 -2
  265. package/dist/either/bool/truthy.mjs +1 -1
  266. package/dist/either/future/error.cjs +1 -1
  267. package/dist/either/future/error.mjs +1 -1
  268. package/dist/either/future/success.cjs +1 -1
  269. package/dist/either/future/success.mjs +1 -1
  270. package/dist/either/left/create.cjs +1 -1
  271. package/dist/either/left/create.mjs +1 -1
  272. package/dist/either/left/error.cjs +1 -1
  273. package/dist/either/left/error.mjs +1 -1
  274. package/dist/either/left/fail.cjs +1 -1
  275. package/dist/either/left/fail.mjs +1 -1
  276. package/dist/either/left/when.d.ts +2 -2
  277. package/dist/either/nullable/empty.cjs +1 -1
  278. package/dist/either/nullable/empty.d.ts +2 -2
  279. package/dist/either/nullable/empty.mjs +1 -1
  280. package/dist/either/nullable/filled.cjs +1 -1
  281. package/dist/either/nullable/filled.d.ts +2 -2
  282. package/dist/either/nullable/filled.mjs +1 -1
  283. package/dist/either/nullish/empty.cjs +1 -1
  284. package/dist/either/nullish/empty.d.ts +2 -2
  285. package/dist/either/nullish/empty.mjs +1 -1
  286. package/dist/either/nullish/filled.cjs +1 -1
  287. package/dist/either/nullish/filled.d.ts +2 -2
  288. package/dist/either/nullish/filled.mjs +1 -1
  289. package/dist/either/optional/empty.cjs +1 -1
  290. package/dist/either/optional/empty.d.ts +2 -2
  291. package/dist/either/optional/empty.mjs +1 -1
  292. package/dist/either/optional/filled.cjs +1 -1
  293. package/dist/either/optional/filled.d.ts +2 -2
  294. package/dist/either/optional/filled.mjs +1 -1
  295. package/dist/either/right/asyncPipe.d.ts +2 -2
  296. package/dist/either/right/create.cjs +1 -1
  297. package/dist/either/right/create.mjs +1 -1
  298. package/dist/either/right/ok.cjs +1 -1
  299. package/dist/either/right/ok.mjs +1 -1
  300. package/dist/either/right/success.cjs +1 -1
  301. package/dist/either/right/success.mjs +1 -1
  302. package/dist/either/right/when.d.ts +2 -2
  303. package/dist/either/whenHasInformation.d.ts +2 -2
  304. package/dist/generator/reduce.cjs +1 -1
  305. package/dist/generator/reduce.mjs +1 -1
  306. package/dist/index.cjs +18 -0
  307. package/dist/index.d.ts +6 -0
  308. package/dist/index.mjs +14 -1
  309. package/dist/object/entry.cjs +7 -0
  310. package/dist/object/entry.d.ts +2 -0
  311. package/dist/object/entry.mjs +5 -0
  312. package/dist/object/fromEntries.d.ts +1 -1
  313. package/dist/object/index.cjs +2 -0
  314. package/dist/object/index.d.ts +1 -0
  315. package/dist/object/index.mjs +1 -0
  316. package/dist/object/keys.cjs +4 -1
  317. package/dist/object/keys.d.ts +1 -1
  318. package/dist/object/keys.mjs +4 -1
  319. package/dist/object/types/getPropsWithValueExtends.d.ts +1 -1
  320. package/dist/pattern/result.cjs +1 -1
  321. package/dist/pattern/result.d.ts +1 -1
  322. package/dist/pattern/result.mjs +1 -1
  323. package/dist/pattern/when.d.ts +2 -2
  324. package/package.json +64 -3
@@ -0,0 +1,42 @@
1
+ import { escapeRegExp } from '../../common/escapeRegExp.mjs';
2
+ import { createKind } from '../../common/kind.mjs';
3
+ import { pipe } from '../../common/pipe.mjs';
4
+ import { innerPipe } from '../../common/innerPipe.mjs';
5
+ import { when as when$1 } from '../../common/when.mjs';
6
+ import { isType } from '../../common/isType.mjs';
7
+ import { whenElse } from '../../common/whenElse.mjs';
8
+ import { map } from '../../array/map.mjs';
9
+ import { join } from '../../array/join.mjs';
10
+ import { dataParserInit } from '../base.mjs';
11
+ import { SymbolDataParserErrorIssue } from '../error.mjs';
12
+ import '../../pattern/result.mjs';
13
+ import { exhaustive } from '../../pattern/exhaustive.mjs';
14
+ import { when } from '../../pattern/when.mjs';
15
+ import { replace } from '../../string/replace.mjs';
16
+ import { dataParserStringKind } from './string/index.mjs';
17
+ import { dataParserNumberKind } from './number/index.mjs';
18
+ import { dataParserBigIntKind } from './bigint/index.mjs';
19
+ import { dataParserLiteralKind } from './literal.mjs';
20
+ import { dataParserEmptyKind } from './empty.mjs';
21
+ import { dataParserNilKind } from './nil.mjs';
22
+ import { dataParserBooleanKind } from './boolean.mjs';
23
+
24
+ const dataParserTemplateLiteralKind = createKind("data-parser-template-literal");
25
+ function templateLiteral(template, definition) {
26
+ const pattern = pipe(template, map(innerPipe(when(isType("string"), (value) => `(?:${escapeRegExp(value)})`), when(dataParserNumberKind.has, () => "(:?[0-9]+)"), when(dataParserBigIntKind.has, () => "(?:[0-9]+n)"), when(dataParserBooleanKind.has, () => "(?:true|false)"), when(dataParserNilKind.has, () => "(?:null)"), when(dataParserEmptyKind.has, () => "(?:undefined)"), when(dataParserLiteralKind.has, (dataParser) => pipe(dataParser.definition.value, map(innerPipe(when$1(isType("bigint"), (value) => `${value}n`), String, escapeRegExp)), join("|"), (pattern) => `(?:${pattern})`)), when(dataParserStringKind.has, innerPipe(whenElse((dataParser) => !!dataParser.definition.checkers.length, (dataParser) => pipe(dataParser.definition.checkers, map((element) => pipe(element.definition.pattern.source, replace(/^\^/, ""), replace(/\$$/, ""))), join("")), () => "(?:[^]*)"))), when(dataParserTemplateLiteralKind.has, (dataParser) => pipe(dataParser.definition.pattern.source, replace(/^\^/, ""), replace(/\$$/, ""), (pattern) => `(?:${pattern})`)), exhaustive)), join(""), (pattern) => new RegExp(`^${pattern}$`));
27
+ return dataParserInit(dataParserTemplateLiteralKind, {
28
+ definition: {
29
+ errorMessage: definition?.errorMessage,
30
+ checkers: definition?.checkers ?? [],
31
+ template,
32
+ pattern,
33
+ },
34
+ }, (data, _error, self) => {
35
+ if (typeof data === "string" && self.definition.pattern.test(data)) {
36
+ return data;
37
+ }
38
+ return SymbolDataParserErrorIssue;
39
+ });
40
+ }
41
+
42
+ export { dataParserTemplateLiteralKind, templateLiteral };
@@ -0,0 +1,43 @@
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 dataParserTransformKind = kind.createKind("data-parser-transform");
8
+ function transform(inner, theFunction, definition) {
9
+ return base.dataParserInit(dataParserTransformKind, {
10
+ definition: {
11
+ errorMessage: definition?.errorMessage,
12
+ checkers: definition?.checkers ?? [],
13
+ inner,
14
+ theFunction,
15
+ },
16
+ }, {
17
+ sync: (data, error$1, self) => {
18
+ const innerResult = self.definition.inner.exec(data, error$1);
19
+ if (innerResult === base.SymbolDataParserError) {
20
+ return base.SymbolDataParserError;
21
+ }
22
+ const result = self.definition.theFunction(innerResult, error$1);
23
+ if (result instanceof Promise) {
24
+ return error.SymbolDataParserErrorPromiseIssue;
25
+ }
26
+ return result;
27
+ },
28
+ async: async (data, error$1, self) => {
29
+ const innerResult = await self.definition.inner.asyncExec(data, error$1);
30
+ if (innerResult === base.SymbolDataParserError) {
31
+ return base.SymbolDataParserError;
32
+ }
33
+ let result = self.definition.theFunction(innerResult, error$1);
34
+ if (result instanceof Promise) {
35
+ result = result.catch(() => error.SymbolDataParserErrorPromiseIssue);
36
+ }
37
+ return result;
38
+ },
39
+ });
40
+ }
41
+
42
+ exports.dataParserTransformKind = dataParserTransformKind;
43
+ exports.transform = transform;
@@ -0,0 +1,17 @@
1
+ import { type Kind, type NeverCoalescing } from "../../common";
2
+ import { type DataParserDefinition, type DataParser, type Input, type Output, SymbolDataParserError } from "../base";
3
+ import { type DataParsers, type MergeDefinition } from "../../dataParser/types";
4
+ import { type DataParserError, type SymbolDataParserErrorIssue, SymbolDataParserErrorPromiseIssue } from "../../dataParser/error";
5
+ export interface DataParserDefinitionTransform extends DataParserDefinition<never> {
6
+ readonly inner: DataParsers;
7
+ theFunction(input: any, error: DataParserError): unknown;
8
+ }
9
+ export declare const dataParserTransformKind: import("../../common").KindHandler<import("../../common").KindDefinition<"data-parser-transform", unknown>>;
10
+ type _DataParserTransform<GenericDefinition extends DataParserDefinitionTransform> = (DataParser<GenericDefinition, Exclude<Awaited<ReturnType<GenericDefinition["theFunction"]>>, SymbolDataParserError | SymbolDataParserErrorIssue | SymbolDataParserErrorPromiseIssue>, Input<GenericDefinition["inner"]>> & Kind<typeof dataParserTransformKind.definition>);
11
+ export interface DataParserTransform<GenericDefinition extends DataParserDefinitionTransform = DataParserDefinitionTransform> extends _DataParserTransform<GenericDefinition> {
12
+ }
13
+ export declare function transform<GenericDataParser extends DataParsers, GenericOutput extends unknown, const GenericDefinition extends Partial<Omit<DataParserDefinitionTransform, "inner" | "theFunction">> = never>(inner: GenericDataParser, theFunction: (input: Output<GenericDataParser>, error: DataParserError) => GenericOutput, definition?: GenericDefinition): DataParserTransform<MergeDefinition<DataParserDefinitionTransform, NeverCoalescing<GenericDefinition, {}> & {
14
+ inner: GenericDataParser;
15
+ theFunction(input: Output<GenericDataParser>): GenericOutput;
16
+ }>>;
17
+ export {};
@@ -0,0 +1,40 @@
1
+ import { createKind } from '../../common/kind.mjs';
2
+ import { dataParserInit, SymbolDataParserError } from '../base.mjs';
3
+ import { SymbolDataParserErrorPromiseIssue } from '../error.mjs';
4
+
5
+ const dataParserTransformKind = createKind("data-parser-transform");
6
+ function transform(inner, theFunction, definition) {
7
+ return dataParserInit(dataParserTransformKind, {
8
+ definition: {
9
+ errorMessage: definition?.errorMessage,
10
+ checkers: definition?.checkers ?? [],
11
+ inner,
12
+ theFunction,
13
+ },
14
+ }, {
15
+ sync: (data, error, self) => {
16
+ const innerResult = self.definition.inner.exec(data, error);
17
+ if (innerResult === SymbolDataParserError) {
18
+ return SymbolDataParserError;
19
+ }
20
+ const result = self.definition.theFunction(innerResult, error);
21
+ if (result instanceof Promise) {
22
+ return SymbolDataParserErrorPromiseIssue;
23
+ }
24
+ return result;
25
+ },
26
+ async: async (data, error, self) => {
27
+ const innerResult = await self.definition.inner.asyncExec(data, error);
28
+ if (innerResult === SymbolDataParserError) {
29
+ return SymbolDataParserError;
30
+ }
31
+ let result = self.definition.theFunction(innerResult, error);
32
+ if (result instanceof Promise) {
33
+ result = result.catch(() => SymbolDataParserErrorPromiseIssue);
34
+ }
35
+ return result;
36
+ },
37
+ });
38
+ }
39
+
40
+ export { dataParserTransformKind, transform };
@@ -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)
@@ -1,4 +1,4 @@
1
- import { type EscapeVoid, type AnyValue, type Unwrap } from "../../common";
1
+ import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
2
2
  import { type EitherLeft } from "../left";
3
3
  import { type EitherRight } from "../right";
4
4
  import { bool } from "./create";
@@ -13,6 +13,6 @@ export declare function boolFalsy<const GenericValue extends BoolFalsyValue = un
13
13
  type Either = EitherRight | EitherLeft;
14
14
  export declare function isBoolFalsy<GenericInput extends unknown>(input: GenericInput): input is Extract<GenericInput, EitherBoolFalsy>;
15
15
  type ToEither<GenericValue extends unknown> = GenericValue extends Either ? GenericValue : ReturnType<typeof bool<GenericValue>>;
16
- export declare function whenIsBoolFalsy<const GenericInput extends unknown, const GenericOutput extends AnyValue | EscapeVoid>(theFunction: (eitherValue: Unwrap<Extract<ToEither<GenericInput>, EitherBoolFalsy>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude<ToEither<GenericInput>, EitherBoolFalsy>;
16
+ export declare function whenIsBoolFalsy<const GenericInput extends unknown, const GenericOutput extends AnyValue | EscapeVoid>(theFunction: (eitherValue: Unwrap<Extract<ToEither<GenericInput>, EitherBoolFalsy>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude<ToEither<BreakGenericLink<GenericInput>>, EitherBoolFalsy>;
17
17
  export declare function whenIsBoolFalsy<const GenericInput extends unknown, const GenericOutput extends AnyValue | EscapeVoid>(input: GenericInput, theFunction: (eitherValue: Unwrap<Extract<ToEither<GenericInput>, EitherBoolFalsy>>) => GenericOutput): GenericOutput | Exclude<ToEither<GenericInput>, EitherBoolFalsy>;
18
18
  export {};
@@ -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)
@@ -2,7 +2,7 @@ import { type EitherRight } from "../right";
2
2
  import { bool } from "./create";
3
3
  import { type EitherLeft } from "../left";
4
4
  import { type Kind } from "../../common/kind";
5
- import { type EscapeVoid, type AnyValue, type Unwrap } from "../../common";
5
+ import { type EscapeVoid, type AnyValue, type Unwrap, type BreakGenericLink } from "../../common";
6
6
  import { eitherBoolKind } from "./base";
7
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>);
@@ -12,6 +12,6 @@ export declare function boolTruthy<const GenericValue extends unknown>(value: Ge
12
12
  type Either = EitherRight | EitherLeft;
13
13
  export declare function isBoolTruthy<GenericInput extends unknown>(input: GenericInput): input is Extract<GenericInput, EitherBoolTruthy>;
14
14
  type ToEither<GenericValue extends unknown> = GenericValue extends Either ? GenericValue : ReturnType<typeof bool<GenericValue>>;
15
- export declare function whenIsBoolTruthy<const GenericInput extends unknown, const GenericOutput extends AnyValue | EscapeVoid>(theFunction: (eitherValue: Unwrap<Extract<ToEither<GenericInput>, EitherBoolTruthy>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude<ToEither<GenericInput>, EitherBoolTruthy>;
15
+ export declare function whenIsBoolTruthy<const GenericInput extends unknown, const GenericOutput extends AnyValue | EscapeVoid>(theFunction: (eitherValue: Unwrap<Extract<ToEither<GenericInput>, EitherBoolTruthy>>) => GenericOutput): (input: GenericInput) => GenericOutput | Exclude<ToEither<BreakGenericLink<GenericInput>>, EitherBoolTruthy>;
16
16
  export declare function whenIsBoolTruthy<const GenericInput extends unknown, const GenericOutput extends AnyValue | EscapeVoid>(input: GenericInput, theFunction: (eitherValue: Unwrap<Extract<ToEither<GenericInput>, EitherBoolTruthy>>) => GenericOutput): GenericOutput | Exclude<ToEither<GenericInput>, EitherBoolTruthy>;
17
17
  export {};
@@ -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 };