ts-data-forge 3.3.1 → 4.1.0

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 (562) hide show
  1. package/dist/array/impl/array-utils-element-access.d.mts +3 -4
  2. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  3. package/dist/array/impl/array-utils-element-access.mjs +8 -8
  4. package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
  5. package/dist/array/impl/array-utils-reducing-value.d.mts +8 -9
  6. package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
  7. package/dist/array/impl/array-utils-reducing-value.mjs +9 -7
  8. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  9. package/dist/array/impl/array-utils-search.d.mts +0 -1
  10. package/dist/array/impl/array-utils-search.d.mts.map +1 -1
  11. package/dist/array/impl/array-utils-search.mjs +6 -6
  12. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  13. package/dist/array/impl/array-utils-transformation.mjs +2 -4
  14. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  15. package/dist/collections/imap-mapped.d.mts +0 -1
  16. package/dist/collections/imap-mapped.d.mts.map +1 -1
  17. package/dist/collections/imap-mapped.mjs +7 -6
  18. package/dist/collections/imap-mapped.mjs.map +1 -1
  19. package/dist/collections/imap.d.mts +0 -1
  20. package/dist/collections/imap.d.mts.map +1 -1
  21. package/dist/collections/imap.mjs +11 -9
  22. package/dist/collections/imap.mjs.map +1 -1
  23. package/dist/collections/queue.d.mts +0 -1
  24. package/dist/collections/queue.d.mts.map +1 -1
  25. package/dist/collections/queue.mjs +4 -4
  26. package/dist/collections/queue.mjs.map +1 -1
  27. package/dist/collections/stack.d.mts +0 -1
  28. package/dist/collections/stack.d.mts.map +1 -1
  29. package/dist/collections/stack.mjs +4 -4
  30. package/dist/collections/stack.mjs.map +1 -1
  31. package/dist/entry-point.d.mts +1 -0
  32. package/dist/entry-point.d.mts.map +1 -1
  33. package/dist/entry-point.mjs +8 -4
  34. package/dist/entry-point.mjs.map +1 -1
  35. package/dist/functional/index.d.mts +3 -2
  36. package/dist/functional/index.d.mts.map +1 -1
  37. package/dist/functional/index.mjs +6 -2
  38. package/dist/functional/index.mjs.map +1 -1
  39. package/dist/functional/optional/impl/index.d.mts +18 -0
  40. package/dist/functional/optional/impl/index.d.mts.map +1 -0
  41. package/dist/functional/optional/impl/index.mjs +17 -0
  42. package/dist/functional/optional/impl/index.mjs.map +1 -0
  43. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +29 -0
  44. package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -0
  45. package/dist/functional/optional/impl/optional-expect-to-be.mjs +25 -0
  46. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -0
  47. package/dist/functional/optional/impl/optional-filter.d.mts +29 -0
  48. package/dist/functional/optional/impl/optional-filter.d.mts.map +1 -0
  49. package/dist/functional/optional/impl/optional-filter.mjs +28 -0
  50. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -0
  51. package/dist/functional/optional/impl/optional-flat-map.d.mts +33 -0
  52. package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -0
  53. package/dist/functional/optional/impl/optional-flat-map.mjs +21 -0
  54. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -0
  55. package/dist/functional/optional/impl/optional-from-nullable.d.mts +24 -0
  56. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -0
  57. package/dist/functional/optional/impl/optional-from-nullable.mjs +29 -0
  58. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -0
  59. package/dist/functional/optional/impl/optional-is-none.d.mts +22 -0
  60. package/dist/functional/optional/impl/optional-is-none.d.mts.map +1 -0
  61. package/dist/functional/optional/impl/optional-is-none.mjs +25 -0
  62. package/dist/functional/optional/impl/optional-is-none.mjs.map +1 -0
  63. package/dist/functional/optional/impl/optional-is-optional.d.mts +18 -0
  64. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -0
  65. package/dist/functional/optional/impl/optional-is-optional.mjs +27 -0
  66. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -0
  67. package/dist/functional/optional/impl/optional-is-some.d.mts +22 -0
  68. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -0
  69. package/dist/functional/optional/impl/optional-is-some.mjs +25 -0
  70. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -0
  71. package/dist/functional/optional/impl/optional-map.d.mts +31 -0
  72. package/dist/functional/optional/impl/optional-map.d.mts.map +1 -0
  73. package/dist/functional/optional/impl/optional-map.mjs +25 -0
  74. package/dist/functional/optional/impl/optional-map.mjs.map +1 -0
  75. package/dist/functional/optional/impl/optional-none.d.mts +16 -0
  76. package/dist/functional/optional/impl/optional-none.d.mts.map +1 -0
  77. package/dist/functional/optional/impl/optional-none.mjs +20 -0
  78. package/dist/functional/optional/impl/optional-none.mjs.map +1 -0
  79. package/dist/functional/optional/impl/optional-or-else.d.mts +35 -0
  80. package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -0
  81. package/dist/functional/optional/impl/optional-or-else.mjs +19 -0
  82. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -0
  83. package/dist/functional/optional/impl/optional-some.d.mts +19 -0
  84. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -0
  85. package/dist/functional/optional/impl/optional-some.mjs +26 -0
  86. package/dist/functional/optional/impl/optional-some.mjs.map +1 -0
  87. package/dist/functional/optional/impl/optional-to-nullable.d.mts +27 -0
  88. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -0
  89. package/dist/functional/optional/impl/optional-to-nullable.mjs +31 -0
  90. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -0
  91. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +33 -0
  92. package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +1 -0
  93. package/dist/functional/optional/impl/optional-unwrap-or.mjs +19 -0
  94. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -0
  95. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +29 -0
  96. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -0
  97. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +38 -0
  98. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -0
  99. package/dist/functional/optional/impl/optional-unwrap.d.mts +28 -0
  100. package/dist/functional/optional/impl/optional-unwrap.d.mts.map +1 -0
  101. package/dist/functional/optional/impl/optional-unwrap.mjs +11 -0
  102. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -0
  103. package/dist/functional/optional/impl/optional-zip.d.mts +31 -0
  104. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -0
  105. package/dist/functional/optional/impl/optional-zip.mjs +39 -0
  106. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -0
  107. package/dist/functional/optional/impl/tag.d.mts +5 -0
  108. package/dist/functional/optional/impl/tag.d.mts.map +1 -0
  109. package/dist/functional/optional/impl/tag.mjs +7 -0
  110. package/dist/functional/optional/impl/tag.mjs.map +1 -0
  111. package/dist/functional/optional/impl/types.d.mts +22 -0
  112. package/dist/functional/optional/impl/types.d.mts.map +1 -0
  113. package/dist/functional/optional/impl/types.mjs +2 -0
  114. package/dist/functional/optional/impl/types.mjs.map +1 -0
  115. package/dist/functional/optional/index.d.mts +2 -0
  116. package/dist/functional/optional/index.d.mts.map +1 -0
  117. package/dist/functional/optional/index.mjs +3 -0
  118. package/dist/functional/optional/index.mjs.map +1 -0
  119. package/dist/functional/pipe.d.mts +4 -4
  120. package/dist/functional/pipe.d.mts.map +1 -1
  121. package/dist/functional/pipe.mjs +4 -3
  122. package/dist/functional/pipe.mjs.map +1 -1
  123. package/dist/functional/result/impl/index.d.mts +24 -0
  124. package/dist/functional/result/impl/index.d.mts.map +1 -0
  125. package/dist/functional/result/impl/index.mjs +23 -0
  126. package/dist/functional/result/impl/index.mjs.map +1 -0
  127. package/dist/functional/result/impl/result-err.d.mts +25 -0
  128. package/dist/functional/result/impl/result-err.d.mts.map +1 -0
  129. package/dist/functional/result/impl/result-err.mjs +32 -0
  130. package/dist/functional/result/impl/result-err.mjs.map +1 -0
  131. package/dist/functional/result/impl/result-expect-to-be.d.mts +27 -0
  132. package/dist/functional/result/impl/result-expect-to-be.d.mts.map +1 -0
  133. package/dist/functional/result/impl/result-expect-to-be.mjs +26 -0
  134. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -0
  135. package/dist/functional/result/impl/result-flat-map.d.mts +39 -0
  136. package/dist/functional/result/impl/result-flat-map.d.mts.map +1 -0
  137. package/dist/functional/result/impl/result-flat-map.mjs +24 -0
  138. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -0
  139. package/dist/functional/result/impl/result-fold.d.mts +45 -0
  140. package/dist/functional/result/impl/result-fold.d.mts.map +1 -0
  141. package/dist/functional/result/impl/result-fold.mjs +26 -0
  142. package/dist/functional/result/impl/result-fold.mjs.map +1 -0
  143. package/dist/functional/result/impl/result-from-promise.d.mts +32 -0
  144. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -0
  145. package/dist/functional/result/impl/result-from-promise.mjs +32 -0
  146. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -0
  147. package/dist/functional/result/impl/result-from-throwable.d.mts +29 -0
  148. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -0
  149. package/dist/functional/result/impl/result-from-throwable.mjs +46 -0
  150. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -0
  151. package/dist/functional/result/impl/result-is-err.d.mts +20 -0
  152. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -0
  153. package/dist/functional/result/impl/result-is-err.mjs +23 -0
  154. package/dist/functional/result/impl/result-is-err.mjs.map +1 -0
  155. package/dist/functional/result/impl/result-is-ok.d.mts +20 -0
  156. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -0
  157. package/dist/functional/result/impl/result-is-ok.mjs +23 -0
  158. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -0
  159. package/dist/functional/result/impl/result-is-result.d.mts +17 -0
  160. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -0
  161. package/dist/functional/result/impl/result-is-result.mjs +26 -0
  162. package/dist/functional/result/impl/result-is-result.mjs.map +1 -0
  163. package/dist/functional/result/impl/result-map-err.d.mts +33 -0
  164. package/dist/functional/result/impl/result-map-err.d.mts.map +1 -0
  165. package/dist/functional/result/impl/result-map-err.mjs +25 -0
  166. package/dist/functional/result/impl/result-map-err.mjs.map +1 -0
  167. package/dist/functional/result/impl/result-map.d.mts +34 -0
  168. package/dist/functional/result/impl/result-map.d.mts.map +1 -0
  169. package/dist/functional/result/impl/result-map.mjs +25 -0
  170. package/dist/functional/result/impl/result-map.mjs.map +1 -0
  171. package/dist/functional/result/impl/result-ok.d.mts +25 -0
  172. package/dist/functional/result/impl/result-ok.d.mts.map +1 -0
  173. package/dist/functional/result/impl/result-ok.mjs +32 -0
  174. package/dist/functional/result/impl/result-ok.mjs.map +1 -0
  175. package/dist/functional/result/impl/result-or-else.d.mts +32 -0
  176. package/dist/functional/result/impl/result-or-else.d.mts.map +1 -0
  177. package/dist/functional/result/impl/result-or-else.mjs +20 -0
  178. package/dist/functional/result/impl/result-or-else.mjs.map +1 -0
  179. package/dist/functional/result/impl/result-swap.d.mts +20 -0
  180. package/dist/functional/result/impl/result-swap.d.mts.map +1 -0
  181. package/dist/functional/result/impl/result-swap.mjs +28 -0
  182. package/dist/functional/result/impl/result-swap.mjs.map +1 -0
  183. package/dist/functional/result/impl/result-to-optional.d.mts +28 -0
  184. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -0
  185. package/dist/functional/result/impl/result-to-optional.mjs +34 -0
  186. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -0
  187. package/dist/functional/result/impl/result-unwrap-err-or.d.mts +29 -0
  188. package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +1 -0
  189. package/dist/functional/result/impl/result-unwrap-err-or.mjs +20 -0
  190. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -0
  191. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +30 -0
  192. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -0
  193. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +47 -0
  194. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -0
  195. package/dist/functional/result/impl/result-unwrap-err.d.mts +31 -0
  196. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -0
  197. package/dist/functional/result/impl/result-unwrap-err.mjs +36 -0
  198. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -0
  199. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +29 -0
  200. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +1 -0
  201. package/dist/functional/result/impl/result-unwrap-ok-or.mjs +20 -0
  202. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -0
  203. package/dist/functional/result/impl/result-unwrap-ok.d.mts +23 -0
  204. package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +1 -0
  205. package/dist/functional/result/impl/result-unwrap-ok.mjs +11 -0
  206. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -0
  207. package/dist/functional/result/impl/result-unwrap-throw.d.mts +30 -0
  208. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -0
  209. package/dist/functional/result/impl/result-unwrap-throw.mjs +41 -0
  210. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -0
  211. package/dist/functional/result/impl/result-zip.d.mts +29 -0
  212. package/dist/functional/result/impl/result-zip.d.mts.map +1 -0
  213. package/dist/functional/result/impl/result-zip.mjs +38 -0
  214. package/dist/functional/result/impl/result-zip.mjs.map +1 -0
  215. package/dist/functional/result/impl/tag.d.mts +5 -0
  216. package/dist/functional/result/impl/tag.d.mts.map +1 -0
  217. package/dist/functional/result/impl/tag.mjs +7 -0
  218. package/dist/functional/result/impl/tag.mjs.map +1 -0
  219. package/dist/functional/result/impl/types.d.mts +29 -0
  220. package/dist/functional/result/impl/types.d.mts.map +1 -0
  221. package/dist/functional/result/impl/types.mjs +2 -0
  222. package/dist/functional/result/impl/types.mjs.map +1 -0
  223. package/dist/functional/result/index.d.mts +2 -0
  224. package/dist/functional/result/index.d.mts.map +1 -0
  225. package/dist/functional/result/index.mjs +3 -0
  226. package/dist/functional/result/index.mjs.map +1 -0
  227. package/dist/functional/ternary-result/impl/index.d.mts +29 -0
  228. package/dist/functional/ternary-result/impl/index.d.mts.map +1 -0
  229. package/dist/functional/ternary-result/impl/index.mjs +28 -0
  230. package/dist/functional/ternary-result/impl/index.mjs.map +1 -0
  231. package/dist/functional/ternary-result/impl/tag.d.mts +7 -0
  232. package/dist/functional/ternary-result/impl/tag.d.mts.map +1 -0
  233. package/dist/functional/ternary-result/impl/tag.mjs +9 -0
  234. package/dist/functional/ternary-result/impl/tag.mjs.map +1 -0
  235. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +14 -0
  236. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -0
  237. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +21 -0
  238. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -0
  239. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +18 -0
  240. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +1 -0
  241. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +24 -0
  242. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -0
  243. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +29 -0
  244. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +1 -0
  245. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +41 -0
  246. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -0
  247. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +27 -0
  248. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +1 -0
  249. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +36 -0
  250. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -0
  251. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +20 -0
  252. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -0
  253. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +24 -0
  254. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -0
  255. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +17 -0
  256. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -0
  257. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +33 -0
  258. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -0
  259. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts +20 -0
  260. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +1 -0
  261. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +23 -0
  262. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +1 -0
  263. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +21 -0
  264. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -0
  265. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +24 -0
  266. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -0
  267. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +17 -0
  268. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -0
  269. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +28 -0
  270. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -0
  271. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +21 -0
  272. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -0
  273. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +24 -0
  274. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -0
  275. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +23 -0
  276. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +1 -0
  277. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +26 -0
  278. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -0
  279. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +21 -0
  280. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +1 -0
  281. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +29 -0
  282. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -0
  283. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +29 -0
  284. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +1 -0
  285. package/dist/functional/ternary-result/impl/ternary-result-map.mjs +35 -0
  286. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -0
  287. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +16 -0
  288. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -0
  289. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +23 -0
  290. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -0
  291. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +26 -0
  292. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +1 -0
  293. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +19 -0
  294. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -0
  295. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +16 -0
  296. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -0
  297. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +25 -0
  298. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -0
  299. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +22 -0
  300. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +1 -0
  301. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +17 -0
  302. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -0
  303. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +18 -0
  304. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -0
  305. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +36 -0
  306. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -0
  307. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +17 -0
  308. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -0
  309. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +22 -0
  310. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -0
  311. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +22 -0
  312. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +1 -0
  313. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +17 -0
  314. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -0
  315. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +17 -0
  316. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +1 -0
  317. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +13 -0
  318. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -0
  319. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +18 -0
  320. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -0
  321. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +36 -0
  322. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -0
  323. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +19 -0
  324. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +1 -0
  325. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +17 -0
  326. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -0
  327. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +18 -0
  328. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -0
  329. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +32 -0
  330. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -0
  331. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +17 -0
  332. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -0
  333. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +22 -0
  334. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -0
  335. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +18 -0
  336. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -0
  337. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +26 -0
  338. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -0
  339. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +26 -0
  340. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -0
  341. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +48 -0
  342. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -0
  343. package/dist/functional/ternary-result/impl/types.d.mts +25 -0
  344. package/dist/functional/ternary-result/impl/types.d.mts.map +1 -0
  345. package/dist/functional/ternary-result/impl/types.mjs +2 -0
  346. package/dist/functional/ternary-result/impl/types.mjs.map +1 -0
  347. package/dist/functional/ternary-result/impl/variant-name.d.mts +3 -0
  348. package/dist/functional/ternary-result/impl/variant-name.d.mts.map +1 -0
  349. package/dist/functional/ternary-result/impl/variant-name.mjs +16 -0
  350. package/dist/functional/ternary-result/impl/variant-name.mjs.map +1 -0
  351. package/dist/functional/ternary-result/index.d.mts +2 -0
  352. package/dist/functional/ternary-result/index.d.mts.map +1 -0
  353. package/dist/functional/ternary-result/index.mjs +3 -0
  354. package/dist/functional/ternary-result/index.mjs.map +1 -0
  355. package/dist/globals.d.mts +136 -0
  356. package/dist/index.d.mts +0 -1
  357. package/dist/index.d.mts.map +1 -1
  358. package/dist/index.mjs +0 -4
  359. package/dist/index.mjs.map +1 -1
  360. package/dist/json/json.d.mts +0 -1
  361. package/dist/json/json.d.mts.map +1 -1
  362. package/dist/json/json.mjs +8 -8
  363. package/dist/json/json.mjs.map +1 -1
  364. package/dist/number/branded-types/finite-number.mjs +1 -1
  365. package/dist/number/branded-types/finite-number.mjs.map +1 -1
  366. package/dist/number/branded-types/int.mjs +1 -1
  367. package/dist/number/branded-types/int.mjs.map +1 -1
  368. package/dist/number/branded-types/int16.mjs +1 -1
  369. package/dist/number/branded-types/int16.mjs.map +1 -1
  370. package/dist/number/branded-types/int32.mjs +1 -1
  371. package/dist/number/branded-types/int32.mjs.map +1 -1
  372. package/dist/number/branded-types/non-negative-finite-number.mjs +1 -1
  373. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
  374. package/dist/number/branded-types/non-negative-int16.mjs +1 -1
  375. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
  376. package/dist/number/branded-types/non-negative-int32.mjs +1 -1
  377. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
  378. package/dist/number/branded-types/non-zero-finite-number.mjs +1 -1
  379. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
  380. package/dist/number/branded-types/non-zero-int.mjs +1 -1
  381. package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
  382. package/dist/number/branded-types/non-zero-int16.mjs +1 -1
  383. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
  384. package/dist/number/branded-types/non-zero-int32.mjs +1 -1
  385. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
  386. package/dist/number/branded-types/non-zero-safe-int.mjs +1 -1
  387. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
  388. package/dist/number/branded-types/non-zero-uint16.mjs +1 -1
  389. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
  390. package/dist/number/branded-types/non-zero-uint32.mjs +1 -1
  391. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
  392. package/dist/number/branded-types/positive-finite-number.mjs +1 -1
  393. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
  394. package/dist/number/branded-types/positive-int.mjs +1 -1
  395. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  396. package/dist/number/branded-types/positive-int16.mjs +1 -1
  397. package/dist/number/branded-types/positive-int16.mjs.map +1 -1
  398. package/dist/number/branded-types/positive-int32.mjs +1 -1
  399. package/dist/number/branded-types/positive-int32.mjs.map +1 -1
  400. package/dist/number/branded-types/positive-safe-int.mjs +1 -1
  401. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  402. package/dist/number/branded-types/positive-uint16.mjs +1 -1
  403. package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
  404. package/dist/number/branded-types/positive-uint32.mjs +1 -1
  405. package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
  406. package/dist/number/branded-types/safe-int.mjs +1 -1
  407. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  408. package/dist/number/branded-types/safe-uint.mjs +1 -1
  409. package/dist/number/branded-types/safe-uint.mjs.map +1 -1
  410. package/dist/number/branded-types/uint.mjs +1 -1
  411. package/dist/number/branded-types/uint.mjs.map +1 -1
  412. package/dist/number/branded-types/uint16.mjs +1 -1
  413. package/dist/number/branded-types/uint16.mjs.map +1 -1
  414. package/dist/number/branded-types/uint32.mjs +1 -1
  415. package/dist/number/branded-types/uint32.mjs.map +1 -1
  416. package/dist/number/enum/int8.mjs +1 -1
  417. package/dist/number/enum/int8.mjs.map +1 -1
  418. package/dist/number/enum/uint8.mjs +1 -1
  419. package/dist/number/enum/uint8.mjs.map +1 -1
  420. package/dist/number/refined-number-utils.mjs +0 -2
  421. package/dist/number/refined-number-utils.mjs.map +1 -1
  422. package/dist/promise/promise.d.mts +0 -1
  423. package/dist/promise/promise.d.mts.map +1 -1
  424. package/dist/promise/promise.mjs +2 -3
  425. package/dist/promise/promise.mjs.map +1 -1
  426. package/package.json +27 -21
  427. package/src/array/impl/array-utils-element-access.mts +6 -6
  428. package/src/array/impl/array-utils-element-access.test.mts +6 -6
  429. package/src/array/impl/array-utils-reducing-value.mts +8 -24
  430. package/src/array/impl/array-utils-reducing-value.test.mts +8 -8
  431. package/src/array/impl/array-utils-slice-clamped.test.mts +1 -1
  432. package/src/entry-point.mts +1 -0
  433. package/src/functional/index.mts +3 -2
  434. package/src/functional/optional/impl/index.mts +17 -0
  435. package/src/functional/optional/impl/optional-expect-to-be.mts +65 -0
  436. package/src/functional/optional/impl/optional-filter.mts +71 -0
  437. package/src/functional/optional/impl/optional-flat-map.mts +67 -0
  438. package/src/functional/optional/impl/optional-from-nullable.mts +28 -0
  439. package/src/functional/optional/impl/optional-is-none.mts +25 -0
  440. package/src/functional/optional/impl/optional-is-optional.mts +27 -0
  441. package/src/functional/optional/impl/optional-is-some.mts +25 -0
  442. package/src/functional/optional/impl/optional-map.mts +69 -0
  443. package/src/functional/optional/impl/optional-none.mts +17 -0
  444. package/src/functional/optional/impl/optional-or-else.mts +73 -0
  445. package/src/functional/optional/impl/optional-some.mts +23 -0
  446. package/src/functional/optional/impl/optional-to-nullable.mts +31 -0
  447. package/src/functional/optional/impl/optional-unwrap-or.mts +64 -0
  448. package/src/functional/optional/impl/optional-unwrap-throw.mts +39 -0
  449. package/src/functional/optional/impl/optional-unwrap.mts +41 -0
  450. package/src/functional/optional/impl/optional-zip.mts +40 -0
  451. package/src/functional/optional/impl/tag.mts +6 -0
  452. package/src/functional/optional/impl/types.mts +28 -0
  453. package/src/functional/optional/index.mts +1 -0
  454. package/src/functional/optional.test.mts +7 -8
  455. package/src/functional/pipe.mts +5 -5
  456. package/src/functional/pipe.test.mts +1 -1
  457. package/src/functional/result/impl/index.mts +23 -0
  458. package/src/functional/result/impl/result-err.mts +29 -0
  459. package/src/functional/result/impl/result-expect-to-be.mts +63 -0
  460. package/src/functional/result/impl/result-flat-map.mts +79 -0
  461. package/src/functional/result/impl/result-fold.mts +95 -0
  462. package/src/functional/result/impl/result-from-promise.mts +39 -0
  463. package/src/functional/result/impl/result-from-throwable.mts +42 -0
  464. package/src/functional/result/impl/result-is-err.mts +23 -0
  465. package/src/functional/result/impl/result-is-ok.mts +23 -0
  466. package/src/functional/result/impl/result-is-result.mts +23 -0
  467. package/src/functional/result/impl/result-map-err.mts +72 -0
  468. package/src/functional/result/impl/result-map.mts +73 -0
  469. package/src/functional/result/impl/result-ok.mts +29 -0
  470. package/src/functional/result/impl/result-or-else.mts +63 -0
  471. package/src/functional/result/impl/result-swap.mts +28 -0
  472. package/src/functional/result/impl/result-to-optional.mts +34 -0
  473. package/src/functional/result/impl/result-unwrap-err-or.mts +60 -0
  474. package/src/functional/result/impl/result-unwrap-err-throw.mts +53 -0
  475. package/src/functional/result/impl/result-unwrap-err.mts +36 -0
  476. package/src/functional/result/impl/result-unwrap-ok-or.mts +60 -0
  477. package/src/functional/result/impl/result-unwrap-ok.mts +35 -0
  478. package/src/functional/result/impl/result-unwrap-throw.mts +43 -0
  479. package/src/functional/result/impl/result-zip.mts +39 -0
  480. package/src/functional/result/impl/tag.mts +6 -0
  481. package/src/functional/result/impl/types.mts +35 -0
  482. package/src/functional/result/index.mts +1 -0
  483. package/src/functional/result.test.mts +5 -4
  484. package/src/functional/ternary-result/impl/index.mts +28 -0
  485. package/src/functional/ternary-result/impl/tag.mts +11 -0
  486. package/src/functional/ternary-result/impl/ternary-result-err.mts +18 -0
  487. package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +53 -0
  488. package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +95 -0
  489. package/src/functional/ternary-result/impl/ternary-result-fold.mts +93 -0
  490. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +27 -0
  491. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +31 -0
  492. package/src/functional/ternary-result/impl/ternary-result-is-err.mts +23 -0
  493. package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +24 -0
  494. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +27 -0
  495. package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +24 -0
  496. package/src/functional/ternary-result/impl/ternary-result-map-err.mts +64 -0
  497. package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +66 -0
  498. package/src/functional/ternary-result/impl/ternary-result-map.mts +81 -0
  499. package/src/functional/ternary-result/impl/ternary-result-ok.mts +20 -0
  500. package/src/functional/ternary-result/impl/ternary-result-or-else.mts +66 -0
  501. package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +25 -0
  502. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +45 -0
  503. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +40 -0
  504. package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +22 -0
  505. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +45 -0
  506. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +32 -0
  507. package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +45 -0
  508. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +42 -0
  509. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +38 -0
  510. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +22 -0
  511. package/src/functional/ternary-result/impl/ternary-result-warn.mts +23 -0
  512. package/src/functional/ternary-result/impl/ternary-result-zip.mts +53 -0
  513. package/src/functional/ternary-result/impl/types.mts +39 -0
  514. package/src/functional/ternary-result/impl/variant-name.mts +17 -0
  515. package/src/functional/ternary-result/index.mts +1 -0
  516. package/src/functional/ternary-result.test.mts +198 -0
  517. package/src/globals.d.mts +136 -0
  518. package/src/guard/is-non-empty-string.test.mts +1 -1
  519. package/src/guard/is-non-null-object.test.mts +3 -3
  520. package/src/guard/is-primitive.test.mts +3 -3
  521. package/src/guard/is-type.test.mts +3 -3
  522. package/src/index.mts +0 -1
  523. package/src/number/branded-types/finite-number.mts +7 -7
  524. package/src/number/branded-types/int.mts +7 -7
  525. package/src/number/branded-types/int16.mts +9 -9
  526. package/src/number/branded-types/int32.mts +9 -9
  527. package/src/number/branded-types/non-negative-finite-number.mts +8 -8
  528. package/src/number/branded-types/non-negative-int16.mts +9 -9
  529. package/src/number/branded-types/non-negative-int32.mts +9 -9
  530. package/src/number/branded-types/non-zero-finite-number.mts +7 -7
  531. package/src/number/branded-types/non-zero-int.mts +7 -7
  532. package/src/number/branded-types/non-zero-int16.mts +9 -9
  533. package/src/number/branded-types/non-zero-int32.mts +9 -9
  534. package/src/number/branded-types/non-zero-safe-int.mts +9 -9
  535. package/src/number/branded-types/non-zero-uint16.mts +9 -9
  536. package/src/number/branded-types/non-zero-uint32.mts +9 -9
  537. package/src/number/branded-types/positive-finite-number.mts +8 -8
  538. package/src/number/branded-types/positive-int.mts +8 -8
  539. package/src/number/branded-types/positive-int16.mts +9 -9
  540. package/src/number/branded-types/positive-int32.mts +9 -9
  541. package/src/number/branded-types/positive-safe-int.mts +9 -9
  542. package/src/number/branded-types/positive-uint16.mts +9 -9
  543. package/src/number/branded-types/positive-uint32.mts +9 -9
  544. package/src/number/branded-types/safe-int.mts +9 -9
  545. package/src/number/branded-types/safe-uint.mts +9 -9
  546. package/src/number/branded-types/uint.mts +8 -8
  547. package/src/number/branded-types/uint16.mts +9 -9
  548. package/src/number/branded-types/uint32.mts +9 -9
  549. package/src/number/enum/int8.mts +3 -3
  550. package/src/number/enum/int8.test.mts +9 -9
  551. package/src/number/enum/uint8.mts +3 -3
  552. package/src/number/enum/uint8.test.mts +8 -8
  553. package/dist/functional/optional.d.mts +0 -482
  554. package/dist/functional/optional.d.mts.map +0 -1
  555. package/dist/functional/optional.mjs +0 -328
  556. package/dist/functional/optional.mjs.map +0 -1
  557. package/dist/functional/result.d.mts +0 -712
  558. package/dist/functional/result.d.mts.map +0 -1
  559. package/dist/functional/result.mjs +0 -539
  560. package/dist/functional/result.mjs.map +0 -1
  561. package/src/functional/optional.mts +0 -713
  562. package/src/functional/result.mts +0 -1087
