ts-data-forge 14.6.4 → 14.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (573) hide show
  1. package/README.md +2 -1
  2. package/dist/array/impl/array-utils-length-bounded-array-cast.d.mts +36 -6
  3. package/dist/array/impl/array-utils-length-bounded-array-cast.d.mts.map +1 -1
  4. package/dist/array/impl/array-utils-length-bounded-array-cast.mjs +4 -0
  5. package/dist/array/impl/array-utils-length-bounded-array-cast.mjs.map +1 -1
  6. package/dist/array/impl/array-utils-length-bounded-tuple-cast.d.mts +26 -6
  7. package/dist/array/impl/array-utils-length-bounded-tuple-cast.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-length-bounded-tuple-cast.mjs +4 -0
  9. package/dist/array/impl/array-utils-length-bounded-tuple-cast.mjs.map +1 -1
  10. package/dist/expect-type.d.mts +2 -70
  11. package/dist/expect-type.d.mts.map +1 -1
  12. package/dist/expect-type.mjs +1 -68
  13. package/dist/expect-type.mjs.map +1 -1
  14. package/dist/functional/index.d.mts +11 -6
  15. package/dist/functional/index.d.mts.map +1 -1
  16. package/dist/functional/index.mjs +10 -6
  17. package/dist/functional/index.mjs.map +1 -1
  18. package/dist/guard/has-key.d.mts +2 -51
  19. package/dist/guard/has-key.d.mts.map +1 -1
  20. package/dist/guard/has-key.mjs +1 -41
  21. package/dist/guard/has-key.mjs.map +1 -1
  22. package/dist/guard/is-non-null-object.d.mts +2 -34
  23. package/dist/guard/is-non-null-object.d.mts.map +1 -1
  24. package/dist/guard/is-non-null-object.mjs +1 -34
  25. package/dist/guard/is-non-null-object.mjs.map +1 -1
  26. package/dist/guard/is-record.d.mts +2 -89
  27. package/dist/guard/is-record.d.mts.map +1 -1
  28. package/dist/guard/is-record.mjs +1 -88
  29. package/dist/guard/is-record.mjs.map +1 -1
  30. package/dist/guard/key-is-in.d.mts +2 -42
  31. package/dist/guard/key-is-in.d.mts.map +1 -1
  32. package/dist/guard/key-is-in.mjs +1 -40
  33. package/dist/guard/key-is-in.mjs.map +1 -1
  34. package/dist/index.d.mts +2 -0
  35. package/dist/index.d.mts.map +1 -1
  36. package/dist/index.mjs +2 -0
  37. package/dist/index.mjs.map +1 -1
  38. package/dist/number/num.d.mts +9 -1
  39. package/dist/number/num.d.mts.map +1 -1
  40. package/dist/number/num.mjs +24 -16
  41. package/dist/number/num.mjs.map +1 -1
  42. package/dist/others/index.d.mts +1 -0
  43. package/dist/others/index.d.mts.map +1 -1
  44. package/dist/others/index.mjs +1 -0
  45. package/dist/others/index.mjs.map +1 -1
  46. package/dist/others/panic-error.d.mts +9 -0
  47. package/dist/others/panic-error.d.mts.map +1 -0
  48. package/dist/others/panic-error.mjs +9 -0
  49. package/dist/others/panic-error.mjs.map +1 -0
  50. package/dist/others/unknown-to-string.d.mts +2 -37
  51. package/dist/others/unknown-to-string.d.mts.map +1 -1
  52. package/dist/others/unknown-to-string.mjs +1 -92
  53. package/dist/others/unknown-to-string.mjs.map +1 -1
  54. package/dist/types.d.mts +1 -41
  55. package/dist/types.d.mts.map +1 -1
  56. package/dist/types.mjs +0 -1
  57. package/dist/types.mjs.map +1 -1
  58. package/package.json +9 -9
  59. package/src/array/impl/array-utils-length-bounded-array-cast.mts +36 -6
  60. package/src/array/impl/array-utils-length-bounded-tuple-cast.mts +26 -6
  61. package/src/expect-type.mts +2 -78
  62. package/src/functional/index.mts +31 -6
  63. package/src/guard/has-key.mts +2 -72
  64. package/src/guard/is-non-null-object.mts +2 -36
  65. package/src/guard/is-record.mts +2 -95
  66. package/src/guard/key-is-in.mts +2 -49
  67. package/src/index.mts +2 -0
  68. package/src/number/num.mts +36 -28
  69. package/src/others/index.mts +1 -0
  70. package/src/others/panic-error.mts +8 -0
  71. package/src/others/unknown-to-string.mts +2 -111
  72. package/src/types.mts +4 -54
  73. package/dist/functional/async-result/async-result.d.mts +0 -16
  74. package/dist/functional/async-result/async-result.d.mts.map +0 -1
  75. package/dist/functional/async-result/async-result.mjs +0 -2
  76. package/dist/functional/async-result/async-result.mjs.map +0 -1
  77. package/dist/functional/async-result/impl/async-result-flat-map.d.mts +0 -39
  78. package/dist/functional/async-result/impl/async-result-flat-map.d.mts.map +0 -1
  79. package/dist/functional/async-result/impl/async-result-flat-map.mjs +0 -23
  80. package/dist/functional/async-result/impl/async-result-flat-map.mjs.map +0 -1
  81. package/dist/functional/async-result/impl/async-result-from-promise.d.mts +0 -47
  82. package/dist/functional/async-result/impl/async-result-from-promise.d.mts.map +0 -1
  83. package/dist/functional/async-result/impl/async-result-from-promise.mjs +0 -10
  84. package/dist/functional/async-result/impl/async-result-from-promise.mjs.map +0 -1
  85. package/dist/functional/async-result/impl/async-result-from-throwable.d.mts +0 -53
  86. package/dist/functional/async-result/impl/async-result-from-throwable.d.mts.map +0 -1
  87. package/dist/functional/async-result/impl/async-result-from-throwable.mjs +0 -15
  88. package/dist/functional/async-result/impl/async-result-from-throwable.mjs.map +0 -1
  89. package/dist/functional/async-result/impl/async-result-map-err.d.mts +0 -35
  90. package/dist/functional/async-result/impl/async-result-map-err.d.mts.map +0 -1
  91. package/dist/functional/async-result/impl/async-result-map-err.mjs +0 -20
  92. package/dist/functional/async-result/impl/async-result-map-err.mjs.map +0 -1
  93. package/dist/functional/async-result/impl/async-result-map.d.mts +0 -45
  94. package/dist/functional/async-result/impl/async-result-map.d.mts.map +0 -1
  95. package/dist/functional/async-result/impl/async-result-map.mjs +0 -20
  96. package/dist/functional/async-result/impl/async-result-map.mjs.map +0 -1
  97. package/dist/functional/async-result/impl/async-result-unwrap-or.d.mts +0 -34
  98. package/dist/functional/async-result/impl/async-result-unwrap-or.d.mts.map +0 -1
  99. package/dist/functional/async-result/impl/async-result-unwrap-or.mjs +0 -37
  100. package/dist/functional/async-result/impl/async-result-unwrap-or.mjs.map +0 -1
  101. package/dist/functional/async-result/impl/index.d.mts +0 -8
  102. package/dist/functional/async-result/impl/index.d.mts.map +0 -1
  103. package/dist/functional/async-result/impl/index.mjs +0 -8
  104. package/dist/functional/async-result/impl/index.mjs.map +0 -1
  105. package/dist/functional/async-result/impl/types.d.mts +0 -45
  106. package/dist/functional/async-result/impl/types.d.mts.map +0 -1
  107. package/dist/functional/async-result/impl/types.mjs +0 -2
  108. package/dist/functional/async-result/impl/types.mjs.map +0 -1
  109. package/dist/functional/async-result/index.d.mts +0 -2
  110. package/dist/functional/async-result/index.d.mts.map +0 -1
  111. package/dist/functional/async-result/index.mjs +0 -2
  112. package/dist/functional/async-result/index.mjs.map +0 -1
  113. package/dist/functional/match.d.mts +0 -80
  114. package/dist/functional/match.d.mts.map +0 -1
  115. package/dist/functional/match.mjs +0 -31
  116. package/dist/functional/match.mjs.map +0 -1
  117. package/dist/functional/optional/impl/index.d.mts +0 -19
  118. package/dist/functional/optional/impl/index.d.mts.map +0 -1
  119. package/dist/functional/optional/impl/index.mjs +0 -19
  120. package/dist/functional/optional/impl/index.mjs.map +0 -1
  121. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +0 -37
  122. package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +0 -1
  123. package/dist/functional/optional/impl/optional-expect-to-be.mjs +0 -22
  124. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +0 -1
  125. package/dist/functional/optional/impl/optional-filter.d.mts +0 -33
  126. package/dist/functional/optional/impl/optional-filter.d.mts.map +0 -1
  127. package/dist/functional/optional/impl/optional-filter.mjs +0 -25
  128. package/dist/functional/optional/impl/optional-filter.mjs.map +0 -1
  129. package/dist/functional/optional/impl/optional-flat-map.d.mts +0 -39
  130. package/dist/functional/optional/impl/optional-flat-map.d.mts.map +0 -1
  131. package/dist/functional/optional/impl/optional-flat-map.mjs +0 -18
  132. package/dist/functional/optional/impl/optional-flat-map.mjs.map +0 -1
  133. package/dist/functional/optional/impl/optional-from-nullable.d.mts +0 -27
  134. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +0 -1
  135. package/dist/functional/optional/impl/optional-from-nullable.mjs +0 -28
  136. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +0 -1
  137. package/dist/functional/optional/impl/optional-is-none.d.mts +0 -23
  138. package/dist/functional/optional/impl/optional-is-none.d.mts.map +0 -1
  139. package/dist/functional/optional/impl/optional-is-none.mjs +0 -22
  140. package/dist/functional/optional/impl/optional-is-none.mjs.map +0 -1
  141. package/dist/functional/optional/impl/optional-is-optional.d.mts +0 -21
  142. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +0 -1
  143. package/dist/functional/optional/impl/optional-is-optional.mjs +0 -26
  144. package/dist/functional/optional/impl/optional-is-optional.mjs.map +0 -1
  145. package/dist/functional/optional/impl/optional-is-some.d.mts +0 -24
  146. package/dist/functional/optional/impl/optional-is-some.d.mts.map +0 -1
  147. package/dist/functional/optional/impl/optional-is-some.mjs +0 -23
  148. package/dist/functional/optional/impl/optional-is-some.mjs.map +0 -1
  149. package/dist/functional/optional/impl/optional-map.d.mts +0 -34
  150. package/dist/functional/optional/impl/optional-map.d.mts.map +0 -1
  151. package/dist/functional/optional/impl/optional-map.mjs +0 -22
  152. package/dist/functional/optional/impl/optional-map.mjs.map +0 -1
  153. package/dist/functional/optional/impl/optional-match.d.mts +0 -48
  154. package/dist/functional/optional/impl/optional-match.d.mts.map +0 -1
  155. package/dist/functional/optional/impl/optional-match.mjs +0 -20
  156. package/dist/functional/optional/impl/optional-match.mjs.map +0 -1
  157. package/dist/functional/optional/impl/optional-none.d.mts +0 -19
  158. package/dist/functional/optional/impl/optional-none.d.mts.map +0 -1
  159. package/dist/functional/optional/impl/optional-none.mjs +0 -19
  160. package/dist/functional/optional/impl/optional-none.mjs.map +0 -1
  161. package/dist/functional/optional/impl/optional-or-else.d.mts +0 -43
  162. package/dist/functional/optional/impl/optional-or-else.d.mts.map +0 -1
  163. package/dist/functional/optional/impl/optional-or-else.mjs +0 -16
  164. package/dist/functional/optional/impl/optional-or-else.mjs.map +0 -1
  165. package/dist/functional/optional/impl/optional-some.d.mts +0 -22
  166. package/dist/functional/optional/impl/optional-some.d.mts.map +0 -1
  167. package/dist/functional/optional/impl/optional-some.mjs +0 -25
  168. package/dist/functional/optional/impl/optional-some.mjs.map +0 -1
  169. package/dist/functional/optional/impl/optional-to-nullable.d.mts +0 -30
  170. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +0 -1
  171. package/dist/functional/optional/impl/optional-to-nullable.mjs +0 -30
  172. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +0 -1
  173. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +0 -37
  174. package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +0 -1
  175. package/dist/functional/optional/impl/optional-unwrap-or.mjs +0 -16
  176. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +0 -1
  177. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +0 -31
  178. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +0 -1
  179. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +0 -36
  180. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +0 -1
  181. package/dist/functional/optional/impl/optional-unwrap.d.mts +0 -32
  182. package/dist/functional/optional/impl/optional-unwrap.d.mts.map +0 -1
  183. package/dist/functional/optional/impl/optional-unwrap.mjs +0 -8
  184. package/dist/functional/optional/impl/optional-unwrap.mjs.map +0 -1
  185. package/dist/functional/optional/impl/optional-zip.d.mts +0 -35
  186. package/dist/functional/optional/impl/optional-zip.d.mts.map +0 -1
  187. package/dist/functional/optional/impl/optional-zip.mjs +0 -39
  188. package/dist/functional/optional/impl/optional-zip.mjs.map +0 -1
  189. package/dist/functional/optional/impl/tag.d.mts +0 -6
  190. package/dist/functional/optional/impl/tag.d.mts.map +0 -1
  191. package/dist/functional/optional/impl/tag.mjs +0 -4
  192. package/dist/functional/optional/impl/tag.mjs.map +0 -1
  193. package/dist/functional/optional/impl/types.d.mts +0 -24
  194. package/dist/functional/optional/impl/types.d.mts.map +0 -1
  195. package/dist/functional/optional/impl/types.mjs +0 -2
  196. package/dist/functional/optional/impl/types.mjs.map +0 -1
  197. package/dist/functional/optional/index.d.mts +0 -2
  198. package/dist/functional/optional/index.d.mts.map +0 -1
  199. package/dist/functional/optional/index.mjs +0 -2
  200. package/dist/functional/optional/index.mjs.map +0 -1
  201. package/dist/functional/optional/optional.d.mts +0 -16
  202. package/dist/functional/optional/optional.d.mts.map +0 -1
  203. package/dist/functional/optional/optional.mjs +0 -2
  204. package/dist/functional/optional/optional.mjs.map +0 -1
  205. package/dist/functional/pipe.d.mts +0 -102
  206. package/dist/functional/pipe.d.mts.map +0 -1
  207. package/dist/functional/pipe.mjs +0 -45
  208. package/dist/functional/pipe.mjs.map +0 -1
  209. package/dist/functional/result/impl/index.d.mts +0 -28
  210. package/dist/functional/result/impl/index.d.mts.map +0 -1
  211. package/dist/functional/result/impl/index.mjs +0 -28
  212. package/dist/functional/result/impl/index.mjs.map +0 -1
  213. package/dist/functional/result/impl/result-err.d.mts +0 -28
  214. package/dist/functional/result/impl/result-err.d.mts.map +0 -1
  215. package/dist/functional/result/impl/result-err.mjs +0 -31
  216. package/dist/functional/result/impl/result-err.mjs.map +0 -1
  217. package/dist/functional/result/impl/result-expect-to-be.d.mts +0 -33
  218. package/dist/functional/result/impl/result-expect-to-be.d.mts.map +0 -1
  219. package/dist/functional/result/impl/result-expect-to-be.mjs +0 -23
  220. package/dist/functional/result/impl/result-expect-to-be.mjs.map +0 -1
  221. package/dist/functional/result/impl/result-flat-map.d.mts +0 -45
  222. package/dist/functional/result/impl/result-flat-map.d.mts.map +0 -1
  223. package/dist/functional/result/impl/result-flat-map.mjs +0 -21
  224. package/dist/functional/result/impl/result-flat-map.mjs.map +0 -1
  225. package/dist/functional/result/impl/result-fold.d.mts +0 -50
  226. package/dist/functional/result/impl/result-fold.d.mts.map +0 -1
  227. package/dist/functional/result/impl/result-fold.mjs +0 -23
  228. package/dist/functional/result/impl/result-fold.mjs.map +0 -1
  229. package/dist/functional/result/impl/result-from-optional.d.mts +0 -41
  230. package/dist/functional/result/impl/result-from-optional.d.mts.map +0 -1
  231. package/dist/functional/result/impl/result-from-optional.mjs +0 -21
  232. package/dist/functional/result/impl/result-from-optional.mjs.map +0 -1
  233. package/dist/functional/result/impl/result-from-promise.d.mts +0 -43
  234. package/dist/functional/result/impl/result-from-promise.d.mts.map +0 -1
  235. package/dist/functional/result/impl/result-from-promise.mjs +0 -39
  236. package/dist/functional/result/impl/result-from-promise.mjs.map +0 -1
  237. package/dist/functional/result/impl/result-from-throwable.d.mts +0 -32
  238. package/dist/functional/result/impl/result-from-throwable.d.mts.map +0 -1
  239. package/dist/functional/result/impl/result-from-throwable.mjs +0 -46
  240. package/dist/functional/result/impl/result-from-throwable.mjs.map +0 -1
  241. package/dist/functional/result/impl/result-is-err.d.mts +0 -23
  242. package/dist/functional/result/impl/result-is-err.d.mts.map +0 -1
  243. package/dist/functional/result/impl/result-is-err.mjs +0 -22
  244. package/dist/functional/result/impl/result-is-err.mjs.map +0 -1
  245. package/dist/functional/result/impl/result-is-ok.d.mts +0 -23
  246. package/dist/functional/result/impl/result-is-ok.d.mts.map +0 -1
  247. package/dist/functional/result/impl/result-is-ok.mjs +0 -22
  248. package/dist/functional/result/impl/result-is-ok.mjs.map +0 -1
  249. package/dist/functional/result/impl/result-is-result.d.mts +0 -22
  250. package/dist/functional/result/impl/result-is-result.d.mts.map +0 -1
  251. package/dist/functional/result/impl/result-is-result.mjs +0 -26
  252. package/dist/functional/result/impl/result-is-result.mjs.map +0 -1
  253. package/dist/functional/result/impl/result-map-err.d.mts +0 -39
  254. package/dist/functional/result/impl/result-map-err.d.mts.map +0 -1
  255. package/dist/functional/result/impl/result-map-err.mjs +0 -22
  256. package/dist/functional/result/impl/result-map-err.mjs.map +0 -1
  257. package/dist/functional/result/impl/result-map.d.mts +0 -39
  258. package/dist/functional/result/impl/result-map.d.mts.map +0 -1
  259. package/dist/functional/result/impl/result-map.mjs +0 -22
  260. package/dist/functional/result/impl/result-map.mjs.map +0 -1
  261. package/dist/functional/result/impl/result-match.d.mts +0 -47
  262. package/dist/functional/result/impl/result-match.d.mts.map +0 -1
  263. package/dist/functional/result/impl/result-match.mjs +0 -20
  264. package/dist/functional/result/impl/result-match.mjs.map +0 -1
  265. package/dist/functional/result/impl/result-ok.d.mts +0 -28
  266. package/dist/functional/result/impl/result-ok.d.mts.map +0 -1
  267. package/dist/functional/result/impl/result-ok.mjs +0 -31
  268. package/dist/functional/result/impl/result-ok.mjs.map +0 -1
  269. package/dist/functional/result/impl/result-or-else.d.mts +0 -40
  270. package/dist/functional/result/impl/result-or-else.d.mts.map +0 -1
  271. package/dist/functional/result/impl/result-or-else.mjs +0 -17
  272. package/dist/functional/result/impl/result-or-else.mjs.map +0 -1
  273. package/dist/functional/result/impl/result-safe-try.d.mts +0 -51
  274. package/dist/functional/result/impl/result-safe-try.d.mts.map +0 -1
  275. package/dist/functional/result/impl/result-safe-try.mjs +0 -35
  276. package/dist/functional/result/impl/result-safe-try.mjs.map +0 -1
  277. package/dist/functional/result/impl/result-safe-unwrap.d.mts +0 -36
  278. package/dist/functional/result/impl/result-safe-unwrap.d.mts.map +0 -1
  279. package/dist/functional/result/impl/result-safe-unwrap.mjs +0 -42
  280. package/dist/functional/result/impl/result-safe-unwrap.mjs.map +0 -1
  281. package/dist/functional/result/impl/result-swap.d.mts +0 -23
  282. package/dist/functional/result/impl/result-swap.d.mts.map +0 -1
  283. package/dist/functional/result/impl/result-swap.mjs +0 -27
  284. package/dist/functional/result/impl/result-swap.mjs.map +0 -1
  285. package/dist/functional/result/impl/result-to-optional.d.mts +0 -32
  286. package/dist/functional/result/impl/result-to-optional.d.mts.map +0 -1
  287. package/dist/functional/result/impl/result-to-optional.mjs +0 -32
  288. package/dist/functional/result/impl/result-to-optional.mjs.map +0 -1
  289. package/dist/functional/result/impl/result-unwrap-err-or.d.mts +0 -33
  290. package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +0 -1
  291. package/dist/functional/result/impl/result-unwrap-err-or.mjs +0 -17
  292. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +0 -1
  293. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +0 -33
  294. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +0 -1
  295. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +0 -46
  296. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +0 -1
  297. package/dist/functional/result/impl/result-unwrap-err.d.mts +0 -33
  298. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +0 -1
  299. package/dist/functional/result/impl/result-unwrap-err.mjs +0 -34
  300. package/dist/functional/result/impl/result-unwrap-err.mjs.map +0 -1
  301. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +0 -33
  302. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +0 -1
  303. package/dist/functional/result/impl/result-unwrap-ok-or.mjs +0 -17
  304. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +0 -1
  305. package/dist/functional/result/impl/result-unwrap-ok.d.mts +0 -26
  306. package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +0 -1
  307. package/dist/functional/result/impl/result-unwrap-ok.mjs +0 -8
  308. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +0 -1
  309. package/dist/functional/result/impl/result-unwrap-throw.d.mts +0 -33
  310. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +0 -1
  311. package/dist/functional/result/impl/result-unwrap-throw.mjs +0 -40
  312. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +0 -1
  313. package/dist/functional/result/impl/result-zip.d.mts +0 -32
  314. package/dist/functional/result/impl/result-zip.d.mts.map +0 -1
  315. package/dist/functional/result/impl/result-zip.mjs +0 -37
  316. package/dist/functional/result/impl/result-zip.mjs.map +0 -1
  317. package/dist/functional/result/impl/tag.d.mts +0 -6
  318. package/dist/functional/result/impl/tag.d.mts.map +0 -1
  319. package/dist/functional/result/impl/tag.mjs +0 -4
  320. package/dist/functional/result/impl/tag.mjs.map +0 -1
  321. package/dist/functional/result/impl/types.d.mts +0 -31
  322. package/dist/functional/result/impl/types.d.mts.map +0 -1
  323. package/dist/functional/result/impl/types.mjs +0 -2
  324. package/dist/functional/result/impl/types.mjs.map +0 -1
  325. package/dist/functional/result/index.d.mts +0 -2
  326. package/dist/functional/result/index.d.mts.map +0 -1
  327. package/dist/functional/result/index.mjs +0 -2
  328. package/dist/functional/result/index.mjs.map +0 -1
  329. package/dist/functional/result/result.d.mts +0 -16
  330. package/dist/functional/result/result.d.mts.map +0 -1
  331. package/dist/functional/result/result.mjs +0 -2
  332. package/dist/functional/result/result.mjs.map +0 -1
  333. package/dist/functional/ternary-result/impl/index.d.mts +0 -29
  334. package/dist/functional/ternary-result/impl/index.d.mts.map +0 -1
  335. package/dist/functional/ternary-result/impl/index.mjs +0 -29
  336. package/dist/functional/ternary-result/impl/index.mjs.map +0 -1
  337. package/dist/functional/ternary-result/impl/tag.d.mts +0 -8
  338. package/dist/functional/ternary-result/impl/tag.d.mts.map +0 -1
  339. package/dist/functional/ternary-result/impl/tag.mjs +0 -6
  340. package/dist/functional/ternary-result/impl/tag.mjs.map +0 -1
  341. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +0 -16
  342. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +0 -1
  343. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +0 -19
  344. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +0 -1
  345. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +0 -24
  346. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +0 -1
  347. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +0 -21
  348. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +0 -1
  349. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +0 -39
  350. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +0 -1
  351. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +0 -38
  352. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +0 -1
  353. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +0 -30
  354. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +0 -1
  355. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +0 -33
  356. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +0 -1
  357. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +0 -23
  358. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +0 -1
  359. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +0 -23
  360. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +0 -1
  361. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +0 -20
  362. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +0 -1
  363. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +0 -33
  364. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +0 -1
  365. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts +0 -21
  366. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +0 -1
  367. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +0 -20
  368. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +0 -1
  369. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +0 -23
  370. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +0 -1
  371. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +0 -22
  372. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +0 -1
  373. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +0 -22
  374. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +0 -1
  375. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +0 -28
  376. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +0 -1
  377. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +0 -22
  378. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +0 -1
  379. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +0 -21
  380. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +0 -1
  381. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +0 -27
  382. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +0 -1
  383. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +0 -23
  384. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +0 -1
  385. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +0 -28
  386. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +0 -1
  387. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +0 -26
  388. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +0 -1
  389. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +0 -36
  390. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +0 -1
  391. package/dist/functional/ternary-result/impl/ternary-result-map.mjs +0 -32
  392. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +0 -1
  393. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +0 -17
  394. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +0 -1
  395. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +0 -20
  396. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +0 -1
  397. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +0 -29
  398. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +0 -1
  399. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +0 -16
  400. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +0 -1
  401. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +0 -23
  402. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +0 -1
  403. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +0 -26
  404. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +0 -1
  405. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +0 -28
  406. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +0 -1
  407. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +0 -14
  408. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +0 -1
  409. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +0 -20
  410. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +0 -1
  411. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +0 -34
  412. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +0 -1
  413. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +0 -20
  414. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +0 -1
  415. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +0 -21
  416. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +0 -1
  417. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +0 -25
  418. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +0 -1
  419. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +0 -14
  420. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +0 -1
  421. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +0 -20
  422. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +0 -1
  423. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +0 -10
  424. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +0 -1
  425. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +0 -21
  426. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +0 -1
  427. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +0 -35
  428. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +0 -1
  429. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +0 -22
  430. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +0 -1
  431. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +0 -14
  432. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +0 -1
  433. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +0 -20
  434. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +0 -1
  435. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +0 -30
  436. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +0 -1
  437. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +0 -20
  438. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +0 -1
  439. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +0 -21
  440. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +0 -1
  441. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +0 -19
  442. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +0 -1
  443. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +0 -23
  444. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +0 -1
  445. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +0 -34
  446. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +0 -1
  447. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +0 -52
  448. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +0 -1
  449. package/dist/functional/ternary-result/impl/types.d.mts +0 -26
  450. package/dist/functional/ternary-result/impl/types.d.mts.map +0 -1
  451. package/dist/functional/ternary-result/impl/types.mjs +0 -2
  452. package/dist/functional/ternary-result/impl/types.mjs.map +0 -1
  453. package/dist/functional/ternary-result/impl/variant-name.d.mts +0 -4
  454. package/dist/functional/ternary-result/impl/variant-name.d.mts.map +0 -1
  455. package/dist/functional/ternary-result/impl/variant-name.mjs +0 -13
  456. package/dist/functional/ternary-result/impl/variant-name.mjs.map +0 -1
  457. package/dist/functional/ternary-result/index.d.mts +0 -2
  458. package/dist/functional/ternary-result/index.d.mts.map +0 -1
  459. package/dist/functional/ternary-result/index.mjs +0 -2
  460. package/dist/functional/ternary-result/index.mjs.map +0 -1
  461. package/dist/functional/ternary-result/ternary-result.d.mts +0 -40
  462. package/dist/functional/ternary-result/ternary-result.d.mts.map +0 -1
  463. package/dist/functional/ternary-result/ternary-result.mjs +0 -2
  464. package/dist/functional/ternary-result/ternary-result.mjs.map +0 -1
  465. package/src/functional/async-result/async-result.mts +0 -17
  466. package/src/functional/async-result/impl/async-result-flat-map.mts +0 -99
  467. package/src/functional/async-result/impl/async-result-from-promise.mts +0 -69
  468. package/src/functional/async-result/impl/async-result-from-throwable.mts +0 -78
  469. package/src/functional/async-result/impl/async-result-map-err.mts +0 -84
  470. package/src/functional/async-result/impl/async-result-map.mts +0 -94
  471. package/src/functional/async-result/impl/async-result-unwrap-or.mts +0 -42
  472. package/src/functional/async-result/impl/index.mts +0 -7
  473. package/src/functional/async-result/impl/types.mts +0 -51
  474. package/src/functional/async-result/index.mts +0 -1
  475. package/src/functional/async-result.test.mts +0 -291
  476. package/src/functional/match.mts +0 -193
  477. package/src/functional/match.test.mts +0 -180
  478. package/src/functional/optional/impl/index.mts +0 -18
  479. package/src/functional/optional/impl/optional-expect-to-be.mts +0 -75
  480. package/src/functional/optional/impl/optional-filter.mts +0 -78
  481. package/src/functional/optional/impl/optional-flat-map.mts +0 -75
  482. package/src/functional/optional/impl/optional-from-nullable.mts +0 -31
  483. package/src/functional/optional/impl/optional-is-none.mts +0 -26
  484. package/src/functional/optional/impl/optional-is-optional.mts +0 -30
  485. package/src/functional/optional/impl/optional-is-some.mts +0 -27
  486. package/src/functional/optional/impl/optional-map.mts +0 -90
  487. package/src/functional/optional/impl/optional-match.mts +0 -108
  488. package/src/functional/optional/impl/optional-none.mts +0 -20
  489. package/src/functional/optional/impl/optional-or-else.mts +0 -83
  490. package/src/functional/optional/impl/optional-some.mts +0 -27
  491. package/src/functional/optional/impl/optional-to-nullable.mts +0 -34
  492. package/src/functional/optional/impl/optional-unwrap-or.mts +0 -70
  493. package/src/functional/optional/impl/optional-unwrap-throw.mts +0 -41
  494. package/src/functional/optional/impl/optional-unwrap.mts +0 -45
  495. package/src/functional/optional/impl/optional-zip.mts +0 -44
  496. package/src/functional/optional/impl/tag.mts +0 -8
  497. package/src/functional/optional/impl/types.mts +0 -31
  498. package/src/functional/optional/index.mts +0 -1
  499. package/src/functional/optional/optional.mts +0 -19
  500. package/src/functional/optional.test.mts +0 -883
  501. package/src/functional/pipe.mts +0 -180
  502. package/src/functional/pipe.test.mts +0 -155
  503. package/src/functional/result/impl/index.mts +0 -27
  504. package/src/functional/result/impl/result-err.mts +0 -33
  505. package/src/functional/result/impl/result-expect-to-be.mts +0 -73
  506. package/src/functional/result/impl/result-flat-map.mts +0 -88
  507. package/src/functional/result/impl/result-fold.mts +0 -102
  508. package/src/functional/result/impl/result-from-optional.mts +0 -80
  509. package/src/functional/result/impl/result-from-promise.mts +0 -51
  510. package/src/functional/result/impl/result-from-throwable.mts +0 -48
  511. package/src/functional/result/impl/result-is-err.mts +0 -26
  512. package/src/functional/result/impl/result-is-ok.mts +0 -26
  513. package/src/functional/result/impl/result-is-result.mts +0 -28
  514. package/src/functional/result/impl/result-map-err.mts +0 -96
  515. package/src/functional/result/impl/result-map.mts +0 -96
  516. package/src/functional/result/impl/result-match.mts +0 -108
  517. package/src/functional/result/impl/result-ok.mts +0 -33
  518. package/src/functional/result/impl/result-or-else.mts +0 -73
  519. package/src/functional/result/impl/result-safe-try.mts +0 -110
  520. package/src/functional/result/impl/result-safe-unwrap.mts +0 -50
  521. package/src/functional/result/impl/result-swap.mts +0 -31
  522. package/src/functional/result/impl/result-to-optional.mts +0 -37
  523. package/src/functional/result/impl/result-unwrap-err-or.mts +0 -66
  524. package/src/functional/result/impl/result-unwrap-err-throw.mts +0 -56
  525. package/src/functional/result/impl/result-unwrap-err.mts +0 -38
  526. package/src/functional/result/impl/result-unwrap-ok-or.mts +0 -66
  527. package/src/functional/result/impl/result-unwrap-ok.mts +0 -39
  528. package/src/functional/result/impl/result-unwrap-throw.mts +0 -46
  529. package/src/functional/result/impl/result-zip.mts +0 -42
  530. package/src/functional/result/impl/tag.mts +0 -8
  531. package/src/functional/result/impl/types.mts +0 -38
  532. package/src/functional/result/index.mts +0 -1
  533. package/src/functional/result/result.mts +0 -19
  534. package/src/functional/result.test.mts +0 -1349
  535. package/src/functional/ternary-result/impl/index.mts +0 -28
  536. package/src/functional/ternary-result/impl/tag.mts +0 -17
  537. package/src/functional/ternary-result/impl/ternary-result-err.mts +0 -21
  538. package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +0 -65
  539. package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +0 -112
  540. package/src/functional/ternary-result/impl/ternary-result-fold.mts +0 -102
  541. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +0 -30
  542. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +0 -36
  543. package/src/functional/ternary-result/impl/ternary-result-is-err.mts +0 -24
  544. package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +0 -26
  545. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +0 -32
  546. package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +0 -25
  547. package/src/functional/ternary-result/impl/ternary-result-map-err.mts +0 -74
  548. package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +0 -79
  549. package/src/functional/ternary-result/impl/ternary-result-map.mts +0 -95
  550. package/src/functional/ternary-result/impl/ternary-result-ok.mts +0 -22
  551. package/src/functional/ternary-result/impl/ternary-result-or-else.mts +0 -72
  552. package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +0 -31
  553. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +0 -54
  554. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +0 -42
  555. package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +0 -25
  556. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +0 -51
  557. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +0 -39
  558. package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +0 -48
  559. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +0 -48
  560. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +0 -40
  561. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +0 -25
  562. package/src/functional/ternary-result/impl/ternary-result-warn.mts +0 -28
  563. package/src/functional/ternary-result/impl/ternary-result-zip.mts +0 -61
  564. package/src/functional/ternary-result/impl/types.mts +0 -46
  565. package/src/functional/ternary-result/impl/variant-name.mts +0 -18
  566. package/src/functional/ternary-result/index.mts +0 -1
  567. package/src/functional/ternary-result/ternary-result.mts +0 -50
  568. package/src/functional/ternary-result.test.mts +0 -310
  569. package/src/guard/has-key.test.mts +0 -111
  570. package/src/guard/is-non-null-object.test.mts +0 -109
  571. package/src/guard/is-record.test.mts +0 -195
  572. package/src/guard/key-is-in.test.mts +0 -21
  573. package/src/others/unknown-to-string.test.mts +0 -295
