ts-data-forge 9.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
  2. package/dist/array/impl/array-utils-creation.mjs +17 -112
  3. package/dist/array/impl/array-utils-creation.mjs.map +1 -1
  4. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  5. package/dist/array/impl/array-utils-element-access.mjs +22 -61
  6. package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
  7. package/dist/array/impl/array-utils-iterators.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-iterators.mjs +9 -63
  9. package/dist/array/impl/array-utils-iterators.mjs.map +1 -1
  10. package/dist/array/impl/array-utils-modification.mjs +78 -78
  11. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  12. package/dist/array/impl/array-utils-reducing-value.mjs +95 -89
  13. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  14. package/dist/array/impl/array-utils-search.mjs +100 -92
  15. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  16. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  17. package/dist/array/impl/array-utils-set-op.mjs +31 -141
  18. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  19. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  20. package/dist/array/impl/array-utils-size.mjs +4 -8
  21. package/dist/array/impl/array-utils-size.mjs.map +1 -1
  22. package/dist/array/impl/array-utils-slice-clamped.mjs +11 -12
  23. package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
  24. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  25. package/dist/array/impl/array-utils-slicing.mjs +44 -96
  26. package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
  27. package/dist/array/impl/array-utils-transformation.d.mts +1 -1
  28. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  29. package/dist/array/impl/array-utils-transformation.mjs +150 -292
  30. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  31. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  32. package/dist/array/impl/array-utils-validation.mjs +18 -169
  33. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  34. package/dist/collections/imap-mapped.d.mts.map +1 -1
  35. package/dist/collections/imap-mapped.mjs +243 -330
  36. package/dist/collections/imap-mapped.mjs.map +1 -1
  37. package/dist/collections/imap.d.mts.map +1 -1
  38. package/dist/collections/imap.mjs +190 -275
  39. package/dist/collections/imap.mjs.map +1 -1
  40. package/dist/collections/iset-mapped.d.mts +1 -1
  41. package/dist/collections/iset-mapped.d.mts.map +1 -1
  42. package/dist/collections/iset-mapped.mjs +222 -444
  43. package/dist/collections/iset-mapped.mjs.map +1 -1
  44. package/dist/collections/iset.d.mts +1 -1
  45. package/dist/collections/iset.d.mts.map +1 -1
  46. package/dist/collections/iset.mjs +158 -324
  47. package/dist/collections/iset.mjs.map +1 -1
  48. package/dist/collections/queue.d.mts.map +1 -1
  49. package/dist/collections/queue.mjs +106 -178
  50. package/dist/collections/queue.mjs.map +1 -1
  51. package/dist/collections/stack.d.mts.map +1 -1
  52. package/dist/collections/stack.mjs +95 -165
  53. package/dist/collections/stack.mjs.map +1 -1
  54. package/dist/expect-type.d.mts +1 -1
  55. package/dist/expect-type.d.mts.map +1 -1
  56. package/dist/expect-type.mjs +1 -69
  57. package/dist/expect-type.mjs.map +1 -1
  58. package/dist/functional/match.mjs +9 -9
  59. package/dist/functional/match.mjs.map +1 -1
  60. package/dist/functional/optional/impl/optional-expect-to-be.mjs +13 -14
  61. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  62. package/dist/functional/optional/impl/optional-filter.mjs +14 -15
  63. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  64. package/dist/functional/optional/impl/optional-flat-map.mjs +10 -11
  65. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  66. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  67. package/dist/functional/optional/impl/optional-from-nullable.mjs +1 -25
  68. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  69. package/dist/functional/optional/impl/optional-is-none.d.mts.map +1 -1
  70. package/dist/functional/optional/impl/optional-is-none.mjs +0 -19
  71. package/dist/functional/optional/impl/optional-is-none.mjs.map +1 -1
  72. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  73. package/dist/functional/optional/impl/optional-is-optional.mjs +1 -23
  74. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  75. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  76. package/dist/functional/optional/impl/optional-is-some.mjs +0 -20
  77. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  78. package/dist/functional/optional/impl/optional-map.mjs +13 -14
  79. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  80. package/dist/functional/optional/impl/optional-none.mjs +0 -16
  81. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  82. package/dist/functional/optional/impl/optional-or-else.mjs +10 -11
  83. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  84. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  85. package/dist/functional/optional/impl/optional-some.mjs +2 -21
  86. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  87. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  88. package/dist/functional/optional/impl/optional-to-nullable.mjs +1 -27
  89. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  90. package/dist/functional/optional/impl/optional-unwrap-or.mjs +9 -10
  91. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  92. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  93. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +4 -32
  94. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  95. package/dist/functional/optional/impl/optional-unwrap.mjs +4 -4
  96. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  97. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  98. package/dist/functional/optional/impl/optional-zip.mjs +1 -35
  99. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  100. package/dist/functional/optional/impl/tag.mjs +2 -3
  101. package/dist/functional/optional/impl/tag.mjs.map +1 -1
  102. package/dist/functional/pipe.d.mts.map +1 -1
  103. package/dist/functional/pipe.mjs +9 -34
  104. package/dist/functional/pipe.mjs.map +1 -1
  105. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  106. package/dist/functional/result/impl/result-err.mjs +2 -27
  107. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  108. package/dist/functional/result/impl/result-expect-to-be.mjs +13 -15
  109. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
  110. package/dist/functional/result/impl/result-flat-map.mjs +16 -16
  111. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
  112. package/dist/functional/result/impl/result-fold.mjs +16 -16
  113. package/dist/functional/result/impl/result-fold.mjs.map +1 -1
  114. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  115. package/dist/functional/result/impl/result-from-promise.mjs +4 -31
  116. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  117. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  118. package/dist/functional/result/impl/result-from-throwable.mjs +8 -38
  119. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
  120. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  121. package/dist/functional/result/impl/result-is-err.mjs +0 -19
  122. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  123. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  124. package/dist/functional/result/impl/result-is-ok.mjs +0 -19
  125. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  126. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  127. package/dist/functional/result/impl/result-is-result.mjs +1 -23
  128. package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
  129. package/dist/functional/result/impl/result-map-err.mjs +16 -16
  130. package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
  131. package/dist/functional/result/impl/result-map.mjs +16 -16
  132. package/dist/functional/result/impl/result-map.mjs.map +1 -1
  133. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  134. package/dist/functional/result/impl/result-ok.mjs +2 -27
  135. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  136. package/dist/functional/result/impl/result-or-else.mjs +10 -12
  137. package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
  138. package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
  139. package/dist/functional/result/impl/result-swap.mjs +4 -22
  140. package/dist/functional/result/impl/result-swap.mjs.map +1 -1
  141. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
  142. package/dist/functional/result/impl/result-to-optional.mjs +0 -27
  143. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
  144. package/dist/functional/result/impl/result-unwrap-err-or.mjs +9 -11
  145. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
  146. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
  147. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +13 -40
  148. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  149. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  150. package/dist/functional/result/impl/result-unwrap-err.mjs +4 -32
  151. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
  152. package/dist/functional/result/impl/result-unwrap-ok-or.mjs +9 -11
  153. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
  154. package/dist/functional/result/impl/result-unwrap-ok.mjs +4 -4
  155. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
  156. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  157. package/dist/functional/result/impl/result-unwrap-throw.mjs +4 -35
  158. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  159. package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
  160. package/dist/functional/result/impl/result-zip.mjs +1 -34
  161. package/dist/functional/result/impl/result-zip.mjs.map +1 -1
  162. package/dist/functional/result/impl/tag.mjs +2 -3
  163. package/dist/functional/result/impl/tag.mjs.map +1 -1
  164. package/dist/functional/ternary-result/impl/tag.mjs +3 -5
  165. package/dist/functional/ternary-result/impl/tag.mjs.map +1 -1
  166. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  167. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +2 -15
  168. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  169. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +13 -13
  170. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
  171. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +27 -26
  172. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
  173. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +21 -22
  174. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
  175. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
  176. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +4 -20
  177. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
  178. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
  179. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +7 -25
  180. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
  181. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +1 -1
  182. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +0 -17
  183. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +1 -1
  184. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
  185. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +0 -19
  186. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
  187. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
  188. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +1 -25
  189. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
  190. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
  191. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +0 -18
  192. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
  193. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +13 -15
  194. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
  195. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +18 -18
  196. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
  197. package/dist/functional/ternary-result/impl/ternary-result-map.mjs +21 -22
  198. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
  199. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  200. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +2 -16
  201. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  202. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +9 -9
  203. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
  204. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
  205. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +4 -22
  206. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
  207. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +9 -9
  208. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
  209. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
  210. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +12 -27
  211. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  212. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
  213. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +4 -19
  214. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
  215. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +9 -9
  216. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
  217. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +4 -5
  218. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
  219. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
  220. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +15 -27
  221. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  222. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +9 -9
  223. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
  224. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
  225. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +10 -24
  226. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  227. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
  228. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +4 -19
  229. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
  230. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  231. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +3 -19
  232. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  233. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
  234. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +14 -45
  235. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
  236. package/dist/functional/ternary-result/impl/variant-name.d.mts +1 -1
  237. package/dist/functional/ternary-result/impl/variant-name.d.mts.map +1 -1
  238. package/dist/functional/ternary-result/impl/variant-name.mjs +8 -9
  239. package/dist/functional/ternary-result/impl/variant-name.mjs.map +1 -1
  240. package/dist/guard/has-key.d.mts.map +1 -1
  241. package/dist/guard/has-key.mjs +0 -41
  242. package/dist/guard/has-key.mjs.map +1 -1
  243. package/dist/guard/is-length-bounded-string.d.mts.map +1 -1
  244. package/dist/guard/is-length-bounded-string.mjs +0 -157
  245. package/dist/guard/is-length-bounded-string.mjs.map +1 -1
  246. package/dist/guard/is-non-empty-string.d.mts +1 -1
  247. package/dist/guard/is-non-empty-string.d.mts.map +1 -1
  248. package/dist/guard/is-non-empty-string.mjs +1 -38
  249. package/dist/guard/is-non-empty-string.mjs.map +1 -1
  250. package/dist/guard/is-non-null-object.d.mts.map +1 -1
  251. package/dist/guard/is-non-null-object.mjs +1 -35
  252. package/dist/guard/is-non-null-object.mjs.map +1 -1
  253. package/dist/guard/is-primitive.d.mts.map +1 -1
  254. package/dist/guard/is-primitive.mjs +12 -43
  255. package/dist/guard/is-primitive.mjs.map +1 -1
  256. package/dist/guard/is-record.d.mts.map +1 -1
  257. package/dist/guard/is-record.mjs +0 -86
  258. package/dist/guard/is-record.mjs.map +1 -1
  259. package/dist/guard/is-type.d.mts.map +1 -1
  260. package/dist/guard/is-type.mjs +12 -399
  261. package/dist/guard/is-type.mjs.map +1 -1
  262. package/dist/guard/key-is-in.d.mts.map +1 -1
  263. package/dist/guard/key-is-in.mjs +0 -40
  264. package/dist/guard/key-is-in.mjs.map +1 -1
  265. package/dist/iterator/range.mjs +16 -16
  266. package/dist/iterator/range.mjs.map +1 -1
  267. package/dist/json/json.d.mts.map +1 -1
  268. package/dist/json/json.mjs +52 -340
  269. package/dist/json/json.mjs.map +1 -1
  270. package/dist/number/branded-types/finite-number.d.mts +3 -3
  271. package/dist/number/branded-types/finite-number.mjs +135 -154
  272. package/dist/number/branded-types/finite-number.mjs.map +1 -1
  273. package/dist/number/branded-types/int.d.mts +4 -4
  274. package/dist/number/branded-types/int.mjs +205 -245
  275. package/dist/number/branded-types/int.mjs.map +1 -1
  276. package/dist/number/branded-types/int16.d.mts +15 -15
  277. package/dist/number/branded-types/int16.mjs +116 -123
  278. package/dist/number/branded-types/int16.mjs.map +1 -1
  279. package/dist/number/branded-types/int32.d.mts +11 -11
  280. package/dist/number/branded-types/int32.mjs +116 -123
  281. package/dist/number/branded-types/int32.mjs.map +1 -1
  282. package/dist/number/branded-types/negative-finite-number.d.mts +4 -4
  283. package/dist/number/branded-types/negative-finite-number.mjs +129 -144
  284. package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
  285. package/dist/number/branded-types/negative-int.d.mts +5 -5
  286. package/dist/number/branded-types/negative-int.mjs +94 -113
  287. package/dist/number/branded-types/negative-int.mjs.map +1 -1
  288. package/dist/number/branded-types/negative-safe-int.d.mts +5 -5
  289. package/dist/number/branded-types/negative-safe-int.mjs +103 -124
  290. package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
  291. package/dist/number/branded-types/non-negative-finite-number.d.mts +5 -5
  292. package/dist/number/branded-types/non-negative-finite-number.mjs +136 -142
  293. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
  294. package/dist/number/branded-types/non-negative-int16.d.mts +16 -16
  295. package/dist/number/branded-types/non-negative-int16.mjs +109 -118
  296. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
  297. package/dist/number/branded-types/non-negative-int32.d.mts +12 -12
  298. package/dist/number/branded-types/non-negative-int32.mjs +110 -119
  299. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
  300. package/dist/number/branded-types/non-positive-finite-number.d.mts +3 -3
  301. package/dist/number/branded-types/non-positive-finite-number.mjs +120 -124
  302. package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
  303. package/dist/number/branded-types/non-positive-int.d.mts +4 -4
  304. package/dist/number/branded-types/non-positive-int.mjs +167 -212
  305. package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
  306. package/dist/number/branded-types/non-positive-safe-int.d.mts +4 -4
  307. package/dist/number/branded-types/non-positive-safe-int.mjs +95 -106
  308. package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
  309. package/dist/number/branded-types/non-zero-finite-number.d.mts +4 -4
  310. package/dist/number/branded-types/non-zero-finite-number.mjs +114 -123
  311. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
  312. package/dist/number/branded-types/non-zero-int.d.mts +2 -2
  313. package/dist/number/branded-types/non-zero-int.mjs +72 -83
  314. package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
  315. package/dist/number/branded-types/non-zero-int16.d.mts +7 -7
  316. package/dist/number/branded-types/non-zero-int16.mjs +96 -107
  317. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
  318. package/dist/number/branded-types/non-zero-int32.d.mts +5 -5
  319. package/dist/number/branded-types/non-zero-int32.mjs +97 -108
  320. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
  321. package/dist/number/branded-types/non-zero-safe-int.d.mts +2 -2
  322. package/dist/number/branded-types/non-zero-safe-int.mjs +100 -111
  323. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
  324. package/dist/number/branded-types/non-zero-uint16.d.mts +8 -8
  325. package/dist/number/branded-types/non-zero-uint16.mjs +96 -107
  326. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
  327. package/dist/number/branded-types/non-zero-uint32.d.mts +6 -6
  328. package/dist/number/branded-types/non-zero-uint32.mjs +96 -107
  329. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
  330. package/dist/number/branded-types/positive-finite-number.d.mts +8 -8
  331. package/dist/number/branded-types/positive-finite-number.mjs +139 -141
  332. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
  333. package/dist/number/branded-types/positive-int.d.mts +11 -11
  334. package/dist/number/branded-types/positive-int.mjs +228 -271
  335. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  336. package/dist/number/branded-types/positive-int16.d.mts +19 -19
  337. package/dist/number/branded-types/positive-int16.mjs +109 -118
  338. package/dist/number/branded-types/positive-int16.mjs.map +1 -1
  339. package/dist/number/branded-types/positive-int32.d.mts +15 -15
  340. package/dist/number/branded-types/positive-int32.mjs +109 -118
  341. package/dist/number/branded-types/positive-int32.mjs.map +1 -1
  342. package/dist/number/branded-types/positive-safe-int.d.mts +11 -11
  343. package/dist/number/branded-types/positive-safe-int.mjs +244 -275
  344. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  345. package/dist/number/branded-types/positive-uint16.d.mts +17 -17
  346. package/dist/number/branded-types/positive-uint16.mjs +109 -118
  347. package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
  348. package/dist/number/branded-types/positive-uint32.d.mts +13 -13
  349. package/dist/number/branded-types/positive-uint32.mjs +110 -119
  350. package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
  351. package/dist/number/branded-types/safe-int.d.mts +4 -4
  352. package/dist/number/branded-types/safe-int.mjs +251 -292
  353. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  354. package/dist/number/branded-types/safe-uint.d.mts +8 -8
  355. package/dist/number/branded-types/safe-uint.mjs +111 -119
  356. package/dist/number/branded-types/safe-uint.mjs.map +1 -1
  357. package/dist/number/branded-types/uint.d.mts +8 -8
  358. package/dist/number/branded-types/uint.mjs +198 -225
  359. package/dist/number/branded-types/uint.mjs.map +1 -1
  360. package/dist/number/branded-types/uint16.d.mts +14 -14
  361. package/dist/number/branded-types/uint16.mjs +109 -119
  362. package/dist/number/branded-types/uint16.mjs.map +1 -1
  363. package/dist/number/branded-types/uint32.d.mts +10 -10
  364. package/dist/number/branded-types/uint32.mjs +110 -117
  365. package/dist/number/branded-types/uint32.mjs.map +1 -1
  366. package/dist/number/enum/int8.mjs +119 -145
  367. package/dist/number/enum/int8.mjs.map +1 -1
  368. package/dist/number/enum/uint8.mjs +107 -121
  369. package/dist/number/enum/uint8.mjs.map +1 -1
  370. package/dist/number/num.d.mts +2 -2
  371. package/dist/number/num.d.mts.map +1 -1
  372. package/dist/number/num.mjs +76 -537
  373. package/dist/number/num.mjs.map +1 -1
  374. package/dist/number/refined-number-utils.d.mts +1 -1
  375. package/dist/number/refined-number-utils.d.mts.map +1 -1
  376. package/dist/number/refined-number-utils.mjs +127 -263
  377. package/dist/number/refined-number-utils.mjs.map +1 -1
  378. package/dist/object/object.d.mts.map +1 -1
  379. package/dist/object/object.mjs +107 -222
  380. package/dist/object/object.mjs.map +1 -1
  381. package/dist/others/cast-mutable.d.mts.map +1 -1
  382. package/dist/others/cast-mutable.mjs +8 -37
  383. package/dist/others/cast-mutable.mjs.map +1 -1
  384. package/dist/others/cast-readonly.d.mts.map +1 -1
  385. package/dist/others/cast-readonly.mjs +8 -36
  386. package/dist/others/cast-readonly.mjs.map +1 -1
  387. package/dist/others/debounce-function.d.mts.map +1 -1
  388. package/dist/others/debounce-function.mjs +7 -16
  389. package/dist/others/debounce-function.mjs.map +1 -1
  390. package/dist/others/fast-deep-equal.d.mts.map +1 -1
  391. package/dist/others/fast-deep-equal.mjs +43 -59
  392. package/dist/others/fast-deep-equal.mjs.map +1 -1
  393. package/dist/others/if-then.d.mts.map +1 -1
  394. package/dist/others/if-then.mjs +0 -29
  395. package/dist/others/if-then.mjs.map +1 -1
  396. package/dist/others/map-nullable.mjs +9 -9
  397. package/dist/others/map-nullable.mjs.map +1 -1
  398. package/dist/others/memoize-function.mjs +12 -12
  399. package/dist/others/memoize-function.mjs.map +1 -1
  400. package/dist/others/tuple.d.mts.map +1 -1
  401. package/dist/others/tuple.mjs +0 -50
  402. package/dist/others/tuple.mjs.map +1 -1
  403. package/dist/others/unknown-to-string.d.mts.map +1 -1
  404. package/dist/others/unknown-to-string.mjs +41 -88
  405. package/dist/others/unknown-to-string.mjs.map +1 -1
  406. package/dist/promise/promise.d.mts.map +1 -1
  407. package/dist/promise/promise.mjs +4 -49
  408. package/dist/promise/promise.mjs.map +1 -1
  409. package/package.json +8 -7
