ts-data-forge 5.0.1 → 5.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 (527) hide show
  1. package/README.md +55 -6
  2. package/dist/array/impl/array-utils-creation.d.mts +14 -0
  3. package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
  4. package/dist/array/impl/array-utils-creation.mjs +12 -0
  5. package/dist/array/impl/array-utils-creation.mjs.map +1 -1
  6. package/dist/array/impl/array-utils-element-access.d.mts +10 -0
  7. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-element-access.mjs +6 -0
  9. package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
  10. package/dist/array/impl/array-utils-modification.d.mts +14 -0
  11. package/dist/array/impl/array-utils-modification.d.mts.map +1 -1
  12. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  13. package/dist/array/impl/array-utils-reducing-value.d.mts +26 -2
  14. package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
  15. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  16. package/dist/array/impl/array-utils-search.d.mts +30 -0
  17. package/dist/array/impl/array-utils-search.d.mts.map +1 -1
  18. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  19. package/dist/array/impl/array-utils-set-op.d.mts +13 -0
  20. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  21. package/dist/array/impl/array-utils-set-op.mjs +13 -0
  22. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  23. package/dist/array/impl/array-utils-size.d.mts +3 -0
  24. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  25. package/dist/array/impl/array-utils-size.mjs +3 -0
  26. package/dist/array/impl/array-utils-size.mjs.map +1 -1
  27. package/dist/array/impl/array-utils-slice-clamped.d.mts +2 -0
  28. package/dist/array/impl/array-utils-slice-clamped.d.mts.map +1 -1
  29. package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
  30. package/dist/array/impl/array-utils-slicing.d.mts +15 -0
  31. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  32. package/dist/array/impl/array-utils-slicing.mjs +7 -0
  33. package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
  34. package/dist/array/impl/array-utils-transformation.d.mts +27 -0
  35. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  36. package/dist/array/impl/array-utils-transformation.mjs +6 -0
  37. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  38. package/dist/array/impl/array-utils-validation.d.mts +17 -0
  39. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  40. package/dist/array/impl/array-utils-validation.mjs +11 -0
  41. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  42. package/dist/collections/imap-mapped.mjs.map +1 -1
  43. package/dist/collections/imap.d.mts +20 -0
  44. package/dist/collections/imap.d.mts.map +1 -1
  45. package/dist/collections/imap.mjs +2 -0
  46. package/dist/collections/imap.mjs.map +1 -1
  47. package/dist/collections/iset-mapped.d.mts +27 -0
  48. package/dist/collections/iset-mapped.d.mts.map +1 -1
  49. package/dist/collections/iset-mapped.mjs +7 -0
  50. package/dist/collections/iset-mapped.mjs.map +1 -1
  51. package/dist/collections/iset.d.mts +29 -0
  52. package/dist/collections/iset.d.mts.map +1 -1
  53. package/dist/collections/iset.mjs +7 -0
  54. package/dist/collections/iset.mjs.map +1 -1
  55. package/dist/collections/queue.d.mts +40 -0
  56. package/dist/collections/queue.d.mts.map +1 -1
  57. package/dist/collections/queue.mjs +8 -0
  58. package/dist/collections/queue.mjs.map +1 -1
  59. package/dist/collections/stack.d.mts +35 -0
  60. package/dist/collections/stack.d.mts.map +1 -1
  61. package/dist/collections/stack.mjs +7 -0
  62. package/dist/collections/stack.mjs.map +1 -1
  63. package/dist/entry-point.mjs +1 -1
  64. package/dist/functional/match.d.mts.map +1 -1
  65. package/dist/functional/match.mjs.map +1 -1
  66. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +1 -0
  67. package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -1
  68. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  69. package/dist/functional/optional/impl/optional-filter.d.mts +3 -0
  70. package/dist/functional/optional/impl/optional-filter.d.mts.map +1 -1
  71. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  72. package/dist/functional/optional/impl/optional-flat-map.d.mts +2 -0
  73. package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -1
  74. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  75. package/dist/functional/optional/impl/optional-from-nullable.d.mts +2 -0
  76. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  77. package/dist/functional/optional/impl/optional-from-nullable.mjs +2 -0
  78. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  79. package/dist/functional/optional/impl/optional-is-optional.d.mts +2 -0
  80. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  81. package/dist/functional/optional/impl/optional-is-optional.mjs +2 -0
  82. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  83. package/dist/functional/optional/impl/optional-is-some.d.mts +1 -0
  84. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  85. package/dist/functional/optional/impl/optional-is-some.mjs +1 -0
  86. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  87. package/dist/functional/optional/impl/optional-map.d.mts +2 -0
  88. package/dist/functional/optional/impl/optional-map.d.mts.map +1 -1
  89. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  90. package/dist/functional/optional/impl/optional-none.d.mts +2 -0
  91. package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
  92. package/dist/functional/optional/impl/optional-none.mjs +2 -0
  93. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  94. package/dist/functional/optional/impl/optional-or-else.d.mts +4 -0
  95. package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -1
  96. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  97. package/dist/functional/optional/impl/optional-some.d.mts +3 -1
  98. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  99. package/dist/functional/optional/impl/optional-some.mjs +2 -0
  100. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  101. package/dist/functional/optional/impl/optional-to-nullable.d.mts +2 -0
  102. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  103. package/dist/functional/optional/impl/optional-to-nullable.mjs +2 -0
  104. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  105. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +3 -0
  106. package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +1 -1
  107. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  108. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +1 -0
  109. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  110. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +1 -0
  111. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  112. package/dist/functional/optional/impl/optional-unwrap.d.mts +2 -0
  113. package/dist/functional/optional/impl/optional-unwrap.d.mts.map +1 -1
  114. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  115. package/dist/functional/optional/impl/optional-zip.d.mts +2 -0
  116. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  117. package/dist/functional/optional/impl/optional-zip.mjs +2 -0
  118. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  119. package/dist/functional/result/impl/result-err.d.mts +3 -1
  120. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  121. package/dist/functional/result/impl/result-err.mjs +2 -0
  122. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  123. package/dist/functional/result/impl/result-expect-to-be.d.mts +1 -0
  124. package/dist/functional/result/impl/result-expect-to-be.d.mts.map +1 -1
  125. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
  126. package/dist/functional/result/impl/result-flat-map.d.mts +5 -0
  127. package/dist/functional/result/impl/result-flat-map.d.mts.map +1 -1
  128. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
  129. package/dist/functional/result/impl/result-fold.d.mts +4 -0
  130. package/dist/functional/result/impl/result-fold.d.mts.map +1 -1
  131. package/dist/functional/result/impl/result-fold.mjs.map +1 -1
  132. package/dist/functional/result/impl/result-from-promise.d.mts +3 -0
  133. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  134. package/dist/functional/result/impl/result-from-promise.mjs +3 -0
  135. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  136. package/dist/functional/result/impl/result-from-throwable.d.mts +2 -0
  137. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  138. package/dist/functional/result/impl/result-from-throwable.mjs +2 -0
  139. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
  140. package/dist/functional/result/impl/result-is-err.d.mts +2 -0
  141. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  142. package/dist/functional/result/impl/result-is-err.mjs +2 -0
  143. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  144. package/dist/functional/result/impl/result-is-ok.d.mts +2 -0
  145. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  146. package/dist/functional/result/impl/result-is-ok.mjs +2 -0
  147. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  148. package/dist/functional/result/impl/result-is-result.d.mts +4 -0
  149. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  150. package/dist/functional/result/impl/result-is-result.mjs +4 -0
  151. package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
  152. package/dist/functional/result/impl/result-map-err.d.mts +3 -0
  153. package/dist/functional/result/impl/result-map-err.d.mts.map +1 -1
  154. package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
  155. package/dist/functional/result/impl/result-map.d.mts +4 -0
  156. package/dist/functional/result/impl/result-map.d.mts.map +1 -1
  157. package/dist/functional/result/impl/result-map.mjs.map +1 -1
  158. package/dist/functional/result/impl/result-ok.d.mts +3 -1
  159. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  160. package/dist/functional/result/impl/result-ok.mjs +2 -0
  161. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  162. package/dist/functional/result/impl/result-or-else.d.mts +4 -0
  163. package/dist/functional/result/impl/result-or-else.d.mts.map +1 -1
  164. package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
  165. package/dist/functional/result/impl/result-swap.d.mts +2 -0
  166. package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
  167. package/dist/functional/result/impl/result-swap.mjs +2 -0
  168. package/dist/functional/result/impl/result-swap.mjs.map +1 -1
  169. package/dist/functional/result/impl/result-to-optional.d.mts +2 -0
  170. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
  171. package/dist/functional/result/impl/result-to-optional.mjs +2 -0
  172. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
  173. package/dist/functional/result/impl/result-unwrap-err-or.d.mts +3 -0
  174. package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +1 -1
  175. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
  176. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +2 -0
  177. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
  178. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +2 -0
  179. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  180. package/dist/functional/result/impl/result-unwrap-err.d.mts +1 -0
  181. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  182. package/dist/functional/result/impl/result-unwrap-err.mjs +1 -0
  183. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
  184. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +3 -0
  185. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +1 -1
  186. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
  187. package/dist/functional/result/impl/result-unwrap-ok.d.mts +1 -0
  188. package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +1 -1
  189. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
  190. package/dist/functional/result/impl/result-unwrap-throw.d.mts +2 -0
  191. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  192. package/dist/functional/result/impl/result-unwrap-throw.mjs +2 -0
  193. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  194. package/dist/functional/result/impl/result-zip.d.mts +3 -1
  195. package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
  196. package/dist/functional/result/impl/result-zip.mjs +3 -1
  197. package/dist/functional/result/impl/result-zip.mjs.map +1 -1
  198. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +2 -1
  199. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  200. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +1 -0
  201. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  202. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +1 -0
  203. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +1 -1
  204. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
  205. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +4 -0
  206. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +1 -1
  207. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
  208. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +2 -0
  209. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +1 -1
  210. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
  211. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +2 -0
  212. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
  213. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +2 -0
  214. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
  215. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +2 -0
  216. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
  217. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +2 -0
  218. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
  219. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +1 -0
  220. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
  221. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +1 -0
  222. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
  223. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +4 -0
  224. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
  225. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +4 -0
  226. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
  227. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +1 -0
  228. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
  229. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +1 -0
  230. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
  231. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +3 -0
  232. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +1 -1
  233. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
  234. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +3 -0
  235. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +1 -1
  236. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
  237. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +6 -0
  238. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +1 -1
  239. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
  240. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +1 -1
  241. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  242. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  243. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +2 -0
  244. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +1 -1
  245. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
  246. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +2 -0
  247. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
  248. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +2 -0
  249. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
  250. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +2 -0
  251. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +1 -1
  252. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
  253. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +1 -0
  254. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
  255. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +1 -0
  256. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  257. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +2 -0
  258. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
  259. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +2 -0
  260. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
  261. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +2 -0
  262. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +1 -1
  263. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
  264. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +2 -0
  265. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +1 -1
  266. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
  267. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +1 -0
  268. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
  269. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +1 -0
  270. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  271. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +2 -0
  272. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +1 -1
  273. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
  274. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +1 -0
  275. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
  276. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +1 -0
  277. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  278. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +2 -0
  279. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
  280. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +2 -0
  281. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
  282. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +1 -1
  283. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  284. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  285. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +4 -0
  286. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
  287. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +4 -0
  288. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
  289. package/dist/globals.d.mts +10 -0
  290. package/dist/guard/index.mjs +1 -1
  291. package/dist/guard/is-record.d.mts +31 -0
  292. package/dist/guard/is-record.d.mts.map +1 -1
  293. package/dist/guard/is-record.mjs +32 -1
  294. package/dist/guard/is-record.mjs.map +1 -1
  295. package/dist/guard/is-type.d.mts +3 -0
  296. package/dist/guard/is-type.d.mts.map +1 -1
  297. package/dist/guard/is-type.mjs +3 -0
  298. package/dist/guard/is-type.mjs.map +1 -1
  299. package/dist/guard/key-is-in.d.mts +1 -0
  300. package/dist/guard/key-is-in.d.mts.map +1 -1
  301. package/dist/guard/key-is-in.mjs +1 -0
  302. package/dist/guard/key-is-in.mjs.map +1 -1
  303. package/dist/index.mjs +1 -1
  304. package/dist/iterator/range.d.mts +4 -0
  305. package/dist/iterator/range.d.mts.map +1 -1
  306. package/dist/iterator/range.mjs +1 -0
  307. package/dist/iterator/range.mjs.map +1 -1
  308. package/dist/json/json.d.mts +21 -0
  309. package/dist/json/json.d.mts.map +1 -1
  310. package/dist/json/json.mjs +21 -0
  311. package/dist/json/json.mjs.map +1 -1
  312. package/dist/number/branded-types/int.d.mts +14 -0
  313. package/dist/number/branded-types/int.d.mts.map +1 -1
  314. package/dist/number/branded-types/int.mjs +14 -0
  315. package/dist/number/branded-types/int.mjs.map +1 -1
  316. package/dist/number/branded-types/non-zero-safe-int.mjs +2 -2
  317. package/dist/number/branded-types/positive-int.d.mts +14 -0
  318. package/dist/number/branded-types/positive-int.d.mts.map +1 -1
  319. package/dist/number/branded-types/positive-int.mjs +14 -0
  320. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  321. package/dist/number/branded-types/positive-safe-int.d.mts +21 -0
  322. package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
  323. package/dist/number/branded-types/positive-safe-int.mjs +22 -1
  324. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  325. package/dist/number/branded-types/safe-int.d.mts +21 -0
  326. package/dist/number/branded-types/safe-int.d.mts.map +1 -1
  327. package/dist/number/branded-types/safe-int.mjs +23 -2
  328. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  329. package/dist/number/branded-types/safe-uint.mjs +1 -1
  330. package/dist/number/branded-types/uint.d.mts +12 -0
  331. package/dist/number/branded-types/uint.d.mts.map +1 -1
  332. package/dist/number/branded-types/uint.mjs +12 -0
  333. package/dist/number/branded-types/uint.mjs.map +1 -1
  334. package/dist/number/num.d.mts +9 -0
  335. package/dist/number/num.d.mts.map +1 -1
  336. package/dist/number/num.mjs +8 -1
  337. package/dist/number/num.mjs.map +1 -1
  338. package/dist/number/refined-number-utils.d.mts +22 -0
  339. package/dist/number/refined-number-utils.d.mts.map +1 -1
  340. package/dist/number/refined-number-utils.mjs +22 -0
  341. package/dist/number/refined-number-utils.mjs.map +1 -1
  342. package/dist/object/object.d.mts +9 -0
  343. package/dist/object/object.d.mts.map +1 -1
  344. package/dist/object/object.mjs +7 -0
  345. package/dist/object/object.mjs.map +1 -1
  346. package/dist/others/map-nullable.mjs.map +1 -1
  347. package/dist/others/tuple.d.mts +11 -0
  348. package/dist/others/tuple.d.mts.map +1 -1
  349. package/dist/others/tuple.mjs +11 -0
  350. package/dist/others/tuple.mjs.map +1 -1
  351. package/dist/others/unknown-to-string.d.mts.map +1 -1
  352. package/dist/others/unknown-to-string.mjs.map +1 -1
  353. package/dist/promise/promise.d.mts +4 -0
  354. package/dist/promise/promise.d.mts.map +1 -1
  355. package/dist/promise/promise.mjs +4 -0
  356. package/dist/promise/promise.mjs.map +1 -1
  357. package/package.json +18 -22
  358. package/src/array/impl/array-utils-creation.mts +20 -0
  359. package/src/array/impl/array-utils-creation.test.mts +71 -0
  360. package/src/array/impl/array-utils-element-access.mts +13 -0
  361. package/src/array/impl/array-utils-element-access.test.mts +21 -0
  362. package/src/array/impl/array-utils-iterators.test.mts +17 -0
  363. package/src/array/impl/array-utils-modification.mts +40 -0
  364. package/src/array/impl/array-utils-modification.test.mts +75 -0
  365. package/src/array/impl/array-utils-overload-type-error.test.mts +19 -0
  366. package/src/array/impl/array-utils-reducing-value.mts +53 -8
  367. package/src/array/impl/array-utils-reducing-value.test.mts +90 -0
  368. package/src/array/impl/array-utils-search.mts +53 -0
  369. package/src/array/impl/array-utils-search.test.mts +51 -0
  370. package/src/array/impl/array-utils-set-op.mts +19 -0
  371. package/src/array/impl/array-utils-set-op.test.mts +116 -0
  372. package/src/array/impl/array-utils-size.mts +3 -0
  373. package/src/array/impl/array-utils-size.test.mts +1 -0
  374. package/src/array/impl/array-utils-slice-clamped.mts +7 -0
  375. package/src/array/impl/array-utils-slice-clamped.test.mts +20 -0
  376. package/src/array/impl/array-utils-slicing.mts +27 -0
  377. package/src/array/impl/array-utils-slicing.test.mts +57 -0
  378. package/src/array/impl/array-utils-transformation.mts +58 -0
  379. package/src/array/impl/array-utils-transformation.test.mts +113 -1
  380. package/src/array/impl/array-utils-validation.mts +23 -0
  381. package/src/array/impl/array-utils-validation.test.mts +96 -0
  382. package/src/array/impl/array.test.mts +12 -0
  383. package/src/collections/imap-mapped.mts +11 -0
  384. package/src/collections/imap-mapped.test.mts +70 -0
  385. package/src/collections/imap.mts +32 -0
  386. package/src/collections/imap.test.mts +106 -0
  387. package/src/collections/iset-mapped.mts +35 -0
  388. package/src/collections/iset-mapped.test.mts +111 -0
  389. package/src/collections/iset.mts +34 -0
  390. package/src/collections/iset.test.mts +193 -0
  391. package/src/collections/queue.mts +53 -0
  392. package/src/collections/queue.test.mts +32 -0
  393. package/src/collections/stack.mts +42 -0
  394. package/src/collections/stack.test.mts +44 -0
  395. package/src/functional/match.mts +16 -0
  396. package/src/functional/match.test.mts +2 -0
  397. package/src/functional/optional/impl/optional-expect-to-be.mts +3 -0
  398. package/src/functional/optional/impl/optional-filter.mts +6 -0
  399. package/src/functional/optional/impl/optional-flat-map.mts +4 -0
  400. package/src/functional/optional/impl/optional-from-nullable.mts +2 -0
  401. package/src/functional/optional/impl/optional-is-optional.mts +2 -0
  402. package/src/functional/optional/impl/optional-is-some.mts +1 -0
  403. package/src/functional/optional/impl/optional-map.mts +5 -0
  404. package/src/functional/optional/impl/optional-none.mts +2 -0
  405. package/src/functional/optional/impl/optional-or-else.mts +6 -0
  406. package/src/functional/optional/impl/optional-some.mts +3 -1
  407. package/src/functional/optional/impl/optional-to-nullable.mts +2 -0
  408. package/src/functional/optional/impl/optional-unwrap-or.mts +5 -0
  409. package/src/functional/optional/impl/optional-unwrap-throw.mts +1 -0
  410. package/src/functional/optional/impl/optional-unwrap.mts +2 -0
  411. package/src/functional/optional/impl/optional-zip.mts +2 -0
  412. package/src/functional/optional.test.mts +73 -0
  413. package/src/functional/pipe.test.mts +3 -0
  414. package/src/functional/result/impl/result-err.mts +3 -1
  415. package/src/functional/result/impl/result-expect-to-be.mts +3 -0
  416. package/src/functional/result/impl/result-flat-map.mts +7 -0
  417. package/src/functional/result/impl/result-fold.mts +6 -0
  418. package/src/functional/result/impl/result-from-promise.mts +3 -0
  419. package/src/functional/result/impl/result-from-throwable.mts +4 -0
  420. package/src/functional/result/impl/result-is-err.mts +2 -0
  421. package/src/functional/result/impl/result-is-ok.mts +2 -0
  422. package/src/functional/result/impl/result-is-result.mts +4 -0
  423. package/src/functional/result/impl/result-map-err.mts +5 -0
  424. package/src/functional/result/impl/result-map.mts +6 -0
  425. package/src/functional/result/impl/result-ok.mts +3 -1
  426. package/src/functional/result/impl/result-or-else.mts +6 -0
  427. package/src/functional/result/impl/result-swap.mts +2 -0
  428. package/src/functional/result/impl/result-to-optional.mts +2 -0
  429. package/src/functional/result/impl/result-unwrap-err-or.mts +5 -0
  430. package/src/functional/result/impl/result-unwrap-err-throw.mts +2 -0
  431. package/src/functional/result/impl/result-unwrap-err.mts +1 -0
  432. package/src/functional/result/impl/result-unwrap-ok-or.mts +5 -0
  433. package/src/functional/result/impl/result-unwrap-ok.mts +2 -0
  434. package/src/functional/result/impl/result-unwrap-throw.mts +2 -0
  435. package/src/functional/result/impl/result-zip.mts +3 -1
  436. package/src/functional/result.test.mts +88 -0
  437. package/src/functional/ternary-result/impl/ternary-result-err.mts +2 -1
  438. package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +4 -0
  439. package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +7 -0
  440. package/src/functional/ternary-result/impl/ternary-result-fold.mts +5 -0
  441. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +2 -0
  442. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +3 -0
  443. package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +1 -0
  444. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +4 -0
  445. package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +1 -0
  446. package/src/functional/ternary-result/impl/ternary-result-map-err.mts +6 -0
  447. package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +6 -0
  448. package/src/functional/ternary-result/impl/ternary-result-map.mts +9 -0
  449. package/src/functional/ternary-result/impl/ternary-result-ok.mts +1 -1
  450. package/src/functional/ternary-result/impl/ternary-result-or-else.mts +5 -0
  451. package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +2 -0
  452. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +5 -0
  453. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +1 -0
  454. package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +2 -0
  455. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +5 -0
  456. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +3 -0
  457. package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +1 -0
  458. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +5 -0
  459. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +1 -0
  460. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +2 -0
  461. package/src/functional/ternary-result/impl/ternary-result-warn.mts +4 -1
  462. package/src/functional/ternary-result/impl/ternary-result-zip.mts +4 -0
  463. package/src/functional/ternary-result.test.mts +91 -0
  464. package/src/globals.d.mts +10 -0
  465. package/src/guard/has-key.test.mts +9 -0
  466. package/src/guard/is-non-empty-string.test.mts +20 -0
  467. package/src/guard/is-non-null-object.test.mts +19 -0
  468. package/src/guard/is-primitive.test.mts +23 -0
  469. package/src/guard/is-record.mts +34 -0
  470. package/src/guard/is-record.test.mts +21 -0
  471. package/src/guard/is-type.mts +3 -0
  472. package/src/guard/is-type.test.mts +134 -0
  473. package/src/guard/key-is-in.mts +1 -0
  474. package/src/iterator/range.mts +9 -0
  475. package/src/json/json.mts +29 -0
  476. package/src/json/json.test.mts +87 -0
  477. package/src/number/branded-types/finite-number.test.mts +38 -0
  478. package/src/number/branded-types/int.mts +14 -0
  479. package/src/number/branded-types/int.test.mts +42 -0
  480. package/src/number/branded-types/int16.test.mts +47 -0
  481. package/src/number/branded-types/int32.test.mts +47 -0
  482. package/src/number/branded-types/non-negative-finite-number.test.mts +40 -0
  483. package/src/number/branded-types/non-negative-int16.test.mts +43 -0
  484. package/src/number/branded-types/non-negative-int32.test.mts +43 -0
  485. package/src/number/branded-types/non-zero-finite-number.test.mts +51 -0
  486. package/src/number/branded-types/non-zero-int.test.mts +53 -0
  487. package/src/number/branded-types/non-zero-int16.test.mts +44 -0
  488. package/src/number/branded-types/non-zero-int32.test.mts +44 -0
  489. package/src/number/branded-types/non-zero-safe-int.mts +2 -2
  490. package/src/number/branded-types/non-zero-safe-int.test.mts +62 -0
  491. package/src/number/branded-types/non-zero-uint16.test.mts +37 -0
  492. package/src/number/branded-types/non-zero-uint32.test.mts +37 -0
  493. package/src/number/branded-types/positive-finite-number.test.mts +45 -0
  494. package/src/number/branded-types/positive-int.mts +14 -0
  495. package/src/number/branded-types/positive-int.test.mts +47 -0
  496. package/src/number/branded-types/positive-int16.test.mts +35 -0
  497. package/src/number/branded-types/positive-int32.test.mts +35 -0
  498. package/src/number/branded-types/positive-safe-int.mts +22 -1
  499. package/src/number/branded-types/positive-safe-int.test.mts +49 -0
  500. package/src/number/branded-types/positive-uint16.test.mts +37 -0
  501. package/src/number/branded-types/positive-uint32.test.mts +37 -0
  502. package/src/number/branded-types/safe-int.mts +23 -2
  503. package/src/number/branded-types/safe-int.test.mts +52 -0
  504. package/src/number/branded-types/safe-uint.mts +1 -1
  505. package/src/number/branded-types/safe-uint.test.mts +48 -0
  506. package/src/number/branded-types/uint.mts +12 -0
  507. package/src/number/branded-types/uint.test.mts +43 -0
  508. package/src/number/branded-types/uint16.test.mts +41 -0
  509. package/src/number/branded-types/uint32.test.mts +41 -0
  510. package/src/number/enum/int8.test.mts +6 -0
  511. package/src/number/enum/uint8.test.mts +6 -0
  512. package/src/number/num.mts +12 -1
  513. package/src/number/num.test.mts +62 -0
  514. package/src/number/refined-number-utils.mts +25 -0
  515. package/src/object/object.mts +15 -0
  516. package/src/object/object.test.mts +10 -0
  517. package/src/others/cast-mutable.test.mts +7 -0
  518. package/src/others/cast-readonly.test.mts +17 -0
  519. package/src/others/if-then.test.mts +16 -0
  520. package/src/others/map-nullable.mts +3 -0
  521. package/src/others/map-nullable.test.mts +27 -0
  522. package/src/others/memoize-function.test.mts +41 -0
  523. package/src/others/tuple.mts +11 -0
  524. package/src/others/unknown-to-string.mts +2 -0
  525. package/src/others/unknown-to-string.test.mts +10 -0
  526. package/src/promise/promise.mts +4 -0
  527. package/src/promise/promise.test.mts +1 -0