@@ -1,22 +0,0 @@
1
- import { type Some } from '../../../types.mjs';
2
- /**
3
- * Creates an {@link Some} containing the given value.
4
- *
5
- * @example
6
- *
7
- * ```ts
8
- * const someValue = Optional.some({ id: 1 });
9
- *
10
- * const noneValue = Optional.none;
11
- *
12
- * assert.isTrue(Optional.isSome(someValue));
13
- *
14
- * assert.isTrue(Optional.isNone(noneValue));
15
- * ```
16
- *
17
- * @template S The type of the value.
18
- * @param value The value to wrap in an {@link Some}.
19
- * @returns An {@link Some}<S> containing the value.
20
- */
21
- export declare const some: <const S>(value: S) => Some<S>;
22
- //# sourceMappingURL=optional-some.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-some.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-some.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,CAAC,SAAU,CAAC,KAAG,IAAI,CAAC,CAAC,CAInC,CAAC"}
@@ -1,25 +0,0 @@
1
- import { SomeTypeTagName } from './tag.mjs';
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
- export const some = (value) => ({
22
- $$tag: SomeTypeTagName,
23
- value,
24
- });
25
- //# sourceMappingURL=optional-some.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-some.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-some.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAW,KAAQ,EAAW,EAAE,CAClD,CAAC;IACC,KAAK,EAAE,eAAe;IACtB,KAAK;CACN,CAAU,CAAC"}
@@ -1,30 +0,0 @@
1
- import { type UnknownOptional } from '../optional.mjs';
2
- import { type Unwrap } from './types.mjs';
3
- /**
4
- * Converts an `Optional` to a nullable value.
5
- *
6
- * This function extracts the value from an Optional, returning `undefined`
7
- * for empty Optionals. This is useful when interfacing with APIs or systems
8
- * that expect nullable values rather than Optional types.
9
- *
10
- * Note: This returns `undefined` (not `null`) for consistency with
11
- * JavaScript's undefined semantics and TypeScript's optional properties.
12
- *
13
- * @example
14
- *
15
- * ```ts
16
- * const someNumber = Optional.some(42);
17
- *
18
- * const noneNumber = Optional.none as Optional<number>;
19
- *
20
- * assert.isTrue(Optional.toNullable(someNumber) === 42);
21
- *
22
- * assert.isTrue(Optional.toNullable(noneNumber) === undefined);
23
- * ```
24
- *
25
- * @template O The `UnknownOptional` type to convert.
26
- * @param optional The `Optional` to convert.
27
- * @returns The contained value if `Some`, otherwise `undefined`.
28
- */
29
- export declare const toNullable: <O extends UnknownOptional>(optional: O) => Unwrap<O> | undefined;
30
- //# sourceMappingURL=optional-to-nullable.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-to-nullable.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-to-nullable.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,eAAe,YACxC,CAAC,KACV,MAAM,CAAC,CAAC,CAAC,GAAG,SAA8D,CAAC"}
@@ -1,30 +0,0 @@
1
- import { isSome } from './optional-is-some.mjs';
2
- import { unwrap } from './optional-unwrap.mjs';
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
- export const toNullable = (optional) => (isSome(optional) ? unwrap(optional) : undefined);
30
- //# sourceMappingURL=optional-to-nullable.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-to-nullable.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-to-nullable.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAW,EACY,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC"}
@@ -1,37 +0,0 @@
1
- import { type Optional, type UnknownOptional } from '../optional.mjs';
2
- import { type Unwrap } from './types.mjs';
3
- /**
4
- * Unwraps an `Optional`, returning the contained value or a default value if
5
- * it's `None`.
6
- *
7
- * Supports both direct usage and curried form for functional composition.
8
- * This is often preferred over `unwrap()` when you have a sensible fallback
9
- * value.
10
- *
11
- * @example
12
- *
13
- * ```ts
14
- * const withValue = Optional.some(5);
15
- *
16
- * const withoutValue = Optional.none as Optional<number>;
17
- *
18
- * assert.isTrue(Optional.unwrapOr(withValue, 0) === 5);
19
- *
20
- * assert.isTrue(Optional.unwrapOr(withoutValue, 0) === 0);
21
- *
22
- * const unwrapWithDefault = Optional.unwrapOr(10);
23
- *
24
- * assert.isTrue(unwrapWithDefault(Optional.some(3)) === 3);
25
- *
26
- * assert.isTrue(unwrapWithDefault(Optional.none) === 10);
27
- * ```
28
- *
29
- * @template O The `UnknownOptional` type to unwrap.
30
- * @template D The type of the default value.
31
- * @param optional The `Optional` to unwrap.
32
- * @param defaultValue The value to return if `optional` is `None`.
33
- * @returns The contained value if `Some`, otherwise `defaultValue`.
34
- */
35
- export declare function unwrapOr<O extends UnknownOptional, D>(optional: O, defaultValue: D): D | Unwrap<O>;
36
- export declare function unwrapOr<D>(defaultValue: D): <O>(optional: Optional<O>) => D | O;
37
- //# sourceMappingURL=optional-unwrap-or.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-unwrap-or.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-unwrap-or.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,EACnD,QAAQ,EAAE,CAAC,EACX,YAAY,EAAE,CAAC,GACd,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAGjB,wBAAgB,QAAQ,CAAC,CAAC,EACxB,YAAY,EAAE,CAAC,GACd,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- import { unwrap } from './optional-unwrap.mjs';
2
- export function unwrapOr(...args) {
3
- switch (args.length) {
4
- case 2: {
5
- const [optional, defaultValue] = args;
6
- return unwrapOrImpl(optional, defaultValue);
7
- }
8
- case 1: {
9
-
10
- const [defaultValue] = args;
11
- return (optional) => unwrapOrImpl(optional, defaultValue);
12
- }
13
- }
14
- }
15
- const unwrapOrImpl = (optional, defaultValue) => unwrap(optional) ?? defaultValue;
16
- //# sourceMappingURL=optional-unwrap-or.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-unwrap-or.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-unwrap-or.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AA6C/C,MAAM,UAAU,QAAQ,CACtB,GAAG,IAA0E;IAE7E,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACpB,KAAK,CAAC,EAAE,CAAC;YACP,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,IAAI,CAAC;YAEtC,OAAO,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC9C,CAAC;QAED,KAAK,CAAC,EAAE,CAAC;YACP,mDAAmD;YACnD,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;YAE5B,OAAO,CAAC,QAA6B,EAAE,EAAE,CACvC,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,YAAY,GAAG,CACnB,QAAW,EACX,YAAe,EACA,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC"}
@@ -1,31 +0,0 @@
1
- import { type UnknownOptional } from '../optional.mjs';
2
- import { type Unwrap } from './types.mjs';
3
- /**
4
- * Unwraps an `Optional`, returning the contained value. Throws an error if
5
- * the `Optional` is `None`.
6
- *
7
- * This is a safer alternative to direct value access when you know the
8
- * Optional should contain a value. Use this method when an empty Optional
9
- * represents a programming error or unexpected condition.
10
- *
11
- * @example
12
- *
13
- * ```ts
14
- * const present = Optional.some('available');
15
- *
16
- * assert.isTrue(Optional.unwrapThrow(present) === 'available');
17
- *
18
- * assert.throws(
19
- * () => Optional.unwrapThrow(Optional.none),
20
- * /has failed because it is `None`/u,
21
- * );
22
- * ```
23
- *
24
- * @template O The `UnknownOptional` type to unwrap.
25
- * @param optional The `Optional` to unwrap.
26
- * @returns The contained value if `Some`.
27
- * @throws {Error} Error with message "`unwrapThrow()` has failed because it
28
- * is `None`" if the `Optional` is `None`.
29
- */
30
- export declare const unwrapThrow: <O extends UnknownOptional>(optional: O) => Unwrap<O>;
31
- //# sourceMappingURL=optional-unwrap-throw.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-unwrap-throw.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-unwrap-throw.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,eAAe,YACzC,CAAC,KACV,MAAM,CAAC,CAAC,CAOV,CAAC"}
@@ -1,36 +0,0 @@
1
- import { isSome } from './optional-is-some.mjs';
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
- export const unwrapThrow = (optional) => {
30
- if (isSome(optional)) {
31
-
32
- return optional.value;
33
- }
34
- throw new Error('`unwrapThrow()` has failed because it is `None`');
35
- };
36
- //# sourceMappingURL=optional-unwrap-throw.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-unwrap-throw.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-unwrap-throw.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,QAAW,EACA,EAAE;IACb,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrB,oEAAoE;QACpE,OAAO,QAAQ,CAAC,KAAkB,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACrE,CAAC,CAAC"}
@@ -1,32 +0,0 @@
1
- import { type Some } from '../../../types.mjs';
2
- import { type UnknownOptional } from '../optional.mjs';
3
- import { type Unwrap } from './types.mjs';
4
- /**
5
- * Unwraps an `Optional`, returning the contained value or `undefined` if
6
- * empty.
7
- *
8
- * This function provides a safe way to extract values from Optionals without
9
- * throwing exceptions. It has overloaded behavior based on the type:
10
- *
11
- * - For `Some<T>`: Always returns `T` (guaranteed by type system)
12
- * - For general `Optional<T>`: Returns `T | undefined`
13
- *
14
- * @example
15
- *
16
- * ```ts
17
- * const someString = Optional.some('text');
18
- *
19
- * const noneString = Optional.none as Optional<string>;
20
- *
21
- * assert.isTrue(Optional.unwrap(someString) === 'text');
22
- *
23
- * assert.isTrue(Optional.unwrap(noneString) === undefined);
24
- * ```
25
- *
26
- * @template O The `UnknownOptional` type to unwrap.
27
- * @param optional The `Optional` to unwrap.
28
- * @returns The contained value if `Some`, otherwise `undefined`.
29
- */
30
- export declare function unwrap<O extends Some<unknown>>(optional: O): Unwrap<O>;
31
- export declare function unwrap<O extends UnknownOptional>(optional: O): Unwrap<O> | undefined;
32
- //# sourceMappingURL=optional-unwrap.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-unwrap.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-unwrap.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAExE,wBAAgB,MAAM,CAAC,CAAC,SAAS,eAAe,EAC9C,QAAQ,EAAE,CAAC,GACV,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC"}
@@ -1,8 +0,0 @@
1
- import { isSome } from './optional-is-some.mjs';
2
- export function unwrap(optional) {
3
- return isSome(optional)
4
- ?
5
- optional.value
6
- : undefined;
7
- }
8
- //# sourceMappingURL=optional-unwrap.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-unwrap.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-unwrap.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAmChD,MAAM,UAAU,MAAM,CACpB,QAAW;IAEX,OAAO,MAAM,CAAC,QAAQ,CAAC;QACrB,CAAC,CAAC,oEAAoE;YACnE,QAAQ,CAAC,KAAmB;QAC/B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
@@ -1,35 +0,0 @@
1
- import { type Optional } from '../optional.mjs';
2
- /**
3
- * Combines two `Optional` values into a single `Optional` containing a tuple.
4
- * If either `Optional` is `None`, returns `None`.
5
- *
6
- * @example
7
- *
8
- * ```ts
9
- * const zipped = Optional.zip(Optional.some('left'), Optional.some(1));
10
- *
11
- * assert.isTrue(Optional.isSome(zipped));
12
- *
13
- * if (Optional.isSome(zipped)) {
14
- * const expected: readonly [string, number] = ['left', 1] as const;
15
- *
16
- * assert.deepStrictEqual(zipped.value, expected);
17
- * }
18
- *
19
- * const missing = Optional.zip(
20
- * Optional.some('value'),
21
- * // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
22
- * Optional.none as Optional<number>,
23
- * );
24
- *
25
- * assert.deepStrictEqual(missing, Optional.none);
26
- * ```
27
- *
28
- * @template A The value type of the first `Optional`.
29
- * @template B The value type of the second `Optional`.
30
- * @param optionalA The first `Optional`.
31
- * @param optionalB The second `Optional`.
32
- * @returns An `Optional` containing a tuple of both values, or `None`.
33
- */
34
- export declare const zip: <A, const B>(optionalA: Optional<A>, optionalB: Optional<B>) => Optional<readonly [A, B]>;
35
- //# sourceMappingURL=optional-zip.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-zip.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-zip.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAKhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,GAAG,GAAI,CAAC,EAAE,KAAK,CAAC,CAAC,aACjB,QAAQ,CAAC,CAAC,CAAC,aACX,QAAQ,CAAC,CAAC,CAAC,KACrB,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAGjB,CAAC"}
@@ -1,39 +0,0 @@
1
- import { isSome } from './optional-is-some.mjs';
2
- import { none } from './optional-none.mjs';
3
- import { some } from './optional-some.mjs';
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
- export const zip = (optionalA, optionalB) => isSome(optionalA) && isSome(optionalB)
37
- ? some([optionalA.value, optionalB.value])
38
- : none;
39
- //# sourceMappingURL=optional-zip.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional-zip.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-zip.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CACjB,SAAsB,EACtB,SAAsB,EACK,EAAE,CAC7B,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC;IACpC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,CAAU,CAAC;IACnD,CAAC,CAAC,IAAI,CAAC"}
@@ -1,6 +0,0 @@
1
- /** @internal String literal tag to identify the 'Some' variant of Optional. */
2
- import { type None, type Some } from '../../../types.mjs';
3
- export declare const SomeTypeTagName: Some<unknown>['$$tag'];
4
- /** @internal String literal tag to identify the 'None' variant of Optional. */
5
- export declare const NoneTypeTagName: None['$$tag'];
6
- //# sourceMappingURL=tag.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tag.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/tag.mts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CACnB,CAAC;AAEjC,+EAA+E;AAC/E,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,OAAO,CAAkC,CAAC"}
@@ -1,4 +0,0 @@
1
- export const SomeTypeTagName = 'ts-data-forge::Optional.some';
2
-
3
- export const NoneTypeTagName = 'ts-data-forge::Optional.none';
4
- //# sourceMappingURL=tag.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tag.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/tag.mts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,eAAe,GAC1B,8BAA8B,CAAC;AAEjC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAkB,8BAA8B,CAAC"}
@@ -1,24 +0,0 @@
1
- import { type None, type Some } from '../../../types.mjs';
2
- import { type UnknownOptional } from '../optional.mjs';
3
- /**
4
- * Extracts the value type `S` from an {@link Some}<S>. If the
5
- * {@link Optional} is {@link None}, resolves to `never`.
6
- *
7
- * @template O The {@link UnknownOptional} type to unwrap.
8
- */
9
- export type Unwrap<O extends UnknownOptional> = O extends Some<infer S> ? S : never;
10
- /**
11
- * Narrows an {@link UnknownOptional} type to {@link Some}<S> if it is a
12
- * {@link Some}. If the {@link Optional} is {@link None}, resolves to `never`.
13
- *
14
- * @template O The {@link UnknownOptional} type to narrow.
15
- */
16
- export type NarrowToSome<O extends UnknownOptional> = O extends None ? never : O;
17
- /**
18
- * Narrows an {@link UnknownOptional} type to {@link None} if it is a
19
- * {@link None}. If the {@link Optional} is {@link Some}<S>, resolves to never.
20
- *
21
- * @template O The {@link UnknownOptional} type to narrow.
22
- */
23
- export type NarrowToNone<O extends UnknownOptional> = O extends None ? O : never;
24
- //# sourceMappingURL=types.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/types.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,eAAe,IAC1C,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,SAAS,IAAI,GAChE,KAAK,GACL,CAAC,CAAC;AAEN;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,SAAS,IAAI,GAChE,CAAC,GACD,KAAK,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../../src/functional/optional/impl/types.mts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './optional.mjs';
2
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/functional/optional/index.mts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './optional.mjs';
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/functional/optional/index.mts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { type None, type Some } from '../../types.mjs';
2
- /**
3
- * Represents an optional value that can either be `Some` (containing a value)
4
- * or `None` (empty).
5
- *
6
- * @template S The type of the value that might be present.
7
- */
8
- export type Optional<S> = None | Some<S>;
9
- /**
10
- * Base type for any {@link Optional}, used for generic constraints. Represents
11
- * an {@link Optional} with an unknown value type.
12
- */
13
- export type UnknownOptional = None | Some<unknown>;
14
- export type { None, Some } from '../../types.mjs';
15
- export * as Optional from './impl/index.mjs';
16
- //# sourceMappingURL=optional.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional.d.mts","sourceRoot":"","sources":["../../../src/functional/optional/optional.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAEnD,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * as Optional from './impl/index.mjs';
2
- //# sourceMappingURL=optional.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional.mjs","sourceRoot":"","sources":["../../../src/functional/optional/optional.mts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC"}
@@ -1,102 +0,0 @@
1
- import { Optional, type UnknownOptional } from './optional/index.mjs';
2
- /**
3
- * Creates a new pipe object that allows for chaining operations on a value.
4
- *
5
- * This function provides a fluent interface for applying transformations to
6
- * values, with intelligent method selection based on the input type:
7
- *
8
- * - For `Optional` values: Provides `mapOptional` for safe Optional
9
- * transformations
10
- * - For other values: Provides `mapNullable` for null-safe transformations
11
- * - All types get the basic `map` method for general transformations
12
- *
13
- * The pipe maintains type safety throughout the chain, automatically selecting
14
- * the appropriate overload based on the current value type.
15
- *
16
- * @template A The type of the initial value to wrap in a pipe.
17
- * @param a The initial value to wrap in a pipe.
18
- * @returns A pipe object with chaining methods appropriate for the value type.
19
- */
20
- export declare const pipe: <const A>(a: A) => Pipe<A>;
21
- export type Pipe<A> = PipeBase<A> & PipeMapNullable<A> & ([A] extends [UnknownOptional] ? PipeMapOptional<A> : unknown);
22
- type PipeBase<A> = Readonly<{
23
- /** The current value being piped. */
24
- value: A;
25
- /**
26
- * Maps the current value to a new value using the provided function.
27
- *
28
- * @example
29
- *
30
- * ```ts
31
- * const result = pipe(2)
32
- * .map((value) => value * 3)
33
- * .map((value) => `value: ${value}`);
34
- *
35
- * assert.deepStrictEqual(result.value, 'value: 6');
36
- * ```
37
- *
38
- * @template B The type of the new value.
39
- * @param fn Function to transform the current value.
40
- * @returns A new pipe containing the transformed value.
41
- */
42
- map: <B>(fn: (a: A) => B) => Pipe<B>;
43
- }>;
44
- type PipeMapNullable<A> = Readonly<{
45
- /**
46
- * Maps the current value only if it's not null or undefined. If the current
47
- * value is null/undefined, the transformation is skipped and undefined is
48
- * propagated through the pipe.
49
- *
50
- * @example
51
- *
52
- * ```ts
53
- * const result = pipe<string | undefined>('hello')
54
- * .mapNullable((value) => value.toUpperCase())
55
- * .mapNullable((value) => value.slice(0, 2));
56
- *
57
- * assert.deepStrictEqual(result.value, 'HE');
58
- *
59
- * const empty = pipe<string | undefined>(undefined).mapNullable((value) =>
60
- * value.toUpperCase(),
61
- * );
62
- *
63
- * assert.isTrue(empty.value === undefined);
64
- * ```
65
- *
66
- * @template B The type of the transformed value.
67
- * @param fn Function to transform the non-null value.
68
- * @returns A new pipe containing the transformed value or undefined.
69
- */
70
- mapNullable: <B>(fn: (a: NonNullable<A>) => B) => Pipe<B | undefined>;
71
- }>;
72
- type PipeMapOptional<A extends UnknownOptional> = Readonly<{
73
- /**
74
- * Maps the value inside an Optional using Optional.map semantics. If the
75
- * Optional is None, the transformation is skipped and None is propagated.
76
- * If the Optional is Some, the transformation is applied to the inner
77
- * value.
78
- *
79
- * @example
80
- *
81
- * ```ts
82
- * const result = pipe(Optional.some(10))
83
- * .mapOptional((value) => value * 2)
84
- * .mapOptional((value) => value + 5);
85
- *
86
- * assert.deepStrictEqual(result.value, Optional.some(25));
87
- *
88
- * const empty = pipe(Optional.none as Optional<number>).mapOptional(
89
- * (value) => value * 2,
90
- * );
91
- *
92
- * assert.isTrue(Optional.isNone(empty.value));
93
- * ```
94
- *
95
- * @template B The type of the transformed inner value.
96
- * @param fn Function to transform the inner value of the Optional.
97
- * @returns A new pipe containing an Optional with the transformed value.
98
- */
99
- mapOptional: <B>(fn: (a: Optional.Unwrap<A>) => B) => Pipe<Optional<B>>;
100
- }>;
101
- export {};
102
- //# sourceMappingURL=pipe.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipe.d.mts","sourceRoot":"","sources":["../../src/functional/pipe.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEtE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,CAAC,KAAM,CAAC,KAAG,IAAI,CAAC,CAAC,CAYI,CAAC;AAkBjD,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAC/B,eAAe,CAAC,CAAC,CAAC,GAClB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;AAgCjE,KAAK,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC;IAC1B,qCAAqC;IACrC,KAAK,EAAE,CAAC,CAAC;IAET;;;;;;;;;;;;;;;;OAgBG;IACH,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC;CACtC,CAAC,CAAC;AAEH,KAAK,eAAe,CAAC,CAAC,IAAI,QAAQ,CAAC;IACjC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;CACvE,CAAC,CAAC;AAEH,KAAK,eAAe,CAAC,CAAC,SAAS,eAAe,IAAI,QAAQ,CAAC;IACzD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;CACzE,CAAC,CAAC"}