@@ -1 +1 @@
1
- {"version":3,"file":"non-positive-safe-int.mjs","sources":["../../../src/number/branded-types/non-positive-safe-int.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAOA,MAAM,iBAAiB,GAAG,6BAA6B;AAEvD,MAAM,EACJ,SAAS,EACT,SAAS,EACT,GAAG,EACH,QAAQ,EACR,KAAK,EACL,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,MAAM,EACN,GAAG,GACJ,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,aAAa;IACnC,SAAS,EAAE,MAAM,CAAC,gBAAgB;AAClC,IAAA,SAAS,EAAE,CAAC;IACZ,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;;AAMG;AACI,MAAM,oBAAoB,GAAG;AAEpC;;;;;;AAMG;AACI,MAAM,oBAAoB,GAAG;AAEpC;;;;;;;;AAQG;AACI,MAAM,kBAAkB,GAAG;AAChC;;;;;;AAMG;IACH,EAAE;AAEF;;;;AAIG;IACH,SAAS;AAET;;;;AAIG;IACH,SAAS;AAET;;;;;;AAMG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;AAMG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;AAMG;IACH,KAAK;AAEL;;;;AAIG;IACH,MAAM;AAEN;;;;;;;AAOG;IACH,GAAG;AAEH;;;;;;;AAOG;IACH,GAAG;AAEH;;;;;;;AAOG;IACH,GAAG;;;;;"}
1
+ {"version":3,"file":"non-positive-safe-int.mjs","sources":["../../../src/number/branded-types/non-positive-safe-int.mts"],"sourcesContent":["import { type NonPositiveSafeInt as TtfImported_NonPositiveSafeInt } from 'ts-type-forge';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type NonPositiveSafeInt = TtfImported_NonPositiveSafeInt;\n\ntype ElementType = NonPositiveSafeInt;\n\nconst typeNameInMessage = 'a non-positive safe integer';\n\nconst {\n MAX_VALUE,\n MIN_VALUE,\n add,\n castType,\n clamp,\n is,\n max: max_,\n min: min_,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n number,\n 0\n>({\n integerOrSafeInteger: 'SafeInteger',\n MIN_VALUE: Number.MIN_SAFE_INTEGER,\n MAX_VALUE: 0,\n typeNameInMessage,\n} as const);\n\n/**\n * Checks if a number is a NonPositiveSafeInt (non-positive safe integer in the\n * range [Number.MIN_SAFE_INTEGER, 0]).\n *\n * @param value The value to check.\n * @returns `true` if the value is a NonPositiveSafeInt, `false` otherwise.\n */\nexport const isNonPositiveSafeInt = is;\n\n/**\n * Casts a number to a NonPositiveSafeInt type.\n *\n * @param value The value to cast.\n * @returns The value as a NonPositiveSafeInt type.\n * @throws {TypeError} If the value is not a non-positive safe integer.\n */\nexport const asNonPositiveSafeInt = castType;\n\n/**\n * Namespace providing type-safe arithmetic operations for non-positive\n * safe integers.\n *\n * All operations automatically clamp results to the valid NonPositiveSafeInt\n * range [Number.MIN_SAFE_INTEGER, 0]. This ensures that all arithmetic\n * maintains the non-positive safe integer constraint, with positive results\n * clamped to 0 and underflow results clamped to MIN_VALUE.\n */\nexport const NonPositiveSafeInt = {\n /**\n * Type guard to check if a value is a NonPositiveSafeInt.\n *\n * @param value The value to check.\n * @returns `true` if the value is a non-positive safe integer, `false`\n * otherwise.\n */\n is,\n\n /**\n * The minimum value for a non-positive safe integer.\n *\n * @readonly\n */\n MIN_VALUE,\n\n /**\n * The maximum value for a non-positive safe integer.\n *\n * @readonly\n */\n MAX_VALUE,\n\n /**\n * Returns the smaller of two NonPositiveSafeInt values.\n *\n * @param a The first NonPositiveSafeInt.\n * @param b The second NonPositiveSafeInt.\n * @returns The minimum value as a NonPositiveSafeInt.\n */\n min: min_,\n\n /**\n * Returns the larger of two NonPositiveSafeInt values.\n *\n * @param a The first NonPositiveSafeInt.\n * @param b The second NonPositiveSafeInt.\n * @returns The maximum value as a NonPositiveSafeInt.\n */\n max: max_,\n\n /**\n * Clamps a number to the NonPositiveSafeInt range.\n *\n * @param value The number to clamp.\n * @returns The value clamped to [Number.MIN_SAFE_INTEGER, 0] as a\n * NonPositiveSafeInt.\n */\n clamp,\n\n /**\n * Generates a random NonPositiveSafeInt value within the valid range.\n *\n * @returns A random NonPositiveSafeInt between Number.MIN_SAFE_INTEGER and 0.\n */\n random,\n\n /**\n * Raises a NonPositiveSafeInt to the power of another NonPositiveSafeInt.\n *\n * @param a The base NonPositiveSafeInt.\n * @param b The exponent NonPositiveSafeInt.\n * @returns `a ** b` clamped to [Number.MIN_SAFE_INTEGER, 0] as a\n * NonPositiveSafeInt.\n */\n pow,\n\n /**\n * Adds two NonPositiveSafeInt values.\n *\n * @param a The first NonPositiveSafeInt.\n * @param b The second NonPositiveSafeInt.\n * @returns `a + b` clamped to [Number.MIN_SAFE_INTEGER, 0] as a\n * NonPositiveSafeInt.\n */\n add,\n\n /**\n * Subtracts one NonPositiveSafeInt from another.\n *\n * @param a The minuend NonPositiveSafeInt.\n * @param b The subtrahend NonPositiveSafeInt.\n * @returns `a - b` clamped to [Number.MIN_SAFE_INTEGER, 0] as a\n * NonPositiveSafeInt (maximum 0).\n */\n sub,\n} as const;\n"],"names":[],"mappings":";;AAOA,MAAM,iBAAA,GAAoB,6BAAA;AAE1B,MAAM;AAAA,EACJ,SAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,GAAI,oBAAA,CAAqB,mBAAmB,mBAAA,CAI1C;AAAA,EACA,oBAAA,EAAsB,aAAA;AAAA,EACtB,WAAW,MAAA,CAAO,gBAAA;AAAA,EAClB,SAAA,EAAW,CAAA;AAAA,EACX;AACF,CAAU,CAAA;AASH,MAAM,oBAAA,GAAuB;AAS7B,MAAM,oBAAA,GAAuB;AAW7B,MAAM,kBAAA,GAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQhC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASL,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASL,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA;AACF;;;;"}
@@ -17,9 +17,9 @@ export declare const isNonZeroFiniteNumber: (a: number) => a is TtfImported_NonZ
17
17
  * @throws {TypeError} If the value is not a non-zero finite number.
18
18
  */
19
19
  export declare const asNonZeroFiniteNumber: <N extends number>(x: N) => number & {
20
- readonly NaNValue: false;
21
- readonly Finite: true;
22
20
  readonly "!=0": true;
21
+ readonly Finite: true;
22
+ readonly NaNValue: false;
23
23
  } & Readonly<{
24
24
  'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;
25
25
  }> & N;
@@ -118,9 +118,9 @@ export declare const NonZeroFiniteNumber: {
118
118
  * @returns `a / b` as a NonZeroFiniteNumber.
119
119
  */
120
120
  readonly div: (x: TtfImported_NonZeroFiniteNumber, y: number & {
121
- readonly NaNValue: false;
122
- readonly Finite: true;
123
121
  readonly "!=0": true;
122
+ readonly Finite: true;
123
+ readonly NaNValue: false;
124
124
  } & Readonly<{
125
125
  'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;
126
126
  }>) => TtfImported_NonZeroFiniteNumber;
@@ -1,132 +1,123 @@
1
1
  import { TsDataForgeInternals } from '../refined-number-utils.mjs';
2
2
 
3
- const typeNameInMessage = 'a non-zero finite number';
4
- const { abs, castType, div, is, max: max_, min: min_, mul, pow, randomNonZero: random, } = TsDataForgeInternals.RefinedNumberUtils.operatorsForFloat({
5
- nonZero: true,
6
- MIN_VALUE: -Number.MAX_VALUE,
7
- MAX_VALUE: Number.MAX_VALUE,
8
- typeNameInMessage,
3
+ const typeNameInMessage = "a non-zero finite number";
4
+ const {
5
+ abs,
6
+ castType,
7
+ div,
8
+ is,
9
+ max: max_,
10
+ min: min_,
11
+ mul,
12
+ pow,
13
+ randomNonZero: random
14
+ } = TsDataForgeInternals.RefinedNumberUtils.operatorsForFloat({
15
+ nonZero: true,
16
+ MIN_VALUE: -Number.MAX_VALUE,
17
+ MAX_VALUE: Number.MAX_VALUE,
18
+ typeNameInMessage
9
19
  });
10
- // Not provided because reasonable rounding operations that avoid becoming 0 cannot be defined
11
- const floor = (x) =>
12
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
13
- Math.floor(x);
14
- const ceil = (x) =>
15
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
16
- Math.ceil(x);
17
- const round = (x) =>
18
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
19
- Math.round(x);
20
- /**
21
- * Checks if a number is a NonZeroFiniteNumber (a finite number that is not 0).
22
- *
23
- * @param value The value to check.
24
- * @returns `true` if the value is a NonZeroFiniteNumber, `false` otherwise.
25
- */
20
+ const floor = (x) => (
21
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion
22
+ Math.floor(x)
23
+ );
24
+ const ceil = (x) => (
25
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion
26
+ Math.ceil(x)
27
+ );
28
+ const round = (x) => (
29
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion
30
+ Math.round(x)
31
+ );
26
32
  const isNonZeroFiniteNumber = is;
27
- /**
28
- * Casts a number to a NonZeroFiniteNumber type.
29
- *
30
- * @param value The value to cast.
31
- * @returns The value as a NonZeroFiniteNumber type.
32
- * @throws {TypeError} If the value is not a non-zero finite number.
33
- */
34
33
  const asNonZeroFiniteNumber = castType;
35
- /**
36
- * Namespace providing type-safe arithmetic operations for non-zero finite
37
- * numbers.
38
- *
39
- * All operations maintain the non-zero constraint while ensuring results remain
40
- * finite (excluding NaN and Infinity). This type is useful for values that must
41
- * never be zero, such as denominators, scaling factors, and ratios.
42
- */
43
34
  const NonZeroFiniteNumber = {
44
- /**
45
- * Type guard to check if a value is a NonZeroFiniteNumber.
46
- *
47
- * @param value The value to check.
48
- * @returns `true` if the value is a non-zero finite number, `false`
49
- * otherwise.
50
- */
51
- is,
52
- /**
53
- * Returns the absolute value of a non-zero finite number.
54
- *
55
- * @param a The NonZeroFiniteNumber.
56
- * @returns The absolute value as a NonZeroFiniteNumber.
57
- */
58
- abs,
59
- /**
60
- * Returns the smaller of two NonZeroFiniteNumber values.
61
- *
62
- * @param a The first NonZeroFiniteNumber.
63
- * @param b The second NonZeroFiniteNumber.
64
- * @returns The minimum value as a NonZeroFiniteNumber.
65
- */
66
- min: min_,
67
- /**
68
- * Returns the larger of two NonZeroFiniteNumber values.
69
- *
70
- * @param a The first NonZeroFiniteNumber.
71
- * @param b The second NonZeroFiniteNumber.
72
- * @returns The maximum value as a NonZeroFiniteNumber.
73
- */
74
- max: max_,
75
- /**
76
- * Rounds down a NonZeroFiniteNumber to the nearest integer.
77
- *
78
- * @param x The NonZeroFiniteNumber to round down.
79
- * @returns The floor value as a NonZeroInt.
80
- */
81
- floor,
82
- /**
83
- * Rounds up a NonZeroFiniteNumber to the nearest integer.
84
- *
85
- * @param x The NonZeroFiniteNumber to round up.
86
- * @returns The ceiling value as a NonZeroInt.
87
- */
88
- ceil,
89
- /**
90
- * Rounds a NonZeroFiniteNumber to the nearest integer.
91
- *
92
- * @param x The NonZeroFiniteNumber to round.
93
- * @returns The rounded value as a NonZeroInt.
94
- */
95
- round,
96
- /**
97
- * Generates a random NonZeroFiniteNumber value.
98
- *
99
- * @returns A random non-zero finite number.
100
- */
101
- random,
102
- /**
103
- * Raises a NonZeroFiniteNumber to the power of another NonZeroFiniteNumber.
104
- *
105
- * @param a The base NonZeroFiniteNumber.
106
- * @param b The exponent NonZeroFiniteNumber.
107
- * @returns `a ** b` as a NonZeroFiniteNumber.
108
- */
109
- pow,
110
- /**
111
- * Multiplies two NonZeroFiniteNumber values.
112
- *
113
- * @param a The first NonZeroFiniteNumber.
114
- * @param b The second NonZeroFiniteNumber.
115
- * @returns `a * b` as a NonZeroFiniteNumber.
116
- */
117
- mul,
118
- /**
119
- * Divides one NonZeroFiniteNumber by another.
120
- *
121
- * Exact (non-flooring) division of two non-zero finite numbers is always
122
- * non-zero, so this stays closed. For the non-closed operations (`add`/`sub`,
123
- * whose result may be `0`) use {@link Num.add}/{@link Num.sub}.
124
- *
125
- * @param a The dividend NonZeroFiniteNumber.
126
- * @param b The divisor NonZeroFiniteNumber.
127
- * @returns `a / b` as a NonZeroFiniteNumber.
128
- */
129
- div,
35
+ /**
36
+ * Type guard to check if a value is a NonZeroFiniteNumber.
37
+ *
38
+ * @param value The value to check.
39
+ * @returns `true` if the value is a non-zero finite number, `false`
40
+ * otherwise.
41
+ */
42
+ is,
43
+ /**
44
+ * Returns the absolute value of a non-zero finite number.
45
+ *
46
+ * @param a The NonZeroFiniteNumber.
47
+ * @returns The absolute value as a NonZeroFiniteNumber.
48
+ */
49
+ abs,
50
+ /**
51
+ * Returns the smaller of two NonZeroFiniteNumber values.
52
+ *
53
+ * @param a The first NonZeroFiniteNumber.
54
+ * @param b The second NonZeroFiniteNumber.
55
+ * @returns The minimum value as a NonZeroFiniteNumber.
56
+ */
57
+ min: min_,
58
+ /**
59
+ * Returns the larger of two NonZeroFiniteNumber values.
60
+ *
61
+ * @param a The first NonZeroFiniteNumber.
62
+ * @param b The second NonZeroFiniteNumber.
63
+ * @returns The maximum value as a NonZeroFiniteNumber.
64
+ */
65
+ max: max_,
66
+ /**
67
+ * Rounds down a NonZeroFiniteNumber to the nearest integer.
68
+ *
69
+ * @param x The NonZeroFiniteNumber to round down.
70
+ * @returns The floor value as a NonZeroInt.
71
+ */
72
+ floor,
73
+ /**
74
+ * Rounds up a NonZeroFiniteNumber to the nearest integer.
75
+ *
76
+ * @param x The NonZeroFiniteNumber to round up.
77
+ * @returns The ceiling value as a NonZeroInt.
78
+ */
79
+ ceil,
80
+ /**
81
+ * Rounds a NonZeroFiniteNumber to the nearest integer.
82
+ *
83
+ * @param x The NonZeroFiniteNumber to round.
84
+ * @returns The rounded value as a NonZeroInt.
85
+ */
86
+ round,
87
+ /**
88
+ * Generates a random NonZeroFiniteNumber value.
89
+ *
90
+ * @returns A random non-zero finite number.
91
+ */
92
+ random,
93
+ /**
94
+ * Raises a NonZeroFiniteNumber to the power of another NonZeroFiniteNumber.
95
+ *
96
+ * @param a The base NonZeroFiniteNumber.
97
+ * @param b The exponent NonZeroFiniteNumber.
98
+ * @returns `a ** b` as a NonZeroFiniteNumber.
99
+ */
100
+ pow,
101
+ /**
102
+ * Multiplies two NonZeroFiniteNumber values.
103
+ *
104
+ * @param a The first NonZeroFiniteNumber.
105
+ * @param b The second NonZeroFiniteNumber.
106
+ * @returns `a * b` as a NonZeroFiniteNumber.
107
+ */
108
+ mul,
109
+ /**
110
+ * Divides one NonZeroFiniteNumber by another.
111
+ *
112
+ * Exact (non-flooring) division of two non-zero finite numbers is always
113
+ * non-zero, so this stays closed. For the non-closed operations (`add`/`sub`,
114
+ * whose result may be `0`) use {@link Num.add}/{@link Num.sub}.
115
+ *
116
+ * @param a The dividend NonZeroFiniteNumber.
117
+ * @param b The divisor NonZeroFiniteNumber.
118
+ * @returns `a / b` as a NonZeroFiniteNumber.
119
+ */
120
+ div
130
121
  };
131
122
 
132
123
  export { NonZeroFiniteNumber, asNonZeroFiniteNumber, isNonZeroFiniteNumber };
@@ -1 +1 @@
1
- {"version":3,"file":"non-zero-finite-number.mjs","sources":["../../../src/number/branded-types/non-zero-finite-number.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAaA,MAAM,iBAAiB,GAAG,0BAA0B;AAEpD,MAAM,EACJ,GAAG,EACH,QAAQ,EACR,GAAG,EACH,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,aAAa,EAAE,MAAM,GACtB,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,iBAAiB,CAI3D;AACA,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,SAAS,EAAE,CAAC,MAAM,CAAC,SAAS;IAC5B,SAAS,EAAE,MAAM,CAAC,SAAS;IAC3B,iBAAiB;AACT,CAAA,CAAC;AAEX;AAEA,MAAM,KAAK,GAAG,CACZ,CAAc;AAEd;AACA,IAAI,CAAC,KAAK,CAAC,CAAC,CAA+D;AAE7E,MAAM,IAAI,GAAG,CACX,CAAc;AAEd;AACA,IAAI,CAAC,IAAI,CAAC,CAAC,CAA+D;AAE5E,MAAM,KAAK,GAAG,CACZ,CAAc;AAEd;AACA,IAAI,CAAC,KAAK,CAAC,CAAC,CAA+D;AAc7E;;;;;AAKG;AACI,MAAM,qBAAqB,GAAG;AAErC;;;;;;AAMG;AACI,MAAM,qBAAqB,GAAG;AAErC;;;;;;;AAOG;AACI,MAAM,mBAAmB,GAAG;AACjC;;;;;;AAMG;IACH,EAAE;AAEF;;;;;AAKG;IACH,GAAG;AAEH;;;;;;AAMG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;AAMG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;AAKG;IACH,KAAK;AAEL;;;;;AAKG;IACH,IAAI;AAEJ;;;;;AAKG;IACH,KAAK;AAEL;;;;AAIG;IACH,MAAM;AAEN;;;;;;AAMG;IACH,GAAG;AAEH;;;;;;AAMG;IACH,GAAG;AAEH;;;;;;;;;;AAUG;IACH,GAAG;;;;;"}
1
+ {"version":3,"file":"non-zero-finite-number.mjs","sources":["../../../src/number/branded-types/non-zero-finite-number.mts"],"sourcesContent":["import {\n type Int,\n type NonZeroInt,\n type PositiveFiniteNumber,\n type NonZeroFiniteNumber as TtfImported_NonZeroFiniteNumber,\n} from 'ts-type-forge';\nimport { expectType } from '../../expect-type.mjs';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type NonZeroFiniteNumber = TtfImported_NonZeroFiniteNumber;\n\ntype ElementType = NonZeroFiniteNumber;\n\nconst typeNameInMessage = 'a non-zero finite number';\n\nconst {\n abs,\n castType,\n div,\n is,\n max: max_,\n min: min_,\n mul,\n pow,\n randomNonZero: random,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForFloat<\n ElementType,\n number,\n number\n>({\n nonZero: true,\n MIN_VALUE: -Number.MAX_VALUE,\n MAX_VALUE: Number.MAX_VALUE,\n typeNameInMessage,\n} as const);\n\n// Not provided because reasonable rounding operations that avoid becoming 0 cannot be defined\n\nconst floor = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.floor(x) as TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;\n\nconst ceil = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.ceil(x) as TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;\n\nconst round = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.round(x) as TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;\n\nexpectType<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>,\n NonZeroInt\n>('=');\n\nexpectType<\n TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n >,\n Int\n>('=');\n\n/**\n * Checks if a number is a NonZeroFiniteNumber (a finite number that is not 0).\n *\n * @param value The value to check.\n * @returns `true` if the value is a NonZeroFiniteNumber, `false` otherwise.\n */\nexport const isNonZeroFiniteNumber = is;\n\n/**\n * Casts a number to a NonZeroFiniteNumber type.\n *\n * @param value The value to cast.\n * @returns The value as a NonZeroFiniteNumber type.\n * @throws {TypeError} If the value is not a non-zero finite number.\n */\nexport const asNonZeroFiniteNumber = castType;\n\n/**\n * Namespace providing type-safe arithmetic operations for non-zero finite\n * numbers.\n *\n * All operations maintain the non-zero constraint while ensuring results remain\n * finite (excluding NaN and Infinity). This type is useful for values that must\n * never be zero, such as denominators, scaling factors, and ratios.\n */\nexport const NonZeroFiniteNumber = {\n /**\n * Type guard to check if a value is a NonZeroFiniteNumber.\n *\n * @param value The value to check.\n * @returns `true` if the value is a non-zero finite number, `false`\n * otherwise.\n */\n is,\n\n /**\n * Returns the absolute value of a non-zero finite number.\n *\n * @param a The NonZeroFiniteNumber.\n * @returns The absolute value as a NonZeroFiniteNumber.\n */\n abs,\n\n /**\n * Returns the smaller of two NonZeroFiniteNumber values.\n *\n * @param a The first NonZeroFiniteNumber.\n * @param b The second NonZeroFiniteNumber.\n * @returns The minimum value as a NonZeroFiniteNumber.\n */\n min: min_,\n\n /**\n * Returns the larger of two NonZeroFiniteNumber values.\n *\n * @param a The first NonZeroFiniteNumber.\n * @param b The second NonZeroFiniteNumber.\n * @returns The maximum value as a NonZeroFiniteNumber.\n */\n max: max_,\n\n /**\n * Rounds down a NonZeroFiniteNumber to the nearest integer.\n *\n * @param x The NonZeroFiniteNumber to round down.\n * @returns The floor value as a NonZeroInt.\n */\n floor,\n\n /**\n * Rounds up a NonZeroFiniteNumber to the nearest integer.\n *\n * @param x The NonZeroFiniteNumber to round up.\n * @returns The ceiling value as a NonZeroInt.\n */\n ceil,\n\n /**\n * Rounds a NonZeroFiniteNumber to the nearest integer.\n *\n * @param x The NonZeroFiniteNumber to round.\n * @returns The rounded value as a NonZeroInt.\n */\n round,\n\n /**\n * Generates a random NonZeroFiniteNumber value.\n *\n * @returns A random non-zero finite number.\n */\n random,\n\n /**\n * Raises a NonZeroFiniteNumber to the power of another NonZeroFiniteNumber.\n *\n * @param a The base NonZeroFiniteNumber.\n * @param b The exponent NonZeroFiniteNumber.\n * @returns `a ** b` as a NonZeroFiniteNumber.\n */\n pow,\n\n /**\n * Multiplies two NonZeroFiniteNumber values.\n *\n * @param a The first NonZeroFiniteNumber.\n * @param b The second NonZeroFiniteNumber.\n * @returns `a * b` as a NonZeroFiniteNumber.\n */\n mul,\n\n /**\n * Divides one NonZeroFiniteNumber by another.\n *\n * Exact (non-flooring) division of two non-zero finite numbers is always\n * non-zero, so this stays closed. For the non-closed operations (`add`/`sub`,\n * whose result may be `0`) use {@link Num.add}/{@link Num.sub}.\n *\n * @param a The dividend NonZeroFiniteNumber.\n * @param b The divisor NonZeroFiniteNumber.\n * @returns `a / b` as a NonZeroFiniteNumber.\n */\n div,\n} as const;\n\nexpectType<\n TsDataForgeInternals.RefinedNumberUtils.ToNonNegative<ElementType>,\n PositiveFiniteNumber\n>('=');\n\nexpectType<\n keyof typeof NonZeroFiniteNumber,\n keyof TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n never,\n 'div' | 'mul'\n >\n>('=');\n\nexpectType<\n typeof NonZeroFiniteNumber,\n TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n never,\n 'div' | 'mul'\n >\n>('<=');\n"],"names":[],"mappings":";;AAaA,MAAM,iBAAA,GAAoB,0BAAA;AAE1B,MAAM;AAAA,EACJ,GAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,GAAA;AAAA,EACA,aAAA,EAAe;AACjB,CAAA,GAAI,oBAAA,CAAqB,mBAAmB,iBAAA,CAI1C;AAAA,EACA,OAAA,EAAS,IAAA;AAAA,EACT,SAAA,EAAW,CAAC,MAAA,CAAO,SAAA;AAAA,EACnB,WAAW,MAAA,CAAO,SAAA;AAAA,EAClB;AACF,CAAU,CAAA;AAIV,MAAM,QAAQ,CACZ,CAAA;AAAA;AAAA,EAGA,IAAA,CAAK,MAAM,CAAC;AAAA,CAAA;AAEd,MAAM,OAAO,CACX,CAAA;AAAA;AAAA,EAGA,IAAA,CAAK,KAAK,CAAC;AAAA,CAAA;AAEb,MAAM,QAAQ,CACZ,CAAA;AAAA;AAAA,EAGA,IAAA,CAAK,MAAM,CAAC;AAAA,CAAA;AAoBP,MAAM,qBAAA,GAAwB;AAS9B,MAAM,qBAAA,GAAwB;AAU9B,MAAM,mBAAA,GAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASL,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQL,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA;AACF;;;;"}
@@ -15,10 +15,10 @@ export declare const isNonZeroInt: (a: number) => a is TtfImported_NonZeroInt;
15
15
  * @throws {TypeError} If the value is not a non-zero integer.
16
16
  */
17
17
  export declare const asNonZeroInt: <N extends number>(x: N) => number & {
18
- readonly NaNValue: false;
18
+ readonly "!=0": true;
19
19
  readonly Finite: true;
20
20
  readonly Int: true;
21
- readonly "!=0": true;
21
+ readonly NaNValue: false;
22
22
  } & Readonly<{
23
23
  'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;
24
24
  }> & N;
@@ -1,92 +1,81 @@
1
1
  import { TsDataForgeInternals } from '../refined-number-utils.mjs';
2
2
 
3
- const typeNameInMessage = 'a non-zero integer';
4
- const { abs, castType, is, max: max_, min: min_, mul, pow, randomNonZero: random, } = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger({
5
- integerOrSafeInteger: 'Integer',
6
- nonZero: true,
7
- MIN_VALUE: -Number.MAX_VALUE,
8
- MAX_VALUE: Number.MAX_VALUE,
9
- typeNameInMessage,
3
+ const typeNameInMessage = "a non-zero integer";
4
+ const {
5
+ abs,
6
+ castType,
7
+ is,
8
+ max: max_,
9
+ min: min_,
10
+ mul,
11
+ pow,
12
+ randomNonZero: random
13
+ } = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger({
14
+ integerOrSafeInteger: "Integer",
15
+ nonZero: true,
16
+ MIN_VALUE: -Number.MAX_VALUE,
17
+ MAX_VALUE: Number.MAX_VALUE,
18
+ typeNameInMessage
10
19
  });
11
- /**
12
- * Checks if a number is a NonZeroInt.
13
- *
14
- * @param value The value to check.
15
- * @returns `true` if the value is a NonZeroInt, `false` otherwise.
16
- */
17
20
  const isNonZeroInt = is;
18
- /**
19
- * Casts a number to a NonZeroInt type.
20
- *
21
- * @param value The value to cast.
22
- * @returns The value as a NonZeroInt type.
23
- * @throws {TypeError} If the value is not a non-zero integer.
24
- */
25
21
  const asNonZeroInt = castType;
26
- /**
27
- * Namespace providing type-safe arithmetic operations for non-zero integers.
28
- *
29
- * All operations maintain the non-zero constraint, ensuring that results are
30
- * always valid NonZeroInt values. Division operations return floor division
31
- * results, and all arithmetic maintains integer precision.
32
- */
33
22
  const NonZeroInt = {
34
- /**
35
- * Type guard to check if a value is a NonZeroInt.
36
- *
37
- * @param value The value to check.
38
- * @returns `true` if the value is a non-zero integer, `false` otherwise.
39
- */
40
- is,
41
- /**
42
- * Returns the absolute value of a non-zero integer.
43
- *
44
- * @param a The non-zero integer.
45
- * @returns The absolute value as a NonZeroInt.
46
- */
47
- abs,
48
- /**
49
- * Returns the smaller of two non-zero integers.
50
- *
51
- * @param a The first non-zero integer.
52
- * @param b The second non-zero integer.
53
- * @returns The minimum value as a NonZeroInt.
54
- */
55
- min: min_,
56
- /**
57
- * Returns the larger of two non-zero integers.
58
- *
59
- * @param a The first non-zero integer.
60
- * @param b The second non-zero integer.
61
- * @returns The maximum value as a NonZeroInt.
62
- */
63
- max: max_,
64
- /**
65
- * Generates a random non-zero integer.
66
- *
67
- * @returns A random NonZeroInt value.
68
- */
69
- random,
70
- /**
71
- * Raises a non-zero integer to the power of another non-zero integer.
72
- *
73
- * @param a The base non-zero integer.
74
- * @param b The exponent non-zero integer.
75
- * @returns `a ** b` as a NonZeroInt.
76
- */
77
- pow,
78
- /**
79
- * Multiplies two non-zero integers.
80
- *
81
- * The product of two non-zero integers is always non-zero, so this stays
82
- * closed; for the non-closed operations (`add`/`sub`/`div`, whose result may
83
- * be `0`) use {@link Num.add}/{@link Num.sub}/{@link Num.divInt}.
84
- *
85
- * @param a The first non-zero integer.
86
- * @param b The second non-zero integer.
87
- * @returns `a * b` as a NonZeroInt.
88
- */
89
- mul,
23
+ /**
24
+ * Type guard to check if a value is a NonZeroInt.
25
+ *
26
+ * @param value The value to check.
27
+ * @returns `true` if the value is a non-zero integer, `false` otherwise.
28
+ */
29
+ is,
30
+ /**
31
+ * Returns the absolute value of a non-zero integer.
32
+ *
33
+ * @param a The non-zero integer.
34
+ * @returns The absolute value as a NonZeroInt.
35
+ */
36
+ abs,
37
+ /**
38
+ * Returns the smaller of two non-zero integers.
39
+ *
40
+ * @param a The first non-zero integer.
41
+ * @param b The second non-zero integer.
42
+ * @returns The minimum value as a NonZeroInt.
43
+ */
44
+ min: min_,
45
+ /**
46
+ * Returns the larger of two non-zero integers.
47
+ *
48
+ * @param a The first non-zero integer.
49
+ * @param b The second non-zero integer.
50
+ * @returns The maximum value as a NonZeroInt.
51
+ */
52
+ max: max_,
53
+ /**
54
+ * Generates a random non-zero integer.
55
+ *
56
+ * @returns A random NonZeroInt value.
57
+ */
58
+ random,
59
+ /**
60
+ * Raises a non-zero integer to the power of another non-zero integer.
61
+ *
62
+ * @param a The base non-zero integer.
63
+ * @param b The exponent non-zero integer.
64
+ * @returns `a ** b` as a NonZeroInt.
65
+ */
66
+ pow,
67
+ /**
68
+ * Multiplies two non-zero integers.
69
+ *
70
+ * The product of two non-zero integers is always non-zero, so this stays
71
+ * closed; for the non-closed operations (`add`/`sub`/`div`, whose result may
72
+ * be `0`) use {@link Num.add}/{@link Num.sub}/{@link Num.divInt}.
73
+ *
74
+ * @param a The first non-zero integer.
75
+ * @param b The second non-zero integer.
76
+ * @returns `a * b` as a NonZeroInt.
77
+ */
78
+ mul
90
79
  };
91
80
 
92
81
  export { NonZeroInt, asNonZeroInt, isNonZeroInt };
@@ -1 +1 @@
1
- {"version":3,"file":"non-zero-int.mjs","sources":["../../../src/number/branded-types/non-zero-int.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAQA,MAAM,iBAAiB,GAAG,oBAAoB;AAE9C,MAAM,EACJ,GAAG,EACH,QAAQ,EACR,EAAE,EACF,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,IAAI,EACT,GAAG,EACH,GAAG,EACH,aAAa,EAAE,MAAM,GACtB,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,mBAAmB,CAI7D;AACA,IAAA,oBAAoB,EAAE,SAAS;AAC/B,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,SAAS,EAAE,CAAC,MAAM,CAAC,SAAS;IAC5B,SAAS,EAAE,MAAM,CAAC,SAAS;IAC3B,iBAAiB;AACT,CAAA,CAAC;AAEX;;;;;AAKG;AACI,MAAM,YAAY,GAAG;AAE5B;;;;;;AAMG;AACI,MAAM,YAAY,GAAG;AAE5B;;;;;;AAMG;AACI,MAAM,UAAU,GAAG;AACxB;;;;;AAKG;IACH,EAAE;AAEF;;;;;AAKG;IACH,GAAG;AAEH;;;;;;AAMG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;;;AAMG;AACH,IAAA,GAAG,EAAE,IAAI;AAET;;;;AAIG;IACH,MAAM;AAEN;;;;;;AAMG;IACH,GAAG;AAEH;;;;;;;;;;AAUG;IACH,GAAG;;;;;"}
1
+ {"version":3,"file":"non-zero-int.mjs","sources":["../../../src/number/branded-types/non-zero-int.mts"],"sourcesContent":["import { type NonZeroInt as TtfImported_NonZeroInt } from 'ts-type-forge';\nimport { expectType } from '../../expect-type.mjs';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type NonZeroInt = TtfImported_NonZeroInt;\n\ntype ElementType = NonZeroInt;\n\nconst typeNameInMessage = 'a non-zero integer';\n\nconst {\n abs,\n castType,\n is,\n max: max_,\n min: min_,\n mul,\n pow,\n randomNonZero: random,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n number,\n number\n>({\n integerOrSafeInteger: 'Integer',\n nonZero: true,\n MIN_VALUE: -Number.MAX_VALUE,\n MAX_VALUE: Number.MAX_VALUE,\n typeNameInMessage,\n} as const);\n\n/**\n * Checks if a number is a NonZeroInt.\n *\n * @param value The value to check.\n * @returns `true` if the value is a NonZeroInt, `false` otherwise.\n */\nexport const isNonZeroInt = is;\n\n/**\n * Casts a number to a NonZeroInt type.\n *\n * @param value The value to cast.\n * @returns The value as a NonZeroInt type.\n * @throws {TypeError} If the value is not a non-zero integer.\n */\nexport const asNonZeroInt = castType;\n\n/**\n * Namespace providing type-safe arithmetic operations for non-zero integers.\n *\n * All operations maintain the non-zero constraint, ensuring that results are\n * always valid NonZeroInt values. Division operations return floor division\n * results, and all arithmetic maintains integer precision.\n */\nexport const NonZeroInt = {\n /**\n * Type guard to check if a value is a NonZeroInt.\n *\n * @param value The value to check.\n * @returns `true` if the value is a non-zero integer, `false` otherwise.\n */\n is,\n\n /**\n * Returns the absolute value of a non-zero integer.\n *\n * @param a The non-zero integer.\n * @returns The absolute value as a NonZeroInt.\n */\n abs,\n\n /**\n * Returns the smaller of two non-zero integers.\n *\n * @param a The first non-zero integer.\n * @param b The second non-zero integer.\n * @returns The minimum value as a NonZeroInt.\n */\n min: min_,\n\n /**\n * Returns the larger of two non-zero integers.\n *\n * @param a The first non-zero integer.\n * @param b The second non-zero integer.\n * @returns The maximum value as a NonZeroInt.\n */\n max: max_,\n\n /**\n * Generates a random non-zero integer.\n *\n * @returns A random NonZeroInt value.\n */\n random,\n\n /**\n * Raises a non-zero integer to the power of another non-zero integer.\n *\n * @param a The base non-zero integer.\n * @param b The exponent non-zero integer.\n * @returns `a ** b` as a NonZeroInt.\n */\n pow,\n\n /**\n * Multiplies two non-zero integers.\n *\n * The product of two non-zero integers is always non-zero, so this stays\n * closed; for the non-closed operations (`add`/`sub`/`div`, whose result may\n * be `0`) use {@link Num.add}/{@link Num.sub}/{@link Num.divInt}.\n *\n * @param a The first non-zero integer.\n * @param b The second non-zero integer.\n * @returns `a * b` as a NonZeroInt.\n */\n mul,\n} as const;\n\nexpectType<\n keyof typeof NonZeroInt,\n keyof TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int',\n 'mul'\n >\n>('=');\n\nexpectType<\n typeof NonZeroInt,\n TsDataForgeInternals.RefinedNumberUtils.NumberClass<ElementType, 'int', 'mul'>\n>('<=');\n"],"names":[],"mappings":";;AAQA,MAAM,iBAAA,GAAoB,oBAAA;AAE1B,MAAM;AAAA,EACJ,GAAA;AAAA,EACA,QAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,GAAA;AAAA,EACA,aAAA,EAAe;AACjB,CAAA,GAAI,oBAAA,CAAqB,mBAAmB,mBAAA,CAI1C;AAAA,EACA,oBAAA,EAAsB,SAAA;AAAA,EACtB,OAAA,EAAS,IAAA;AAAA,EACT,SAAA,EAAW,CAAC,MAAA,CAAO,SAAA;AAAA,EACnB,WAAW,MAAA,CAAO,SAAA;AAAA,EAClB;AACF,CAAU,CAAA;AAQH,MAAM,YAAA,GAAe;AASrB,MAAM,YAAA,GAAe;AASrB,MAAM,UAAA,GAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOxB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASL,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOL,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA;AACF;;;;"}
@@ -16,18 +16,18 @@ export declare const isNonZeroInt16: (a: number) => a is TtfImported_NonZeroInt1
16
16
  * @throws {TypeError} If the value is not a non-zero integer in [-2^15, 2^15).
17
17
  */
18
18
  export declare const asNonZeroInt16: <N extends number>(x: N) => number & {
19
- readonly NaNValue: false;
20
- readonly Finite: true;
21
- readonly Int: true;
22
- readonly "> -2^16": true;
23
- readonly "> -2^32": true;
24
- readonly ">= -2^15": true;
25
- readonly ">= -2^31": true;
26
19
  readonly "!=0": true;
27
20
  readonly "< 2^15": true;
28
21
  readonly "< 2^16": true;
29
22
  readonly "< 2^31": true;
30
23
  readonly "< 2^32": true;
24
+ readonly "> -2^16": true;
25
+ readonly "> -2^32": true;
26
+ readonly ">= -2^15": true;
27
+ readonly ">= -2^31": true;
28
+ readonly Finite: true;
29
+ readonly Int: true;
30
+ readonly NaNValue: false;
31
31
  readonly SafeInt: true;
32
32
  } & Readonly<{
33
33
  'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;