@@ -6,8 +6,11 @@
6
6
  *
7
7
  * ```ts
8
8
  * assert.ok(isPositiveSafeInt(1));
9
+ *
9
10
  * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
11
+ *
10
12
  * assert.notOk(isPositiveSafeInt(0));
13
+ *
11
14
  * assert.ok(PositiveSafeInt.is(42));
12
15
  * ```
13
16
  *
@@ -24,6 +27,7 @@ export declare const isPositiveSafeInt: (a: number) => a is PositiveSafeInt;
24
27
  * const branded = asPositiveSafeInt(128);
25
28
  *
26
29
  * assert(branded === 128);
30
+ *
27
31
  * assert.ok(PositiveSafeInt.is(branded));
28
32
  * ```
29
33
  *
@@ -62,8 +66,11 @@ export declare const PositiveSafeInt: {
62
66
  *
63
67
  * ```ts
64
68
  * assert.ok(isPositiveSafeInt(1));
69
+ *
65
70
  * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
71
+ *
66
72
  * assert.notOk(isPositiveSafeInt(0));
73
+ *
67
74
  * assert.ok(PositiveSafeInt.is(42));
68
75
  * ```
69
76
  *
@@ -129,11 +136,15 @@ export declare const PositiveSafeInt: {
129
136
  *
130
137
  * ```ts