@@ -1,5 +1,5 @@
1
- import { Optional } from '../functional/optional.mjs';
2
- import '../functional/result.mjs';
1
+ import { none } from '../functional/optional/impl/optional-none.mjs';
2
+ import { some } from '../functional/optional/impl/optional-some.mjs';
3
3
  import { range } from '../iterator/range.mjs';
4
4
  import '../number/branded-types/finite-number.mjs';
5
5
  import '../number/branded-types/int.mjs';
@@ -99,14 +99,14 @@ class QueueClass {
99
99
  */
100
100
  dequeue() {
101
101
  if (this.isEmpty) {
102
- return Optional.none;
102
+ return none;
103
103
  }
104
104
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
105
105
  const element = this.#buffer[this.#head];
106
106
  this.#buffer[this.#head] = undefined; // Clear reference for garbage collection
107
107
  this.#head = (this.#head + 1) % this.#capacity;
108
108
  this.#mut_size -= 1;
109
- return Optional.some(element);
109
+ return some(element);
110
110
  }
111
111
  /**
112
112
  * Adds an element to the back of the queue (FIFO).
@@ -1 +1 @@
1
- {"version":3,"file":"queue.mjs","sources":["../../src/collections/queue.mts"],"sourcesContent":[null],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"queue.mjs","sources":["../../src/collections/queue.mts"],"sourcesContent":[null],"names":["Optional.none","Optional.some"],"mappings":"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"}
@@ -1,4 +1,3 @@
1
- import { Optional } from '../functional/index.mjs';
2
1
  /**
3
2
  * Interface for a high-performance stack with LIFO (Last-In, First-Out)
4
3
  * behavior.
@@ -1 +1 @@
1
- {"version":3,"file":"stack.d.mts","sourceRoot":"","sources":["../../src/collections/stack.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,GAAG,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC1B,CAAC,CAAC;AAwIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAG,gBAAgB,SAAS,CAAC,EAAE,KAAG,KAAK,CAAC,CAAC,CACpC,CAAC"}
1
+ {"version":3,"file":"stack.d.mts","sourceRoot":"","sources":["../../src/collections/stack.mts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,GAAG,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC1B,CAAC,CAAC;AAwIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAG,gBAAgB,SAAS,CAAC,EAAE,KAAG,KAAK,CAAC,CAAC,CACpC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Optional } from '../functional/optional.mjs';
2
- import '../functional/result.mjs';
1
+ import { none } from '../functional/optional/impl/optional-none.mjs';
2
+ import { some } from '../functional/optional/impl/optional-some.mjs';
3
3
  import { range } from '../iterator/range.mjs';
4
4
  import '../number/branded-types/finite-number.mjs';
5
5
  import '../number/branded-types/int.mjs';
@@ -92,13 +92,13 @@ class StackClass {
92
92
  */
93
93
  pop() {
94
94
  if (this.isEmpty) {
95
- return Optional.none;
95
+ return none;
96
96
  }
97
97
  this.#mut_size = Uint32.sub(this.#mut_size, 1);
98
98
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
99
99
  const element = this.#buffer[this.#mut_size];
100
100
  this.#buffer[this.#mut_size] = undefined; // Clear reference for garbage collection
101
- return Optional.some(element);
101
+ return some(element);
102
102
  }
103
103
  /**
104
104
  * Adds an element to the top of the stack (LIFO).
@@ -1 +1 @@
1
- {"version":3,"file":"stack.mjs","sources":["../../src/collections/stack.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgKA;;;;;;;;;;;AAWG;AACH,MAAM,UAAU,CAAA;;AAEd,IAAA,OAAO;;AAGP,IAAA,SAAS;;AAGT,IAAA,SAAS;;AAGT,IAAA,OAAgB,iBAAiB,GAAG,CAAC;AAErC;;;;AAIG;AACH,IAAA,WAAA,CAAY,gBAA8B,EAAE,EAAA;AAC1C,QAAA,MAAM,eAAe,GAAG,QAAQ,CAC9B,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CACjE;AAED,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CACvB,EAAE,MAAM,EAAE,eAAe,EAAE,EAC3B,MAAM,SAAS,CAChB;AACD,QAAA,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC5B,QAAA,IAAI,CAAC,SAAS,GAAG,eAAe;;AAGhC,QAAA,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE;AACjC,YAAA,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAClB;IACF;;AAGA,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,SAAS,KAAK,CAAC;IAC7B;;AAGA,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;IACjC;AAEA;;;;;;;;;;;;;AAaG;IACH,GAAG,GAAA;AACD,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO,QAAQ,CAAC,IAAI;QACtB;AAEA,QAAA,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;;QAE9C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAE;QAC7C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAEzC,QAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/B;AAEA;;;;;;;;;;;;;;;;AAgBG;AACH,IAAA,IAAI,CAAC,KAAQ,EAAA;;QAEX,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,EAAE;YACrC,IAAI,CAAC,OAAO,EAAE;QAChB;QAEA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK;AACpC,QAAA,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAChD;AAEA;;;;AAIG;IACH,OAAO,GAAA;QACL,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;AAChD,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAC1B,EAAE,MAAM,EAAE,WAAW,EAAE,EACvB,MAAM,SAAS,CAChB;;QAGD,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACrC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAChC;AAEA,QAAA,IAAI,CAAC,OAAO,GAAG,SAAS;AACxB,QAAA,IAAI,CAAC,SAAS,GAAG,WAAW;IAC9B;;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDG;AACI,MAAM,WAAW,GAAG,CAAK,aAA4B,KAC1D,IAAI,UAAU,CAAI,aAAa;;;;"}
1
+ {"version":3,"file":"stack.mjs","sources":["../../src/collections/stack.mts"],"sourcesContent":[null],"names":["Optional.none","Optional.some"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgKA;;;;;;;;;;;AAWG;AACH,MAAM,UAAU,CAAA;;AAEd,IAAA,OAAO;;AAGP,IAAA,SAAS;;AAGT,IAAA,SAAS;;AAGT,IAAA,OAAgB,iBAAiB,GAAG,CAAC;AAErC;;;;AAIG;AACH,IAAA,WAAA,CAAY,gBAA8B,EAAE,EAAA;AAC1C,QAAA,MAAM,eAAe,GAAG,QAAQ,CAC9B,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CACjE;AAED,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CACvB,EAAE,MAAM,EAAE,eAAe,EAAE,EAC3B,MAAM,SAAS,CAChB;AACD,QAAA,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC5B,QAAA,IAAI,CAAC,SAAS,GAAG,eAAe;;AAGhC,QAAA,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE;AACjC,YAAA,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAClB;IACF;;AAGA,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,SAAS,KAAK,CAAC;IAC7B;;AAGA,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;IACjC;AAEA;;;;;;;;;;;;;AAaG;IACH,GAAG,GAAA;AACD,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAOA,IAAa;QACtB;AAEA,QAAA,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;;QAE9C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAE;QAC7C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAEzC,QAAA,OAAOC,IAAa,CAAC,OAAO,CAAC;IAC/B;AAEA;;;;;;;;;;;;;;;;AAgBG;AACH,IAAA,IAAI,CAAC,KAAQ,EAAA;;QAEX,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,EAAE;YACrC,IAAI,CAAC,OAAO,EAAE;QAChB;QAEA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK;AACpC,QAAA,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAChD;AAEA;;;;AAIG;IACH,OAAO,GAAA;QACL,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;AAChD,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAC1B,EAAE,MAAM,EAAE,WAAW,EAAE,EACvB,MAAM,SAAS,CAChB;;QAGD,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACrC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAChC;AAEA,QAAA,IAAI,CAAC,OAAO,GAAG,SAAS;AACxB,QAAA,IAAI,CAAC,SAAS,GAAG,WAAW;IAC9B;;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDG;AACI,MAAM,WAAW,GAAG,CAAK,aAA4B,KAC1D,IAAI,UAAU,CAAI,aAAa;;;;"}
@@ -1,3 +1,4 @@
1
1
  export * from './array/index.mjs';
2
+ export * from './functional/index.mjs';
2
3
  export * from './index.mjs';
3
4
  //# sourceMappingURL=entry-point.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry-point.d.mts","sourceRoot":"","sources":["../src/entry-point.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"entry-point.d.mts","sourceRoot":"","sources":["../src/entry-point.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC"}
@@ -1,5 +1,13 @@
1
1
  import * as index from './array/impl/index.mjs';
2
2
  export { index as Arr };
3
+ export { match } from './functional/match.mjs';
4
+ import * as index$1 from './functional/optional/impl/index.mjs';
5
+ export { index$1 as Optional };
6
+ export { pipe } from './functional/pipe.mjs';
7
+ import * as index$2 from './functional/result/impl/index.mjs';
8
+ export { index$2 as Result };
9
+ import * as index$3 from './functional/ternary-result/impl/index.mjs';
10
+ export { index$3 as TernaryResult };
3
11
  export { IMapMapped } from './collections/imap-mapped.mjs';
4
12
  export { IMap } from './collections/imap.mjs';
5
13
  export { ISetMapped } from './collections/iset-mapped.mjs';
@@ -7,10 +15,6 @@ export { ISet } from './collections/iset.mjs';
7
15
  export { createQueue } from './collections/queue.mjs';
8
16
  export { createStack } from './collections/stack.mjs';
9
17
  export { expectType } from './expect-type.mjs';
10
- export { match } from './functional/match.mjs';
11
- export { Optional } from './functional/optional.mjs';
12
- export { pipe } from './functional/pipe.mjs';
13
- export { Result } from './functional/result.mjs';
14
18
  export { hasKey } from './guard/has-key.mjs';
15
19
  export { isNonEmptyString } from './guard/is-non-empty-string.mjs';
16
20
  export { isNonNullObject } from './guard/is-non-null-object.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,6 @@
1
1
  export * from './match.mjs';
2
- export * from './optional.mjs';
2
+ export * from './optional/index.mjs';
3
3
  export * from './pipe.mjs';
4
- export * from './result.mjs';
4
+ export * from './result/index.mjs';
5
+ export * from './ternary-result/index.mjs';
5
6
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/functional/index.mts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/functional/index.mts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
@@ -1,5 +1,9 @@
1
1
  export { match } from './match.mjs';
2
- export { Optional } from './optional.mjs';
2
+ import * as index from './optional/impl/index.mjs';
3
+ export { index as Optional };
3
4
  export { pipe } from './pipe.mjs';
4
- export { Result } from './result.mjs';
5
+ import * as index$1 from './result/impl/index.mjs';
6
+ export { index$1 as Result };
7
+ import * as index$2 from './ternary-result/impl/index.mjs';
8
+ export { index$2 as TernaryResult };
5
9
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,18 @@
1
+ export * from './optional-expect-to-be.mjs';
2
+ export * from './optional-filter.mjs';
3
+ export * from './optional-flat-map.mjs';
4
+ export * from './optional-from-nullable.mjs';
5
+ export * from './optional-is-none.mjs';
6
+ export * from './optional-is-optional.mjs';
7
+ export * from './optional-is-some.mjs';
8
+ export * from './optional-map.mjs';
9
+ export * from './optional-none.mjs';
10
+ export * from './optional-or-else.mjs';
11
+ export * from './optional-some.mjs';
12
+ export * from './optional-to-nullable.mjs';
13
+ export * from './optional-unwrap-or.mjs';
14
+ export * from './optional-unwrap-throw.mjs';
15
+ export * from './optional-unwrap.mjs';
16
+ export * from './optional-zip.mjs';
17
+ export * from './types.mjs';
18
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/index.mts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,17 @@
1
+ export { expectToBe } from './optional-expect-to-be.mjs';
2
+ export { filter } from './optional-filter.mjs';
3
+ export { flatMap } from './optional-flat-map.mjs';
4
+ export { fromNullable } from './optional-from-nullable.mjs';
5
+ export { isNone } from './optional-is-none.mjs';
6
+ export { isOptional } from './optional-is-optional.mjs';
7
+ export { isSome } from './optional-is-some.mjs';
8
+ export { map } from './optional-map.mjs';
9
+ export { none } from './optional-none.mjs';
10
+ export { orElse } from './optional-or-else.mjs';
11
+ export { some } from './optional-some.mjs';
12
+ export { toNullable } from './optional-to-nullable.mjs';
13
+ export { unwrapOr } from './optional-unwrap-or.mjs';
14
+ export { unwrapThrow } from './optional-unwrap-throw.mjs';
15
+ export { unwrap } from './optional-unwrap.mjs';
16
+ export { zip } from './optional-zip.mjs';
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -0,0 +1,29 @@
1
+ import { type Unwrap } from './types.mjs';
2
+ /**
3
+ * Unwraps an `Optional`, returning the contained value or throwing an error
4
+ * with the provided message.
5
+ *
6
+ * @example
7
+ *
8
+ * ```ts
9
+ * const optionalValue = Optional.some('data');
10
+ *
11
+ * assert(Optional.expectToBe(optionalValue, 'value expected') === 'data');
12
+ *
13
+ * const expectValue = Optional.expectToBe<string>('missing optional');
14
+ *
15
+ * assert.throws(() => expectValue(Optional.none), /missing optional/u);
16
+ * assert(expectValue(Optional.some('present')) === 'present');
17
+ * ```
18
+ *
19
+ * @template O The `UnknownOptional` type to unwrap.
20
+ * @param optional The `Optional` to unwrap.
21
+ * @param message The error message to throw if the `Optional` is
22
+ * `None`.
23
+ * @returns The contained value if `Some`.
24
+ * @throws Error with the provided message if the `Optional` is
25
+ * `None`.
26
+ */
27
+ export declare function expectToBe<O extends UnknownOptional>(optional: O, message: string): Unwrap<O>;
28
+ export declare function expectToBe<S>(message: string): (optional: Optional<S>) => S;
29
+ //# sourceMappingURL=optional-expect-to-be.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-expect-to-be.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-expect-to-be.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,eAAe,EAClD,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,CAAC,CAAC,CAAC;AAGb,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { isSome } from './optional-is-some.mjs';
2
+ import { unwrap } from './optional-unwrap.mjs';
3
+
4
+ function expectToBe(...args) {
5
+ switch (args.length) {
6
+ case 2: {
7
+ const [optional, message] = args;
8
+ return expectToBeImpl(optional, message);
9
+ }
10
+ case 1: {
11
+ // Curried version: first argument is message
12
+ const [message] = args;
13
+ return (optional) => expectToBeImpl(optional, message);
14
+ }
15
+ }
16
+ }
17
+ const expectToBeImpl = (optional, message) => {
18
+ if (isSome(optional)) {
19
+ return unwrap(optional);
20
+ }
21
+ throw new Error(message);
22
+ };
23
+
24
+ export { expectToBe };
25
+ //# sourceMappingURL=optional-expect-to-be.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-expect-to-be.mjs","sources":["../../../../src/functional/optional/impl/optional-expect-to-be.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAqCM,SAAU,UAAU,CACxB,GAAG,IAA0E,EAAA;AAE7E,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,IAAI;AAChC,YAAA,OAAO,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC1C;QAEA,KAAK,CAAC,EAAE;;AAEN,YAAA,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI;YACtB,OAAO,CAAC,QAA6B,KACnC,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC;QACrC;;AAEJ;AAEA,MAAM,cAAc,GAAG,CACrB,QAAW,EACX,OAAe,KACF;AACb,IAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE;AACpB,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB;AAEA,IAAA,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAC1B,CAAC;;;;"}
@@ -0,0 +1,29 @@
1
+ import { type Unwrap } from './types.mjs';
2
+ /**
3
+ * Filters an `Optional` based on a predicate. If the `Optional` is `Some` and
4
+ * the predicate returns true, returns the original `Optional`. Otherwise
5
+ * returns `None`.
6
+ *
7
+ * @example
8
+ *
9
+ * ```ts
10
+ * const even = Optional.filter(Optional.some(4), (value) => value % 2 === 0);
11
+ * const odd = Optional.filter(Optional.some(3), (value) => value % 2 === 0);
12
+ *
13
+ * assert.deepStrictEqual(even, Optional.some(4));
14
+ * assert.deepStrictEqual(odd, Optional.none);
15
+ *
16
+ * const filterEven = Optional.filter((value: number) => value % 2 === 0);
17
+ *
18
+ * assert.deepStrictEqual(filterEven(Optional.some(6)), Optional.some(6));
19
+ * assert.deepStrictEqual(filterEven(Optional.some(5)), Optional.none);
20
+ * ```
21
+ *
22
+ * @template O The input `UnknownOptional` type.
23
+ * @param optional The `Optional` to filter.
24
+ * @param predicate The predicate function.
25
+ * @returns The filtered `Optional`.
26
+ */
27
+ export declare function filter<O extends UnknownOptional>(optional: O, predicate: (value: Unwrap<O>) => boolean): Optional<Unwrap<O>>;
28
+ export declare function filter<S>(predicate: (value: S) => boolean): (optional: Optional<S>) => Optional<S>;
29
+ //# sourceMappingURL=optional-filter.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-filter.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-filter.mts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,eAAe,EAC9C,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,GACvC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAGvB,wBAAgB,MAAM,CAAC,CAAC,EACtB,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAC/B,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { isSome } from './optional-is-some.mjs';
2
+ import { none } from './optional-none.mjs';
3
+ import { some } from './optional-some.mjs';
4
+ import { unwrap } from './optional-unwrap.mjs';
5
+
6
+ function filter(...args) {
7
+ switch (args.length) {
8
+ case 2: {
9
+ const [optional, predicate] = args;
10
+ return filterImpl(optional, predicate);
11
+ }
12
+ case 1: {
13
+ // Curried version: first argument is predicate function
14
+ const [predicate] = args;
15
+ return (optional) => filterImpl(optional, predicate);
16
+ }
17
+ }
18
+ }
19
+ const filterImpl = (optional, predicate) => {
20
+ if (isSome(optional)) {
21
+ const value = unwrap(optional);
22
+ return predicate(value) ? some(value) : none;
23
+ }
24
+ return none;
25
+ };
26
+
27
+ export { filter };
28
+ //# sourceMappingURL=optional-filter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-filter.mjs","sources":["../../../../src/functional/optional/impl/optional-filter.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAyCM,SAAU,MAAM,CACpB,GAAG,IAEoD,EAAA;AAEvD,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,IAAI;AAClC,YAAA,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;QACxC;QAEA,KAAK,CAAC,EAAE;;AAEN,YAAA,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI;YACxB,OAAO,CAAC,QAAW,KAAK,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;QACzD;;AAEJ;AAEA,MAAM,UAAU,GAAG,CACjB,QAAW,EACX,SAAwC,KACjB;AACvB,IAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE;AACpB,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC9B,QAAA,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI;IAC9C;AAEA,IAAA,OAAO,IAAI;AACb,CAAC;;;;"}
@@ -0,0 +1,33 @@
1
+ import { type Unwrap } from './types.mjs';
2
+ /**
3
+ * Applies a function that returns an `Optional` to the value in an
4
+ * `Some`. If the input is `None`, returns `None`.
5
+ * This is the monadic bind operation for `Optional`.
6
+ *
7
+ * @example
8
+ *
9
+ * ```ts
10
+ * const parseNumber = (input: string): Optional<number> => {
11
+ * const num = Number.parseInt(input, 10);
12
+ * return Number.isNaN(num) ? Optional.none : Optional.some(num);
13
+ * };
14
+ *
15
+ * const parsed = Optional.flatMap(Optional.some('10'), parseNumber);
16
+ *
17
+ * assert.deepStrictEqual(parsed, Optional.some(10));
18
+ *
19
+ * const flatMapParse = Optional.flatMap(parseNumber);
20
+ *
21
+ * assert.deepStrictEqual(flatMapParse(Optional.some('5')), Optional.some(5));
22
+ * assert.deepStrictEqual(flatMapParse(Optional.some('invalid')), Optional.none);
23
+ * ```
24
+ *
25
+ * @template O The input `UnknownOptional` type.
26
+ * @template S2 The value type of the `Optional` returned by the function.
27
+ * @param optional The `Optional` to flat map.
28
+ * @param flatMapFn The function to apply that returns an `Optional`.
29
+ * @returns The result of applying the function, or `None`.
30
+ */
31
+ export declare function flatMap<O extends UnknownOptional, S2>(optional: O, flatMapFn: (value: Unwrap<O>) => Optional<S2>): Optional<S2>;
32
+ export declare function flatMap<S, S2>(flatMapFn: (value: S) => Optional<S2>): (optional: Optional<S>) => Optional<S2>;
33
+ //# sourceMappingURL=optional-flat-map.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-flat-map.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-flat-map.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,eAAe,EAAE,EAAE,EACnD,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,EAAE,CAAC,GAC5C,QAAQ,CAAC,EAAE,CAAC,CAAC;AAGhB,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,CAAC,EAAE,CAAC,GACpC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { isSome } from './optional-is-some.mjs';
2
+ import { none } from './optional-none.mjs';
3
+ import { unwrap } from './optional-unwrap.mjs';
4
+
5
+ function flatMap(...args) {
6
+ switch (args.length) {
7
+ case 2: {
8
+ const [optional, flatMapFn] = args;
9
+ return flatMapImpl(optional, flatMapFn);
10
+ }
11
+ case 1: {
12
+ // Curried version
13
+ const [flatMapFn] = args;
14
+ return (optional) => flatMapImpl(optional, flatMapFn);
15
+ }
16
+ }
17
+ }
18
+ const flatMapImpl = (optional, flatMapFn) => (isSome(optional) ? flatMapFn(unwrap(optional)) : none);
19
+
20
+ export { flatMap };
21
+ //# sourceMappingURL=optional-flat-map.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-flat-map.mjs","sources":["../../../../src/functional/optional/impl/optional-flat-map.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AA4CM,SAAU,OAAO,CACrB,GAAG,IAEyD,EAAA;AAE5D,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,IAAI;AAClC,YAAA,OAAO,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;QACzC;QAEA,KAAK,CAAC,EAAE;;AAEN,YAAA,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI;YACxB,OAAO,CAAC,QAAW,KAAK,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC1D;;AAEJ;AAEA,MAAM,WAAW,GAAG,CAClB,QAAW,EACX,SAA6C,MAC3B,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC;;;;"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Converts a nullable value to an `Optional`.
3
+ *
4
+ * This is the primary way to lift nullable values (null or undefined) into
5
+ * the Optional type system. The function treats both `null` and `undefined`
6
+ * as empty values, converting them to `None`.
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * const present = Optional.fromNullable('hello');
12
+ * const absent = Optional.fromNullable<string | null>(null);
13
+ *
14
+ * assert.deepStrictEqual(present, Optional.some('hello'));
15
+ * assert.deepStrictEqual(absent, Optional.none);
16
+ * ```
17
+ *
18
+ * @template T The type of the nullable value.
19
+ * @param value The nullable value to convert.
20
+ * @returns `Some<NonNullable<T>>` if the value is not null or
21
+ * undefined, otherwise `None`.
22
+ */
23
+ export declare const fromNullable: <T>(value: T | null | undefined) => Optional<NonNullable<T>>;
24
+ //# sourceMappingURL=optional-from-nullable.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-from-nullable.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-from-nullable.mts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,EAC5B,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KAC1B,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAyC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { none } from './optional-none.mjs';
2
+ import { some } from './optional-some.mjs';
3
+
4
+ /**
5
+ * Converts a nullable value to an `Optional`.
6
+ *
7
+ * This is the primary way to lift nullable values (null or undefined) into
8
+ * the Optional type system. The function treats both `null` and `undefined`
9
+ * as empty values, converting them to `None`.
10
+ *
11
+ * @example
12
+ *
13
+ * ```ts
14
+ * const present = Optional.fromNullable('hello');
15
+ * const absent = Optional.fromNullable<string | null>(null);
16
+ *
17
+ * assert.deepStrictEqual(present, Optional.some('hello'));
18
+ * assert.deepStrictEqual(absent, Optional.none);
19
+ * ```
20
+ *
21
+ * @template T The type of the nullable value.
22
+ * @param value The nullable value to convert.
23
+ * @returns `Some<NonNullable<T>>` if the value is not null or
24
+ * undefined, otherwise `None`.
25
+ */
26
+ const fromNullable = (value) => (value == null ? none : some(value));
27
+
28
+ export { fromNullable };
29
+ //# sourceMappingURL=optional-from-nullable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-from-nullable.mjs","sources":["../../../../src/functional/optional/impl/optional-from-nullable.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;;;AAqBG;AACI,MAAM,YAAY,GAAG,CAC1B,KAA2B,MACG,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;;;;"}
@@ -0,0 +1,22 @@
1
+ import { type NarrowToNone } from './types.mjs';
2
+ /**
3
+ * Checks if an {@link Optional} is {@link None}. Acts as a type guard.
4
+ *
5
+ * @example
6
+ *
7
+ * ```ts
8
+ * const optionalValue = Optional.none as Optional<number>;
9
+ *
10
+ * if (Optional.isNone(optionalValue)) {
11
+ * // Type narrowed to None
12
+ * assert.ok(true); // optionalValue is None
13
+ * }
14
+ * ```
15
+ *
16
+ * @template O The {@link UnknownOptional} type to check.
17
+ * @param optional The {@link Optional} to check.
18
+ * @returns `true` if the {@link Optional} is {@link None}, `false`
19
+ * otherwise.
20
+ */
21
+ export declare const isNone: <O extends UnknownOptional>(optional: O) => optional is NarrowToNone<O>;
22
+ //# sourceMappingURL=optional-is-none.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-is-none.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-is-none.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,eAAe,EAC9C,UAAU,CAAC,KACV,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAuC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { NoneTypeTagName } from './tag.mjs';
2
+
3
+ /**
4
+ * Checks if an {@link Optional} is {@link None}. Acts as a type guard.
5
+ *
6
+ * @example
7
+ *
8
+ * ```ts
9
+ * const optionalValue = Optional.none as Optional<number>;
10
+ *
11
+ * if (Optional.isNone(optionalValue)) {
12
+ * // Type narrowed to None
13
+ * assert.ok(true); // optionalValue is None
14
+ * }
15
+ * ```
16
+ *
17
+ * @template O The {@link UnknownOptional} type to check.
18
+ * @param optional The {@link Optional} to check.
19
+ * @returns `true` if the {@link Optional} is {@link None}, `false`
20
+ * otherwise.
21
+ */
22
+ const isNone = (optional) => optional.$$tag === NoneTypeTagName;
23
+
24
+ export { isNone };
25
+ //# sourceMappingURL=optional-is-none.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-is-none.mjs","sources":["../../../../src/functional/optional/impl/optional-is-none.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,MAAM,GAAG,CACpB,QAAW,KACqB,QAAQ,CAAC,KAAK,KAAK;;;;"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Checks if the given value is an {@link Optional}.
3
+ *
4
+ * @example
5
+ *
6
+ * ```ts
7
+ * const maybeOptional = Optional.some('value');
8
+ * const notOptional = { $$tag: 'ts-data-forge::Optional.some' };
9
+ *
10
+ * assert.ok(Optional.isOptional(maybeOptional));
11
+ * assert.notOk(Optional.isOptional(notOptional));
12
+ * ```
13
+ *
14
+ * @param maybeOptional The value to check.
15
+ * @returns `true` if the value is an {@link Optional}, otherwise `false`.
16
+ */
17
+ export declare const isOptional: (maybeOptional: unknown) => maybeOptional is Optional<unknown>;
18
+ //# sourceMappingURL=optional-is-optional.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-is-optional.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-is-optional.mts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,GACrB,eAAe,OAAO,KACrB,aAAa,IAAI,QAAQ,CAAC,OAAO,CAKW,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { isRecord } from '../../../guard/is-record.mjs';
2
+ import { SomeTypeTagName, NoneTypeTagName } from './tag.mjs';
3
+
4
+ /**
5
+ * Checks if the given value is an {@link Optional}.
6
+ *
7
+ * @example
8
+ *
9
+ * ```ts
10
+ * const maybeOptional = Optional.some('value');
11
+ * const notOptional = { $$tag: 'ts-data-forge::Optional.some' };
12
+ *
13
+ * assert.ok(Optional.isOptional(maybeOptional));
14
+ * assert.notOk(Optional.isOptional(notOptional));
15
+ * ```
16
+ *
17
+ * @param maybeOptional The value to check.
18
+ * @returns `true` if the value is an {@link Optional}, otherwise `false`.
19
+ */
20
+ const isOptional = (maybeOptional) => isRecord(maybeOptional) &&
21
+ Object.hasOwn(maybeOptional, '$$tag') &&
22
+ ((maybeOptional['$$tag'] === SomeTypeTagName &&
23
+ Object.hasOwn(maybeOptional, 'value')) ||
24
+ maybeOptional['$$tag'] === NoneTypeTagName);
25
+
26
+ export { isOptional };
27
+ //# sourceMappingURL=optional-is-optional.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-is-optional.mjs","sources":["../../../../src/functional/optional/impl/optional-is-optional.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,UAAU,GAAG,CACxB,aAAsB,KAEtB,QAAQ,CAAC,aAAa,CAAC;AACvB,IAAA,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC;AACrC,KAAC,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,eAAe;AAC1C,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC;AACrC,QAAA,aAAa,CAAC,OAAO,CAAC,KAAK,eAAe;;;;"}
@@ -0,0 +1,22 @@
1
+ import { type NarrowToSome } from './types.mjs';
2
+ /**
3
+ * Checks if an {@link Optional} is {@link Some}. Acts as a type guard.
4
+ *
5
+ * @example
6
+ *
7
+ * ```ts
8
+ * const optionalNumber = Optional.some(42);
9
+ *
10
+ * if (Optional.isSome(optionalNumber)) {
11
+ * const value: number = optionalNumber.value;
12
+ * assert(value === 42);
13
+ * }
14
+ * ```
15
+ *
16
+ * @template O The {@link UnknownOptional} type to check.
17
+ * @param optional The {@link Optional} to check.
18
+ * @returns `true` if the {@link Optional} is {@link Some}, `false`
19
+ * otherwise.
20
+ */
21
+ export declare const isSome: <O extends UnknownOptional>(optional: O) => optional is NarrowToSome<O>;
22
+ //# sourceMappingURL=optional-is-some.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-is-some.d.mts","sourceRoot":"","sources":["../../../../src/functional/optional/impl/optional-is-some.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,eAAe,EAC9C,UAAU,CAAC,KACV,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAuC,CAAC"}