131
138
  * const belowRange = PositiveSafeInt.clamp(0);
139
+ *
132
140
  * const withinRange = PositiveSafeInt.clamp(123);
141
+ *
133
142
  * const aboveRange = PositiveSafeInt.clamp(Number.MAX_SAFE_INTEGER + 10);
134
143
  *
135
144
  * assert(belowRange === 1);
145
+ *
136
146
  * assert(withinRange === 123);
147
+ *
137
148
  * assert(aboveRange === Number.MAX_SAFE_INTEGER);
138
149
  * ```
139
150
  *
@@ -148,10 +159,13 @@ export declare const PositiveSafeInt: {
148
159
  *
149
160
  * ```ts
150
161
  * const min = asPositiveSafeInt(1);
162
+ *
151
163
  * const max = asPositiveSafeInt(6);
164
+ *
152
165
  * const randomValue = PositiveSafeInt.random(min, max);
153
166
  *
154
167
  * assert.ok(PositiveSafeInt.is(randomValue));
168
+ *
155
169
  * assert.ok(randomValue >= 1 && randomValue <= 6);
156
170
  * ```
157
171
  *
@@ -165,7 +179,9 @@ export declare const PositiveSafeInt: {
165
179
  *
166
180
  * ```ts
167
181
  * const base = asPositiveSafeInt(3);
182
+ *
168
183
  * const exponent = asPositiveSafeInt(3);
184
+ *
169
185
  * const power = PositiveSafeInt.pow(base, exponent);
170
186
  *
171
187
  * assert(power === 27);
@@ -188,6 +204,7 @@ export declare const PositiveSafeInt: {
188
204
  * );
189
205
  *
190
206
  * assert(sum === 3048);
207
+ *
191
208
  * assert.ok(PositiveSafeInt.is(sum));
192
209
  * ```
193
210
  *
@@ -208,6 +225,7 @@ export declare const PositiveSafeInt: {
208
225
  * );
209
226
  *
210
227
  * assert(difference === 1);
228
+ *
211
229
  * assert.ok(PositiveSafeInt.is(difference));
212
230
  * ```
213
231
  *
@@ -229,6 +247,7 @@ export declare const PositiveSafeInt: {
229
247
  * );
230
248
  *
231
249
  * assert(product === 1000);
250
+ *
232
251
  * assert.ok(PositiveSafeInt.is(product));
233
252
  * ```
234
253
  *
@@ -247,12 +266,14 @@ export declare const PositiveSafeInt: {
247
266
  * asPositiveSafeInt(25),
248
267
  * asPositiveSafeInt(4),
249
268
  * );
269
+ *
250
270
  * const clamped = PositiveSafeInt.div(
251
271
  * asPositiveSafeInt(5),
252
272
  * asPositiveSafeInt(50),
253
273
  * );
254
274
  *
255
275
  * assert(quotient === 6);
276
+ *
256
277
  * assert(clamped === 1);
257
278
  * ```
258
279
  *
@@ -1 +1 @@
1
- {"version":3,"file":"positive-safe-int.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/positive-safe-int.mts"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,qCAAK,CAAC;AAEpC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;MAAW,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;IAC1B;;;;;;;;;;;;;;;OAeG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;;;;;;;;;;;;;;OAiBG;;IAGH;;;;;;;;;;;;;;;;;OAiBG;;IAGH;;;;;;;;;;;;;;;;;OAiBG;;IAGH;;;;;;;;;;;;;;;OAeG;;IAGH;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;;;;;;;OAmBG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;;;;;;;;;;OAsBG;;;;;;;;;;;;;;;CAEK,CAAC"}
1
+ {"version":3,"file":"positive-safe-int.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/positive-safe-int.mts"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,qCAAK,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;MAAW,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;IAC1B;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;;;;;;;;;;;;;;OAiBG;;IAGH;;;;;;;;;;;;;;;;;OAiBG;;IAGH;;;;;;;;;;;;;;;;;;;;;OAqBG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;;;;;;;OAmBG;;IAGH;;;;;;;;;;;;;;;;;;;;OAoBG;;IAGH;;;;;;;;;;;;;;;;;;;OAmBG;;IAGH;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;;;;;;;;;;;;;;;CAEK,CAAC"}
@@ -4,7 +4,7 @@ const typeNameInMessage = 'a positive safe integer';
4
4
  const { MAX_VALUE, MIN_VALUE, add, castType, clamp, div, is, max: max_, min: min_, mul, pow, random, sub, } = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger({
5
5
  integerOrSafeInteger: 'SafeInteger',
6
6
  MIN_VALUE: 1,
7
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
7
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-max-safe-integer
8
8
  MAX_VALUE: Number.MAX_SAFE_INTEGER,
9
9
  typeNameInMessage,
10
10
  });
@@ -16,8 +16,11 @@ const { MAX_VALUE, MIN_VALUE, add, castType, clamp, div, is, max: max_, min: min
16
16
  *
17
17
  * ```ts
18
18
  * assert.ok(isPositiveSafeInt(1));
19
+ *
19
20
  * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
21
+ *
20
22
  * assert.notOk(isPositiveSafeInt(0));
23
+ *
21
24
  * assert.ok(PositiveSafeInt.is(42));
22
25
  * ```
23
26
  *
@@ -34,6 +37,7 @@ const isPositiveSafeInt = is;
34
37
  * const branded = asPositiveSafeInt(128);
35
38
  *
36
39
  * assert(branded === 128);
40
+ *
37
41
  * assert.ok(PositiveSafeInt.is(branded));
38
42
  * ```
39
43
  *
@@ -59,8 +63,11 @@ const PositiveSafeInt = {
59
63
  *
60
64
  * ```ts
61
65
  * assert.ok(isPositiveSafeInt(1));
66
+ *
62
67
  * assert.ok(isPositiveSafeInt(Number.MAX_SAFE_INTEGER));
68
+ *
63
69
  * assert.notOk(isPositiveSafeInt(0));
70
+ *
64
71
  * assert.ok(PositiveSafeInt.is(42));
65
72
  * ```
66
73
  *
@@ -126,11 +133,15 @@ const PositiveSafeInt = {
126
133
  *
127
134
  * ```ts
128
135
  * const belowRange = PositiveSafeInt.clamp(0);
136
+ *
129
137
  * const withinRange = PositiveSafeInt.clamp(123);
138
+ *
130
139
  * const aboveRange = PositiveSafeInt.clamp(Number.MAX_SAFE_INTEGER + 10);
131
140
  *
132
141
  * assert(belowRange === 1);
142
+ *
133
143
  * assert(withinRange === 123);
144
+ *
134
145
  * assert(aboveRange === Number.MAX_SAFE_INTEGER);
135
146
  * ```
136
147
  *
@@ -145,10 +156,13 @@ const PositiveSafeInt = {
145
156
  *
146
157
  * ```ts
147
158
  * const min = asPositiveSafeInt(1);
159
+ *
148
160
  * const max = asPositiveSafeInt(6);
161
+ *
149
162
  * const randomValue = PositiveSafeInt.random(min, max);
150
163
  *
151
164
  * assert.ok(PositiveSafeInt.is(randomValue));
165
+ *
152
166
  * assert.ok(randomValue >= 1 && randomValue <= 6);
153
167
  * ```
154
168
  *
@@ -162,7 +176,9 @@ const PositiveSafeInt = {
162
176
  *
163
177
  * ```ts
164
178
  * const base = asPositiveSafeInt(3);
179
+ *
165
180
  * const exponent = asPositiveSafeInt(3);
181
+ *
166
182
  * const power = PositiveSafeInt.pow(base, exponent);
167
183
  *
168
184
  * assert(power === 27);
@@ -185,6 +201,7 @@ const PositiveSafeInt = {
185
201
  * );
186
202
  *
187
203
  * assert(sum === 3048);
204
+ *
188
205
  * assert.ok(PositiveSafeInt.is(sum));
189
206
  * ```
190
207
  *
@@ -205,6 +222,7 @@ const PositiveSafeInt = {
205
222
  * );
206
223
  *
207
224
  * assert(difference === 1);
225
+ *
208
226
  * assert.ok(PositiveSafeInt.is(difference));
209
227
  * ```
210
228
  *
@@ -226,6 +244,7 @@ const PositiveSafeInt = {
226
244
  * );
227
245
  *
228
246
  * assert(product === 1000);
247
+ *
229
248
  * assert.ok(PositiveSafeInt.is(product));
230
249
  * ```
231
250
  *
@@ -244,12 +263,14 @@ const PositiveSafeInt = {
244
263
  * asPositiveSafeInt(25),
245
264
  * asPositiveSafeInt(4),
246
265
  * );
266
+ *
247
267
  * const clamped = PositiveSafeInt.div(
248
268
  * asPositiveSafeInt(5),
249
269
  * asPositiveSafeInt(50),
250
270
  * );
251
271
  *
252
272
  * assert(quotient === 6);
273
+ *
253
274
  * assert(clamped === 1);
254
275
  * ```
255
276
  *
@@ -1 +1 @@
1
- {"version":3,"file":"positive-safe-int.mjs","sources":["../../../src/number/branded-types/positive-safe-int.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA,MAAM,iBAAiB,GAAG,yBAAyB;AAEnD,MAAM,EACJ,SAAS,EACT,SAAS,EACT,GAAG,EACH,QAAQ,EACR,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,MAAM,EACN,GAAG,GACJ,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,aAAa;AACnC,IAAA,SAAS,EAAE,CAAC;;IAEZ,SAAS,EAAE,MAAM,CAAC,gBAA4B;IAC9C,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;;;;;;;;;;;AAeG;AACI,MAAM,iBAAiB,GAAG;AAEjC;;;;;;;;;;;;;;;AAeG;AACI,MAAM,iBAAiB,GAAG;AAEjC;;;;;;;;AAQG;AACI,MAAM,eAAe,GAAG;AAC7B;;;;;;;;;;;;;;;AAeG;IACH,EAAE;AAEF;;;;AAIG;IACH,SAAS;AAET;;;;AAIG;IACH,SAAS;AAET;;;;;;;;;;;;;;;;;AAiBG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;;;AAiBG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;;;AAiBG;IACH,KAAK;AAEL;;;;;;;;;;;;;;;AAeG;IACH,MAAM;AAEN;;;;;;;;;;;;;;;;AAgBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;AAkBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;;AAmBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;AAkBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;;;;;AAsBG;IACH,GAAG;;;;;"}
1
+ {"version":3,"file":"positive-safe-int.mjs","sources":["../../../src/number/branded-types/positive-safe-int.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA,MAAM,iBAAiB,GAAG,yBAAyB;AAEnD,MAAM,EACJ,SAAS,EACT,SAAS,EACT,GAAG,EACH,QAAQ,EACR,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,MAAM,EACN,GAAG,GACJ,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,aAAa;AACnC,IAAA,SAAS,EAAE,CAAC;;IAEZ,SAAS,EAAE,MAAM,CAAC,gBAA4B;IAC9C,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,iBAAiB,GAAG;AAEjC;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,iBAAiB,GAAG;AAEjC;;;;;;;;AAQG;AACI,MAAM,eAAe,GAAG;AAC7B;;;;;;;;;;;;;;;;;;AAkBG;IACH,EAAE;AAEF;;;;AAIG;IACH,SAAS;AAET;;;;AAIG;IACH,SAAS;AAET;;;;;;;;;;;;;;;;;AAiBG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;;;AAiBG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;;;;;;;AAqBG;IACH,KAAK;AAEL;;;;;;;;;;;;;;;;;;AAkBG;IACH,MAAM;AAEN;;;;;;;;;;;;;;;;;;AAkBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;;AAmBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;;;AAoBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;;AAmBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;IACH,GAAG;;;;;"}
@@ -9,7 +9,9 @@ import { TsDataForgeInternals } from '../refined-number-utils.mjs';
9
9
  *
10
10
  * ```ts
11
11
  * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
12
+ *
12
13
  * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
14
+ *
13
15
  * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
14
16
  * ```
15
17
  *
@@ -30,6 +32,7 @@ export declare const isSafeInt: (a: number) => a is SafeInt;
30
32
  * const branded = asSafeInt(123);
31
33
  *
32
34
  * assert(branded === 123);
35
+ *
33
36
  * assert.ok(SafeInt.is(branded));
34
37
  * ```
35
38
  *
@@ -69,7 +72,9 @@ export declare const SafeInt: {
69
72
  *
70
73
  * ```ts
71
74
  * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
75
+ *
72
76
  * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
77
+ *
73
78
  * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
74
79
  * ```
75
80
  *
@@ -100,9 +105,11 @@ export declare const SafeInt: {
100
105
  *
101
106
  * ```ts
102
107
  * const negative = asSafeInt(-900);
108
+ *
103
109
  * const absolute = SafeInt.abs(negative);
104
110
  *
105
111
  * assert(absolute === 900);
112
+ *
106
113
  * assert.ok(SafeInt.is(absolute));
107
114
  * ```
108
115
  *
@@ -147,11 +154,15 @@ export declare const SafeInt: {
147
154
  *
148
155
  * ```ts
149
156
  * const aboveRange = SafeInt.clamp(1e20);
157
+ *
150
158
  * const withinRange = SafeInt.clamp(123);
159
+ *
151
160
  * const belowRange = SafeInt.clamp(-1e20);
152
161
  *
153
162
  * assert(aboveRange === Number.MAX_SAFE_INTEGER);
163
+ *
154
164
  * assert(withinRange === 123);
165
+ *
155
166
  * assert(belowRange === Number.MIN_SAFE_INTEGER);
156
167
  * ```
157
168
  *
@@ -170,10 +181,13 @@ export declare const SafeInt: {
170
181
  *
171
182
  * ```ts
172
183
  * const min = asSafeInt(-10);
184
+ *
173
185
  * const max = asSafeInt(10);
186
+ *
174
187
  * const randomValue = SafeInt.random(min, max);
175
188
  *
176
189
  * assert.ok(SafeInt.is(randomValue));
190
+ *
177
191
  * assert.ok(randomValue >= -10 && randomValue <= 10);
178
192
  * ```
179
193
  *
@@ -189,10 +203,13 @@ export declare const SafeInt: {
189
203
  *
190
204
  * ```ts
191
205
  * const base = asSafeInt(3);
206
+ *
192
207
  * const exponent = asSafeInt(5);
208
+ *
193
209
  * const power = SafeInt.pow(base, exponent);
194
210
  *
195
211
  * assert(power === 243);
212
+ *
196
213
  * assert.ok(SafeInt.is(power));
197
214
  * ```
198
215
  *
@@ -210,6 +227,7 @@ export declare const SafeInt: {
210
227
  * const sum = SafeInt.add(asSafeInt(9), asSafeInt(4));
211
228
  *
212
229
  * assert(sum === 13);
230
+ *
213
231
  * assert.ok(SafeInt.is(sum));
214
232
  * ```
215
233
  *
@@ -227,6 +245,7 @@ export declare const SafeInt: {
227
245
  * const difference = SafeInt.sub(asSafeInt(9), asSafeInt(14));
228
246
  *
229
247
  * assert(difference === -5);
248
+ *
230
249
  * assert.ok(SafeInt.is(difference));
231
250
  * ```
232
251
  *
@@ -244,6 +263,7 @@ export declare const SafeInt: {
244
263
  * const product = SafeInt.mul(asSafeInt(-8), asSafeInt(7));
245
264
  *
246
265
  * assert(product === -56);
266
+ *
247
267
  * assert.ok(SafeInt.is(product));
248
268
  * ```
249
269
  *
@@ -264,6 +284,7 @@ export declare const SafeInt: {
264
284
  * const quotient = SafeInt.div(asSafeInt(-17), asSafeInt(5));
265
285
  *
266
286
  * assert(quotient === -4);
287
+ *
267
288
  * assert.ok(SafeInt.is(quotient));
268
289
  * ```
269
290
  *
@@ -1 +1 @@
1
- {"version":3,"file":"safe-int.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/safe-int.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAkCnE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS,6BAAK,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS;;;;;;;MAAW,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO;IAClB;;;;;;;;;;;;;;OAcG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;OAaG;;IAGH;;;;;;;;;;;;;OAaG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;;;;;;;;OAoBG;;IAGH;;;;;;;;;;;;;;;;;OAiBG;;IAGH;;;;;;;;;;;;;;;OAeG;;IAGH;;;;;;;;;;;;;;;OAeG;;IAGH;;;;;;;;;;;;;;;OAeG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;;;;;;;;;CAEK,CAAC"}
1
+ {"version":3,"file":"safe-int.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/safe-int.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAkCnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,SAAS,6BAAK,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS;;;;;;;MAAW,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO;IAClB;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;;;;;;;;;;;;;;;;;OAoBG;;IAGH;;;;;;;;;;;;;OAaG;;IAGH;;;;;;;;;;;;;OAaG;;IAGH;;;;;;;;;;;;;;;;;;;;;;OAsBG;;IAGH;;;;;;;;;;;;;;;;;;;;;;;OAuBG;;IAGH;;;;;;;;;;;;;;;;;;;;OAoBG;;IAGH;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;;;;;;;;;;;;;;;;OAmBG;;;;;;;;;;CAEK,CAAC"}
@@ -3,9 +3,9 @@ import { TsDataForgeInternals } from '../refined-number-utils.mjs';
3
3
  const typeNameInMessage = 'a safe integer';
4
4
  const { MAX_VALUE, MIN_VALUE, abs, add, castType, clamp, div, is, max: max_, min: min_, mul, pow, random, sub, } = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger({
5
5
  integerOrSafeInteger: 'SafeInteger',
6
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
6
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-min-safe-integer
7
7
  MIN_VALUE: Number.MIN_SAFE_INTEGER,
8
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
8
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-max-safe-integer
9
9
  MAX_VALUE: Number.MAX_SAFE_INTEGER,
10
10
  typeNameInMessage,
11
11
  });
@@ -19,7 +19,9 @@ const { MAX_VALUE, MIN_VALUE, abs, add, castType, clamp, div, is, max: max_, min
19
19
  *
20
20
  * ```ts
21
21
  * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
22
+ *
22
23
  * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
24
+ *
23
25
  * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
24
26
  * ```
25
27
  *
@@ -40,6 +42,7 @@ const isSafeInt = is;
40
42
  * const branded = asSafeInt(123);
41
43
  *
42
44
  * assert(branded === 123);
45
+ *
43
46
  * assert.ok(SafeInt.is(branded));
44
47
  * ```
45
48
  *
@@ -72,7 +75,9 @@ const SafeInt = {
72
75
  *
73
76
  * ```ts
74
77
  * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
78
+ *
75
79
  * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
80
+ *
76
81
  * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
77
82
  * ```
78
83
  *
@@ -103,9 +108,11 @@ const SafeInt = {
103
108
  *
104
109
  * ```ts
105
110
  * const negative = asSafeInt(-900);
111
+ *
106
112
  * const absolute = SafeInt.abs(negative);
107
113
  *
108
114
  * assert(absolute === 900);
115
+ *
109
116
  * assert.ok(SafeInt.is(absolute));
110
117
  * ```
111
118
  *
@@ -150,11 +157,15 @@ const SafeInt = {
150
157
  *
151
158
  * ```ts
152
159
  * const aboveRange = SafeInt.clamp(1e20);
160
+ *
153
161
  * const withinRange = SafeInt.clamp(123);
162
+ *
154
163
  * const belowRange = SafeInt.clamp(-1e20);
155
164
  *
156
165
  * assert(aboveRange === Number.MAX_SAFE_INTEGER);
166
+ *
157
167
  * assert(withinRange === 123);
168
+ *
158
169
  * assert(belowRange === Number.MIN_SAFE_INTEGER);
159
170
  * ```
160
171
  *
@@ -173,10 +184,13 @@ const SafeInt = {
173
184
  *
174
185
  * ```ts
175
186
  * const min = asSafeInt(-10);
187
+ *
176
188
  * const max = asSafeInt(10);
189
+ *
177
190
  * const randomValue = SafeInt.random(min, max);
178
191
  *
179
192
  * assert.ok(SafeInt.is(randomValue));
193
+ *
180
194
  * assert.ok(randomValue >= -10 && randomValue <= 10);
181
195
  * ```
182
196
  *
@@ -192,10 +206,13 @@ const SafeInt = {
192
206
  *
193
207
  * ```ts
194
208
  * const base = asSafeInt(3);
209
+ *
195
210
  * const exponent = asSafeInt(5);
211
+ *
196
212
  * const power = SafeInt.pow(base, exponent);
197
213
  *
198
214
  * assert(power === 243);
215
+ *
199
216
  * assert.ok(SafeInt.is(power));
200
217
  * ```
201
218
  *
@@ -213,6 +230,7 @@ const SafeInt = {
213
230
  * const sum = SafeInt.add(asSafeInt(9), asSafeInt(4));
214
231
  *
215
232
  * assert(sum === 13);
233
+ *
216
234
  * assert.ok(SafeInt.is(sum));
217
235
  * ```
218
236
  *
@@ -230,6 +248,7 @@ const SafeInt = {
230
248
  * const difference = SafeInt.sub(asSafeInt(9), asSafeInt(14));
231
249
  *
232
250
  * assert(difference === -5);
251
+ *
233
252
  * assert.ok(SafeInt.is(difference));
234
253
  * ```
235
254
  *
@@ -247,6 +266,7 @@ const SafeInt = {
247
266
  * const product = SafeInt.mul(asSafeInt(-8), asSafeInt(7));
248
267
  *
249
268
  * assert(product === -56);
269
+ *
250
270
  * assert.ok(SafeInt.is(product));
251
271
  * ```
252
272
  *
@@ -267,6 +287,7 @@ const SafeInt = {
267
287
  * const quotient = SafeInt.div(asSafeInt(-17), asSafeInt(5));
268
288
  *
269
289
  * assert(quotient === -4);
290
+ *
270
291
  * assert.ok(SafeInt.is(quotient));
271
292
  * ```
272
293
  *
@@ -1 +1 @@
1
- {"version":3,"file":"safe-int.mjs","sources":["../../../src/number/branded-types/safe-int.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA,MAAM,iBAAiB,GAAG,gBAAgB;AAE1C,MAAM,EACJ,SAAS,EACT,SAAS,EACT,GAAG,EACH,GAAG,EACH,QAAQ,EACR,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,MAAM,EACN,GAAG,GACJ,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,aAAa;;IAEnC,SAAS,EAAE,MAAM,CAAC,gBAA2B;;IAE7C,SAAS,EAAE,MAAM,CAAC,gBAA4B;IAC9C,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,SAAS,GAAG;AAEzB;;;;;;;;;;;;;;;;;;;AAmBG;AACI,MAAM,SAAS,GAAG;AAEzB;;;;;;;;;;;;;;;AAeG;AACI,MAAM,OAAO,GAAG;AACrB;;;;;;;;;;;;;;AAcG;IACH,EAAE;AAEF;;;;AAIG;IACH,SAAS;AAET;;;;AAIG;IACH,SAAS;AAET;;;;;;;;;;;;;;;;;;AAkBG;IACH,GAAG;AAEH;;;;;;;;;;;;;AAaG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;AAaG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;;;;AAkBG;IACH,KAAK;AAEL;;;;;;;;;;;;;;;;;;;;AAoBG;IACH,MAAM;AAEN;;;;;;;;;;;;;;;;;AAiBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;AAeG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;AAeG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;AAeG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;AAkBG;IACH,GAAG;;;;;"}
1
+ {"version":3,"file":"safe-int.mjs","sources":["../../../src/number/branded-types/safe-int.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA,MAAM,iBAAiB,GAAG,gBAAgB;AAE1C,MAAM,EACJ,SAAS,EACT,SAAS,EACT,GAAG,EACH,GAAG,EACH,QAAQ,EACR,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,MAAM,EACN,GAAG,GACJ,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,aAAa;;IAEnC,SAAS,EAAE,MAAM,CAAC,gBAA2B;;IAE7C,SAAS,EAAE,MAAM,CAAC,gBAA4B;IAC9C,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,SAAS,GAAG;AAEzB;;;;;;;;;;;;;;;;;;;;AAoBG;AACI,MAAM,SAAS,GAAG;AAEzB;;;;;;;;;;;;;;;AAeG;AACI,MAAM,OAAO,GAAG;AACrB;;;;;;;;;;;;;;;;AAgBG;IACH,EAAE;AAEF;;;;AAIG;IACH,SAAS;AAET;;;;AAIG;IACH,SAAS;AAET;;;;;;;;;;;;;;;;;;;;AAoBG;IACH,GAAG;AAEH;;;;;;;;;;;;;AAaG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;AAaG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;;;;;;;;AAsBG;IACH,KAAK;AAEL;;;;;;;;;;;;;;;;;;;;;;;AAuBG;IACH,MAAM;AAEN;;;;;;;;;;;;;;;;;;;;AAoBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;AAgBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;AAgBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;AAgBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;;;;;;AAmBG;IACH,GAAG;;;;;"}
@@ -4,7 +4,7 @@ const typeNameInMessage = 'a non-negative safe integer';
4
4
  const { MAX_VALUE, MIN_VALUE, add, castType, clamp, div, is, max: max_, min: min_, mul, pow, random, sub, } = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger({
5
5
  integerOrSafeInteger: 'SafeInteger',
6
6
  MIN_VALUE: 0,
7
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
7
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-max-safe-integer
8
8
  MAX_VALUE: Number.MAX_SAFE_INTEGER,
9
9
  typeNameInMessage,
10
10
  });
@@ -5,7 +5,9 @@
5
5
  *
6
6
  * ```ts
7
7
  * assert.ok(isUint(4));
8
+ *
8
9
  * assert.notOk(isUint(-1));
10
+ *
9
11
  * assert.ok(Uint.is(0));
10
12
  * ```
11
13
  *
@@ -22,6 +24,7 @@ export declare const isUint: (a: number) => a is NonNegativeInt;
22
24
  * const branded = asUint(12);
23
25
  *
24
26
  * assert(branded === 12);
27
+ *
25
28
  * assert.ok(Uint.is(branded));
26
29
  * ```
27
30
  *
@@ -56,7 +59,9 @@ export declare const Uint: {
56
59
  *
57
60
  * ```ts
58
61
  * assert.ok(isUint(4));
62
+ *
59
63
  * assert.notOk(isUint(-1));
64
+ *
60
65
  * assert.ok(Uint.is(0));
61
66
  * ```
62
67
  *
@@ -110,9 +115,11 @@ export declare const Uint: {
110
115
  *
111
116
  * ```ts
112
117
  * const clampedNegative = Uint.clamp(-5);
118
+ *
113
119
  * const clampedPositive = Uint.clamp(42);
114
120
  *
115
121
  * assert(clampedNegative === 0);
122
+ *
116
123
  * assert(clampedPositive === 42);
117
124
  * ```
118
125
  *
@@ -127,10 +134,13 @@ export declare const Uint: {
127
134
  *
128
135
  * ```ts
129
136
  * const min = asUint(0);
137
+ *
130
138
  * const max = asUint(3);
139
+ *
131
140
  * const randomValue = Uint.random(min, max);
132
141
  *
133
142
  * assert.ok(Uint.is(randomValue));
143
+ *
134
144
  * assert.ok(randomValue >= 0 && randomValue <= 3);
135
145
  * ```
136
146
  *
@@ -144,7 +154,9 @@ export declare const Uint: {
144
154
  *
145
155
  * ```ts
146
156
  * const base = asUint(2);
157
+ *
147
158
  * const exponent = asUint(5);
159
+ *
148
160
  * const power = Uint.pow(base, exponent);
149
161
  *
150
162
  * assert(power === 32);
@@ -1 +1 @@
1
- {"version":3,"file":"uint.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/uint.mts"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,oCAAK,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;MAAW,CAAC;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,IAAI;IACf;;;;;;;;;;;;;;OAcG;;IAGH;;;;OAIG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;;OAeG;;IAGH;;;;;;;;;;;;;;;OAeG;;IAGH;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;;;;;;;;;;;;;CAEK,CAAC"}
1
+ {"version":3,"file":"uint.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/uint.mts"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,oCAAK,CAAC;AAEzB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;MAAW,CAAC;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,IAAI;IACf;;;;;;;;;;;;;;;;OAgBG;;IAGH;;;;OAIG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;;;;OAiBG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;IAGH;;;;;;;;;;;;;;OAcG;;;;;;;;;;;;;;CAEK,CAAC"}
@@ -14,7 +14,9 @@ const { MIN_VALUE, add, castType, clamp, div, is, max: max_, min: min_, mul, pow
14
14
  *
15
15
  * ```ts
16
16
  * assert.ok(isUint(4));
17
+ *
17
18
  * assert.notOk(isUint(-1));
19
+ *
18
20
  * assert.ok(Uint.is(0));
19
21
  * ```
20
22
  *
@@ -31,6 +33,7 @@ const isUint = is;
31
33
  * const branded = asUint(12);
32
34
  *
33
35
  * assert(branded === 12);
36
+ *
34
37
  * assert.ok(Uint.is(branded));
35
38
  * ```
36
39
  *
@@ -54,7 +57,9 @@ const Uint = {
54
57
  *
55
58
  * ```ts
56
59
  * assert.ok(isUint(4));
60
+ *
57
61
  * assert.notOk(isUint(-1));
62
+ *
58
63
  * assert.ok(Uint.is(0));
59
64
  * ```
60
65
  *
@@ -108,9 +113,11 @@ const Uint = {
108
113
  *
109
114
  * ```ts
110
115
  * const clampedNegative = Uint.clamp(-5);
116
+ *
111
117
  * const clampedPositive = Uint.clamp(42);
112
118
  *
113
119
  * assert(clampedNegative === 0);
120
+ *
114
121
  * assert(clampedPositive === 42);
115
122
  * ```
116
123
  *
@@ -125,10 +132,13 @@ const Uint = {
125
132
  *
126
133
  * ```ts
127
134
  * const min = asUint(0);
135
+ *
128
136
  * const max = asUint(3);
137
+ *
129
138
  * const randomValue = Uint.random(min, max);
130
139
  *
131
140
  * assert.ok(Uint.is(randomValue));
141
+ *
132
142
  * assert.ok(randomValue >= 0 && randomValue <= 3);
133
143
  * ```
134
144
  *
@@ -142,7 +152,9 @@ const Uint = {
142
152
  *
143
153
  * ```ts
144
154
  * const base = asUint(2);
155
+ *
145
156
  * const exponent = asUint(5);
157
+ *
146
158
  * const power = Uint.pow(base, exponent);
147
159
  *
148
160
  * assert(power === 32);
@@ -1 +1 @@
1
- {"version":3,"file":"uint.mjs","sources":["../../../src/number/branded-types/uint.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA,MAAM,iBAAiB,GAAG,wBAAwB;AAElD,MAAM,EACJ,SAAS,EACT,GAAG,EACH,QAAQ,EACR,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,MAAM,EACN,GAAG,GACJ,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,SAAS;AAC/B,IAAA,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC,SAAS;IAC3B,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;;;;;;;;;AAaG;AACI,MAAM,MAAM,GAAG;AAEtB;;;;;;;;;;;;;;;AAeG;AACI,MAAM,MAAM,GAAG;AAEtB;;;;;;AAMG;AACI,MAAM,IAAI,GAAG;AAClB;;;;;;;;;;;;;;AAcG;IACH,EAAE;AAEF;;;;AAIG;IACH,SAAS;AAET;;;;;;;;;;;;;;AAcG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;AAcG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;AAeG;IACH,KAAK;AAEL;;;;;;;;;;;;;;;AAeG;IACH,MAAM;AAEN;;;;;;;;;;;;;;;;AAgBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;;;;;"}
1
+ {"version":3,"file":"uint.mjs","sources":["../../../src/number/branded-types/uint.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA,MAAM,iBAAiB,GAAG,wBAAwB;AAElD,MAAM,EACJ,SAAS,EACT,GAAG,EACH,QAAQ,EACR,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,MAAM,EACN,GAAG,GACJ,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,SAAS;AAC/B,IAAA,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC,SAAS;IAC3B,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;;;;;;;;;;;AAeG;AACI,MAAM,MAAM,GAAG;AAEtB;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,MAAM,GAAG;AAEtB;;;;;;AAMG;AACI,MAAM,IAAI,GAAG;AAClB;;;;;;;;;;;;;;;;AAgBG;IACH,EAAE;AAEF;;;;AAIG;IACH,SAAS;AAET;;;;;;;;;;;;;;AAcG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;AAcG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;;;;;;;;;;;;AAiBG;IACH,KAAK;AAEL;;;;;;;;;;;;;;;;;;AAkBG;IACH,MAAM;AAEN;;;;;;;;;;;;;;;;;;AAkBG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;AAEH;;;;;;;;;;;;;;AAcG;IACH,GAAG;;;;;"}