ts-data-forge 5.0.1 → 5.1.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 (539) hide show
  1. package/README.md +101 -50
  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 +34 -10
  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 +34 -4
  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 +20 -7
  20. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  21. package/dist/array/impl/array-utils-set-op.mjs +20 -7
  22. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  23. package/dist/array/impl/array-utils-size.d.mts +5 -2
  24. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  25. package/dist/array/impl/array-utils-size.mjs +5 -2
  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 +17 -2
  31. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  32. package/dist/array/impl/array-utils-slicing.mjs +9 -2
  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 +35 -18
  39. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  40. package/dist/array/impl/array-utils-validation.mjs +25 -14
  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 +35 -15
  44. package/dist/collections/imap.d.mts.map +1 -1
  45. package/dist/collections/imap.mjs +5 -3
  46. package/dist/collections/imap.mjs.map +1 -1
  47. package/dist/collections/iset-mapped.d.mts +46 -19
  48. package/dist/collections/iset-mapped.d.mts.map +1 -1
  49. package/dist/collections/iset-mapped.mjs +9 -2
  50. package/dist/collections/iset-mapped.mjs.map +1 -1
  51. package/dist/collections/iset.d.mts +48 -19
  52. package/dist/collections/iset.d.mts.map +1 -1
  53. package/dist/collections/iset.mjs +9 -2
  54. package/dist/collections/iset.mjs.map +1 -1
  55. package/dist/collections/queue.d.mts +65 -25
  56. package/dist/collections/queue.d.mts.map +1 -1
  57. package/dist/collections/queue.mjs +13 -5
  58. package/dist/collections/queue.mjs.map +1 -1
  59. package/dist/collections/stack.d.mts +60 -25
  60. package/dist/collections/stack.d.mts.map +1 -1
  61. package/dist/collections/stack.mjs +12 -5
  62. package/dist/collections/stack.mjs.map +1 -1
  63. package/dist/entry-point.mjs +1 -1
  64. package/dist/functional/match.d.mts +1 -1
  65. package/dist/functional/match.d.mts.map +1 -1
  66. package/dist/functional/match.mjs.map +1 -1
  67. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +3 -2
  68. package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -1
  69. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  70. package/dist/functional/optional/impl/optional-filter.d.mts +3 -0
  71. package/dist/functional/optional/impl/optional-filter.d.mts.map +1 -1
  72. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  73. package/dist/functional/optional/impl/optional-flat-map.d.mts +2 -0
  74. package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -1
  75. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  76. package/dist/functional/optional/impl/optional-from-nullable.d.mts +2 -0
  77. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  78. package/dist/functional/optional/impl/optional-from-nullable.mjs +2 -0
  79. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  80. package/dist/functional/optional/impl/optional-is-none.d.mts +1 -1
  81. package/dist/functional/optional/impl/optional-is-none.mjs +1 -1
  82. package/dist/functional/optional/impl/optional-is-optional.d.mts +4 -2
  83. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  84. package/dist/functional/optional/impl/optional-is-optional.mjs +4 -2
  85. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  86. package/dist/functional/optional/impl/optional-is-some.d.mts +2 -1
  87. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  88. package/dist/functional/optional/impl/optional-is-some.mjs +2 -1
  89. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  90. package/dist/functional/optional/impl/optional-map.d.mts +2 -0
  91. package/dist/functional/optional/impl/optional-map.d.mts.map +1 -1
  92. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  93. package/dist/functional/optional/impl/optional-none.d.mts +4 -2
  94. package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
  95. package/dist/functional/optional/impl/optional-none.mjs +4 -2
  96. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  97. package/dist/functional/optional/impl/optional-or-else.d.mts +4 -0
  98. package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -1
  99. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  100. package/dist/functional/optional/impl/optional-some.d.mts +5 -3
  101. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  102. package/dist/functional/optional/impl/optional-some.mjs +4 -2
  103. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  104. package/dist/functional/optional/impl/optional-to-nullable.d.mts +4 -2
  105. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  106. package/dist/functional/optional/impl/optional-to-nullable.mjs +4 -2
  107. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  108. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +7 -4
  109. package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +1 -1
  110. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  111. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +2 -1
  112. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  113. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +2 -1
  114. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  115. package/dist/functional/optional/impl/optional-unwrap.d.mts +4 -2
  116. package/dist/functional/optional/impl/optional-unwrap.d.mts.map +1 -1
  117. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  118. package/dist/functional/optional/impl/optional-zip.d.mts +3 -1
  119. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  120. package/dist/functional/optional/impl/optional-zip.mjs +3 -1
  121. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  122. package/dist/functional/pipe.d.mts +2 -2
  123. package/dist/functional/result/impl/result-err.d.mts +4 -2
  124. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  125. package/dist/functional/result/impl/result-err.mjs +3 -1
  126. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  127. package/dist/functional/result/impl/result-expect-to-be.d.mts +3 -2
  128. package/dist/functional/result/impl/result-expect-to-be.d.mts.map +1 -1
  129. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
  130. package/dist/functional/result/impl/result-flat-map.d.mts +5 -0
  131. package/dist/functional/result/impl/result-flat-map.d.mts.map +1 -1
  132. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
  133. package/dist/functional/result/impl/result-fold.d.mts +4 -0
  134. package/dist/functional/result/impl/result-fold.d.mts.map +1 -1
  135. package/dist/functional/result/impl/result-fold.mjs.map +1 -1
  136. package/dist/functional/result/impl/result-from-promise.d.mts +4 -1
  137. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  138. package/dist/functional/result/impl/result-from-promise.mjs +4 -1
  139. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  140. package/dist/functional/result/impl/result-from-throwable.d.mts +3 -1
  141. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  142. package/dist/functional/result/impl/result-from-throwable.mjs +3 -1
  143. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
  144. package/dist/functional/result/impl/result-is-err.d.mts +4 -2
  145. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  146. package/dist/functional/result/impl/result-is-err.mjs +4 -2
  147. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  148. package/dist/functional/result/impl/result-is-ok.d.mts +4 -2
  149. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  150. package/dist/functional/result/impl/result-is-ok.mjs +4 -2
  151. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  152. package/dist/functional/result/impl/result-is-result.d.mts +7 -3
  153. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  154. package/dist/functional/result/impl/result-is-result.mjs +7 -3
  155. package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
  156. package/dist/functional/result/impl/result-map-err.d.mts +3 -0
  157. package/dist/functional/result/impl/result-map-err.d.mts.map +1 -1
  158. package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
  159. package/dist/functional/result/impl/result-map.d.mts +4 -0
  160. package/dist/functional/result/impl/result-map.d.mts.map +1 -1
  161. package/dist/functional/result/impl/result-map.mjs.map +1 -1
  162. package/dist/functional/result/impl/result-ok.d.mts +4 -2
  163. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  164. package/dist/functional/result/impl/result-ok.mjs +3 -1
  165. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  166. package/dist/functional/result/impl/result-or-else.d.mts +4 -0
  167. package/dist/functional/result/impl/result-or-else.d.mts.map +1 -1
  168. package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
  169. package/dist/functional/result/impl/result-swap.d.mts +2 -0
  170. package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
  171. package/dist/functional/result/impl/result-swap.mjs +2 -0
  172. package/dist/functional/result/impl/result-swap.mjs.map +1 -1
  173. package/dist/functional/result/impl/result-to-optional.d.mts +2 -0
  174. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
  175. package/dist/functional/result/impl/result-to-optional.mjs +2 -0
  176. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
  177. package/dist/functional/result/impl/result-unwrap-err-or.d.mts +7 -4
  178. package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +1 -1
  179. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
  180. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +3 -1
  181. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
  182. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +3 -1
  183. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  184. package/dist/functional/result/impl/result-unwrap-err.d.mts +3 -2
  185. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  186. package/dist/functional/result/impl/result-unwrap-err.mjs +3 -2
  187. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
  188. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +7 -4
  189. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +1 -1
  190. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
  191. package/dist/functional/result/impl/result-unwrap-ok.d.mts +3 -2
  192. package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +1 -1
  193. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
  194. package/dist/functional/result/impl/result-unwrap-throw.d.mts +3 -1
  195. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  196. package/dist/functional/result/impl/result-unwrap-throw.mjs +3 -1
  197. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  198. package/dist/functional/result/impl/result-zip.d.mts +3 -1
  199. package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
  200. package/dist/functional/result/impl/result-zip.mjs +3 -1
  201. package/dist/functional/result/impl/result-zip.mjs.map +1 -1
  202. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +3 -2
  203. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  204. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +2 -1
  205. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  206. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +1 -0
  207. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +1 -1
  208. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
  209. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +4 -0
  210. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +1 -1
  211. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
  212. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +2 -0
  213. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +1 -1
  214. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
  215. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +3 -1
  216. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
  217. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +3 -1
  218. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
  219. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +3 -1
  220. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
  221. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +3 -1
  222. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
  223. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +1 -0
  224. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
  225. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +1 -0
  226. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
  227. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +7 -3
  228. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
  229. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +7 -3
  230. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
  231. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +1 -0
  232. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
  233. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +1 -0
  234. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
  235. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +3 -0
  236. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +1 -1
  237. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
  238. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +3 -0
  239. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +1 -1
  240. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
  241. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +6 -0
  242. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +1 -1
  243. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
  244. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +1 -1
  245. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  246. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  247. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +2 -0
  248. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +1 -1
  249. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
  250. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +2 -0
  251. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
  252. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +2 -0
  253. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
  254. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +2 -0
  255. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +1 -1
  256. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
  257. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +1 -0
  258. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
  259. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +1 -0
  260. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  261. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +2 -0
  262. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
  263. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +2 -0
  264. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
  265. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +2 -0
  266. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +1 -1
  267. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
  268. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +2 -0
  269. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +1 -1
  270. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
  271. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +1 -0
  272. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
  273. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +1 -0
  274. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  275. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +2 -0
  276. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +1 -1
  277. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
  278. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +1 -0
  279. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
  280. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +1 -0
  281. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  282. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +2 -0
  283. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
  284. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +2 -0
  285. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
  286. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +1 -1
  287. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  288. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  289. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +4 -0
  290. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
  291. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +4 -0
  292. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
  293. package/dist/globals.d.mts +12 -1
  294. package/dist/guard/has-key.d.mts +6 -3
  295. package/dist/guard/has-key.d.mts.map +1 -1
  296. package/dist/guard/has-key.mjs +2 -2
  297. package/dist/guard/index.mjs +1 -1
  298. package/dist/guard/is-record.d.mts +31 -0
  299. package/dist/guard/is-record.d.mts.map +1 -1
  300. package/dist/guard/is-record.mjs +32 -1
  301. package/dist/guard/is-record.mjs.map +1 -1
  302. package/dist/guard/is-type.d.mts +3 -0
  303. package/dist/guard/is-type.d.mts.map +1 -1
  304. package/dist/guard/is-type.mjs +3 -0
  305. package/dist/guard/is-type.mjs.map +1 -1
  306. package/dist/guard/key-is-in.d.mts +3 -2
  307. package/dist/guard/key-is-in.d.mts.map +1 -1
  308. package/dist/guard/key-is-in.mjs +3 -2
  309. package/dist/guard/key-is-in.mjs.map +1 -1
  310. package/dist/index.mjs +1 -1
  311. package/dist/iterator/range.d.mts +4 -0
  312. package/dist/iterator/range.d.mts.map +1 -1
  313. package/dist/iterator/range.mjs +1 -0
  314. package/dist/iterator/range.mjs.map +1 -1
  315. package/dist/json/json.d.mts +42 -21
  316. package/dist/json/json.d.mts.map +1 -1
  317. package/dist/json/json.mjs +42 -21
  318. package/dist/json/json.mjs.map +1 -1
  319. package/dist/number/branded-types/int.d.mts +33 -19
  320. package/dist/number/branded-types/int.d.mts.map +1 -1
  321. package/dist/number/branded-types/int.mjs +33 -19
  322. package/dist/number/branded-types/int.mjs.map +1 -1
  323. package/dist/number/branded-types/non-zero-safe-int.mjs +2 -2
  324. package/dist/number/branded-types/positive-int.d.mts +34 -20
  325. package/dist/number/branded-types/positive-int.d.mts.map +1 -1
  326. package/dist/number/branded-types/positive-int.mjs +34 -20
  327. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  328. package/dist/number/branded-types/positive-safe-int.d.mts +47 -26
  329. package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
  330. package/dist/number/branded-types/positive-safe-int.mjs +48 -27
  331. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  332. package/dist/number/branded-types/safe-int.d.mts +48 -27
  333. package/dist/number/branded-types/safe-int.d.mts.map +1 -1
  334. package/dist/number/branded-types/safe-int.mjs +50 -29
  335. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  336. package/dist/number/branded-types/safe-uint.mjs +1 -1
  337. package/dist/number/branded-types/uint.d.mts +31 -19
  338. package/dist/number/branded-types/uint.d.mts.map +1 -1
  339. package/dist/number/branded-types/uint.mjs +31 -19
  340. package/dist/number/branded-types/uint.mjs.map +1 -1
  341. package/dist/number/num.d.mts +29 -20
  342. package/dist/number/num.d.mts.map +1 -1
  343. package/dist/number/num.mjs +24 -17
  344. package/dist/number/num.mjs.map +1 -1
  345. package/dist/number/refined-number-utils.d.mts +33 -11
  346. package/dist/number/refined-number-utils.d.mts.map +1 -1
  347. package/dist/number/refined-number-utils.mjs +33 -11
  348. package/dist/number/refined-number-utils.mjs.map +1 -1
  349. package/dist/object/object.d.mts +12 -3
  350. package/dist/object/object.d.mts.map +1 -1
  351. package/dist/object/object.mjs +10 -3
  352. package/dist/object/object.mjs.map +1 -1
  353. package/dist/others/map-nullable.mjs.map +1 -1
  354. package/dist/others/tuple.d.mts +14 -3
  355. package/dist/others/tuple.d.mts.map +1 -1
  356. package/dist/others/tuple.mjs +14 -3
  357. package/dist/others/tuple.mjs.map +1 -1
  358. package/dist/others/unknown-to-string.d.mts.map +1 -1
  359. package/dist/others/unknown-to-string.mjs.map +1 -1
  360. package/dist/promise/promise.d.mts +8 -4
  361. package/dist/promise/promise.d.mts.map +1 -1
  362. package/dist/promise/promise.mjs +8 -4
  363. package/dist/promise/promise.mjs.map +1 -1
  364. package/package.json +26 -28
  365. package/src/array/impl/array-utils-creation.mts +20 -0
  366. package/src/array/impl/array-utils-creation.test.mts +72 -1
  367. package/src/array/impl/array-utils-element-access.mts +13 -0
  368. package/src/array/impl/array-utils-element-access.test.mts +36 -15
  369. package/src/array/impl/array-utils-iterators.test.mts +17 -0
  370. package/src/array/impl/array-utils-modification.mts +78 -19
  371. package/src/array/impl/array-utils-modification.test.mts +75 -0
  372. package/src/array/impl/array-utils-overload-type-error.test.mts +19 -0
  373. package/src/array/impl/array-utils-reducing-value.mts +61 -16
  374. package/src/array/impl/array-utils-reducing-value.test.mts +107 -25
  375. package/src/array/impl/array-utils-search.mts +57 -4
  376. package/src/array/impl/array-utils-search.test.mts +61 -10
  377. package/src/array/impl/array-utils-set-op.mts +26 -7
  378. package/src/array/impl/array-utils-set-op.test.mts +129 -13
  379. package/src/array/impl/array-utils-size.mts +5 -2
  380. package/src/array/impl/array-utils-size.test.mts +1 -0
  381. package/src/array/impl/array-utils-slice-clamped.mts +7 -0
  382. package/src/array/impl/array-utils-slice-clamped.test.mts +20 -0
  383. package/src/array/impl/array-utils-slicing.mts +29 -2
  384. package/src/array/impl/array-utils-slicing.test.mts +57 -0
  385. package/src/array/impl/array-utils-transformation.mts +58 -0
  386. package/src/array/impl/array-utils-transformation.test.mts +115 -3
  387. package/src/array/impl/array-utils-validation.mts +41 -18
  388. package/src/array/impl/array-utils-validation.test.mts +176 -78
  389. package/src/array/impl/array.test.mts +18 -6
  390. package/src/collections/imap-mapped.mts +11 -0
  391. package/src/collections/imap-mapped.test.mts +86 -18
  392. package/src/collections/imap.mts +47 -15
  393. package/src/collections/imap.test.mts +137 -31
  394. package/src/collections/iset-mapped.mts +54 -19
  395. package/src/collections/iset-mapped.test.mts +163 -52
  396. package/src/collections/iset.mts +53 -19
  397. package/src/collections/iset.test.mts +323 -130
  398. package/src/collections/queue.mts +78 -25
  399. package/src/collections/queue.test.mts +65 -35
  400. package/src/collections/stack.mts +67 -25
  401. package/src/collections/stack.test.mts +59 -15
  402. package/src/functional/match.mts +17 -1
  403. package/src/functional/match.test.mts +2 -0
  404. package/src/functional/optional/impl/optional-expect-to-be.mts +5 -2
  405. package/src/functional/optional/impl/optional-filter.mts +6 -0
  406. package/src/functional/optional/impl/optional-flat-map.mts +4 -0
  407. package/src/functional/optional/impl/optional-from-nullable.mts +2 -0
  408. package/src/functional/optional/impl/optional-is-none.mts +1 -1
  409. package/src/functional/optional/impl/optional-is-optional.mts +4 -2
  410. package/src/functional/optional/impl/optional-is-some.mts +2 -1
  411. package/src/functional/optional/impl/optional-map.mts +5 -0
  412. package/src/functional/optional/impl/optional-none.mts +4 -2
  413. package/src/functional/optional/impl/optional-or-else.mts +6 -0
  414. package/src/functional/optional/impl/optional-some.mts +5 -3
  415. package/src/functional/optional/impl/optional-to-nullable.mts +4 -2
  416. package/src/functional/optional/impl/optional-unwrap-or.mts +9 -4
  417. package/src/functional/optional/impl/optional-unwrap-throw.mts +2 -1
  418. package/src/functional/optional/impl/optional-unwrap.mts +4 -2
  419. package/src/functional/optional/impl/optional-zip.mts +3 -1
  420. package/src/functional/optional.test.mts +126 -54
  421. package/src/functional/pipe.mts +2 -2
  422. package/src/functional/pipe.test.mts +7 -4
  423. package/src/functional/result/impl/result-err.mts +4 -2
  424. package/src/functional/result/impl/result-expect-to-be.mts +5 -2
  425. package/src/functional/result/impl/result-flat-map.mts +7 -0
  426. package/src/functional/result/impl/result-fold.mts +6 -0
  427. package/src/functional/result/impl/result-from-promise.mts +4 -1
  428. package/src/functional/result/impl/result-from-throwable.mts +5 -1
  429. package/src/functional/result/impl/result-is-err.mts +4 -2
  430. package/src/functional/result/impl/result-is-ok.mts +4 -2
  431. package/src/functional/result/impl/result-is-result.mts +7 -3
  432. package/src/functional/result/impl/result-map-err.mts +5 -0
  433. package/src/functional/result/impl/result-map.mts +6 -0
  434. package/src/functional/result/impl/result-ok.mts +4 -2
  435. package/src/functional/result/impl/result-or-else.mts +6 -0
  436. package/src/functional/result/impl/result-swap.mts +2 -0
  437. package/src/functional/result/impl/result-to-optional.mts +2 -0
  438. package/src/functional/result/impl/result-unwrap-err-or.mts +9 -4
  439. package/src/functional/result/impl/result-unwrap-err-throw.mts +3 -1
  440. package/src/functional/result/impl/result-unwrap-err.mts +3 -2
  441. package/src/functional/result/impl/result-unwrap-ok-or.mts +9 -4
  442. package/src/functional/result/impl/result-unwrap-ok.mts +4 -2
  443. package/src/functional/result/impl/result-unwrap-throw.mts +3 -1
  444. package/src/functional/result/impl/result-zip.mts +3 -1
  445. package/src/functional/result.test.mts +182 -152
  446. package/src/functional/ternary-result/impl/ternary-result-err.mts +3 -2
  447. package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +4 -0
  448. package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +7 -0
  449. package/src/functional/ternary-result/impl/ternary-result-fold.mts +5 -0
  450. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +3 -1
  451. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +4 -1
  452. package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +1 -0
  453. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +7 -3
  454. package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +1 -0
  455. package/src/functional/ternary-result/impl/ternary-result-map-err.mts +6 -0
  456. package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +6 -0
  457. package/src/functional/ternary-result/impl/ternary-result-map.mts +9 -0
  458. package/src/functional/ternary-result/impl/ternary-result-ok.mts +1 -1
  459. package/src/functional/ternary-result/impl/ternary-result-or-else.mts +5 -0
  460. package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +2 -0
  461. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +5 -0
  462. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +1 -0
  463. package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +2 -0
  464. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +5 -0
  465. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +3 -0
  466. package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +1 -0
  467. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +5 -0
  468. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +1 -0
  469. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +2 -0
  470. package/src/functional/ternary-result/impl/ternary-result-warn.mts +4 -1
  471. package/src/functional/ternary-result/impl/ternary-result-zip.mts +4 -0
  472. package/src/functional/ternary-result.test.mts +99 -8
  473. package/src/globals.d.mts +12 -1
  474. package/src/guard/has-key.mts +8 -5
  475. package/src/guard/has-key.test.mts +9 -5
  476. package/src/guard/is-error.test.mts +143 -0
  477. package/src/guard/is-non-empty-string.test.mts +44 -24
  478. package/src/guard/is-non-null-object.test.mts +45 -26
  479. package/src/guard/is-primitive.test.mts +51 -28
  480. package/src/guard/is-record.mts +34 -0
  481. package/src/guard/is-record.test.mts +28 -7
  482. package/src/guard/is-type.mts +3 -0
  483. package/src/guard/is-type.test.mts +285 -155
  484. package/src/guard/key-is-in.mts +3 -2
  485. package/src/guard/key-is-in.test.mts +2 -2
  486. package/src/iterator/range.mts +9 -0
  487. package/src/json/json.mts +50 -21
  488. package/src/json/json.test.mts +224 -176
  489. package/src/number/branded-types/finite-number.test.mts +51 -11
  490. package/src/number/branded-types/int.mts +33 -19
  491. package/src/number/branded-types/int.test.mts +56 -14
  492. package/src/number/branded-types/int16.test.mts +63 -16
  493. package/src/number/branded-types/int32.test.mts +63 -16
  494. package/src/number/branded-types/non-negative-finite-number.test.mts +52 -12
  495. package/src/number/branded-types/non-negative-int16.test.mts +59 -16
  496. package/src/number/branded-types/non-negative-int32.test.mts +59 -16
  497. package/src/number/branded-types/non-zero-finite-number.test.mts +65 -14
  498. package/src/number/branded-types/non-zero-int.test.mts +72 -19
  499. package/src/number/branded-types/non-zero-int16.test.mts +60 -16
  500. package/src/number/branded-types/non-zero-int32.test.mts +60 -16
  501. package/src/number/branded-types/non-zero-safe-int.mts +2 -2
  502. package/src/number/branded-types/non-zero-safe-int.test.mts +85 -23
  503. package/src/number/branded-types/non-zero-uint16.test.mts +53 -16
  504. package/src/number/branded-types/non-zero-uint32.test.mts +53 -16
  505. package/src/number/branded-types/positive-finite-number.test.mts +59 -14
  506. package/src/number/branded-types/positive-int.mts +34 -20
  507. package/src/number/branded-types/positive-int.test.mts +64 -17
  508. package/src/number/branded-types/positive-int16.test.mts +50 -15
  509. package/src/number/branded-types/positive-int32.test.mts +50 -15
  510. package/src/number/branded-types/positive-safe-int.mts +48 -27
  511. package/src/number/branded-types/positive-safe-int.test.mts +68 -19
  512. package/src/number/branded-types/positive-uint16.test.mts +53 -16
  513. package/src/number/branded-types/positive-uint32.test.mts +53 -16
  514. package/src/number/branded-types/safe-int.mts +50 -29
  515. package/src/number/branded-types/safe-int.test.mts +70 -18
  516. package/src/number/branded-types/safe-uint.mts +1 -1
  517. package/src/number/branded-types/safe-uint.test.mts +65 -17
  518. package/src/number/branded-types/uint.mts +31 -19
  519. package/src/number/branded-types/uint.test.mts +58 -15
  520. package/src/number/branded-types/uint16.test.mts +56 -15
  521. package/src/number/branded-types/uint32.test.mts +56 -15
  522. package/src/number/enum/int8.test.mts +7 -1
  523. package/src/number/enum/uint8.test.mts +7 -1
  524. package/src/number/num.mts +32 -21
  525. package/src/number/num.test.mts +88 -26
  526. package/src/number/refined-number-utils.mts +38 -13
  527. package/src/object/object.mts +19 -3
  528. package/src/object/object.test.mts +16 -6
  529. package/src/others/cast-mutable.test.mts +8 -1
  530. package/src/others/cast-readonly.test.mts +21 -4
  531. package/src/others/if-then.test.mts +40 -24
  532. package/src/others/map-nullable.mts +3 -0
  533. package/src/others/map-nullable.test.mts +27 -0
  534. package/src/others/memoize-function.test.mts +41 -0
  535. package/src/others/tuple.mts +14 -3
  536. package/src/others/unknown-to-string.mts +2 -0
  537. package/src/others/unknown-to-string.test.mts +10 -0
  538. package/src/promise/promise.mts +8 -4
  539. package/src/promise/promise.test.mts +8 -13
@@ -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
  });
@@ -18,9 +18,11 @@ const { MAX_VALUE, MIN_VALUE, abs, add, castType, clamp, div, is, max: max_, min
18
18
  * @example
19
19
  *
20
20
  * ```ts
21
- * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
22
- * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
23
- * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
21
+ * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));
22
+ *
23
+ * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
24
+ *
25
+ * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));
24
26
  * ```
25
27
  *
26
28
  * @param value - The value to check
@@ -39,8 +41,9 @@ const isSafeInt = is;
39
41
  * ```ts
40
42
  * const branded = asSafeInt(123);
41
43
  *
42
- * assert(branded === 123);
43
- * assert.ok(SafeInt.is(branded));
44
+ * assert.isTrue(branded === 123);
45
+ *
46
+ * assert.isTrue(SafeInt.is(branded));
44
47
  * ```
45
48
  *
46
49
  * @param value - The value to cast
@@ -71,9 +74,11 @@ const SafeInt = {
71
74
  * @example
72
75
  *
73
76
  * ```ts
74
- * assert.ok(isSafeInt(Number.MAX_SAFE_INTEGER));
75
- * assert.notOk(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
76
- * assert.ok(SafeInt.is(Number.MIN_SAFE_INTEGER));
77
+ * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));
78
+ *
79
+ * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));
80
+ *
81
+ * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));
77
82
  * ```
78
83
  *
79
84
  * @param value - The value to check
@@ -103,10 +108,12 @@ const SafeInt = {
103
108
  *
104
109
  * ```ts
105
110
  * const negative = asSafeInt(-900);
111
+ *
106
112
  * const absolute = SafeInt.abs(negative);
107
113
  *
108
- * assert(absolute === 900);
109
- * assert.ok(SafeInt.is(absolute));
114
+ * assert.isTrue(absolute === 900);
115
+ *
116
+ * assert.isTrue(SafeInt.is(absolute));
110
117
  * ```
111
118
  *
112
119
  * @param a - The safe integer value
@@ -121,7 +128,7 @@ const SafeInt = {
121
128
  * ```ts
122
129
  * const smallest = SafeInt.min(asSafeInt(25), asSafeInt(-14), asSafeInt(99));
123
130
  *
124
- * assert(smallest === -14);
131
+ * assert.isTrue(smallest === -14);
125
132
  * ```
126
133
  *
127
134
  * @param values - The safe integers to compare (at least one required)
@@ -136,7 +143,7 @@ const SafeInt = {
136
143
  * ```ts
137
144
  * const largest = SafeInt.max(asSafeInt(25), asSafeInt(-14), asSafeInt(99));
138
145
  *
139
- * assert(largest === 99);
146
+ * assert.isTrue(largest === 99);
140
147
  * ```
141
148
  *
142
149
  * @param values - The safe integers to compare (at least one required)
@@ -150,12 +157,16 @@ 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
- * assert(aboveRange === Number.MAX_SAFE_INTEGER);
157
- * assert(withinRange === 123);
158
- * assert(belowRange === Number.MIN_SAFE_INTEGER);
165
+ * assert.isTrue(aboveRange === Number.MAX_SAFE_INTEGER);
166
+ *
167
+ * assert.isTrue(withinRange === 123);
168
+ *
169
+ * assert.isTrue(belowRange === Number.MIN_SAFE_INTEGER);
159
170
  * ```
160
171
  *
161
172
  * @param value The number to clamp.
@@ -173,11 +184,14 @@ 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
- * assert.ok(SafeInt.is(randomValue));
180
- * assert.ok(randomValue >= -10 && randomValue <= 10);
192
+ * assert.isTrue(SafeInt.is(randomValue));
193
+ *
194
+ * assert.isTrue(randomValue >= -10 && randomValue <= 10);
181
195
  * ```
182
196
  *
183
197
  * @param min - The minimum value (inclusive)
@@ -192,11 +206,14 @@ 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
- * assert(power === 243);
199
- * assert.ok(SafeInt.is(power));
214
+ * assert.isTrue(power === 243);
215
+ *
216
+ * assert.isTrue(SafeInt.is(power));
200
217
  * ```
201
218
  *
202
219
  * @param a The base SafeInt.
@@ -212,8 +229,9 @@ const SafeInt = {
212
229
  * ```ts
213
230
  * const sum = SafeInt.add(asSafeInt(9), asSafeInt(4));
214
231
  *
215
- * assert(sum === 13);
216
- * assert.ok(SafeInt.is(sum));
232
+ * assert.isTrue(sum === 13);
233
+ *
234
+ * assert.isTrue(SafeInt.is(sum));
217
235
  * ```
218
236
  *
219
237
  * @param a The first SafeInt.
@@ -229,8 +247,9 @@ const SafeInt = {
229
247
  * ```ts
230
248
  * const difference = SafeInt.sub(asSafeInt(9), asSafeInt(14));
231
249
  *
232
- * assert(difference === -5);
233
- * assert.ok(SafeInt.is(difference));
250
+ * assert.isTrue(difference === -5);
251
+ *
252
+ * assert.isTrue(SafeInt.is(difference));
234
253
  * ```
235
254
  *
236
255
  * @param a The minuend SafeInt.
@@ -246,8 +265,9 @@ const SafeInt = {
246
265
  * ```ts
247
266
  * const product = SafeInt.mul(asSafeInt(-8), asSafeInt(7));
248
267
  *
249
- * assert(product === -56);
250
- * assert.ok(SafeInt.is(product));
268
+ * assert.isTrue(product === -56);
269
+ *
270
+ * assert.isTrue(SafeInt.is(product));
251
271
  * ```
252
272
  *
253
273
  * @param a The first SafeInt.
@@ -266,8 +286,9 @@ const SafeInt = {
266
286
  * ```ts
267
287
  * const quotient = SafeInt.div(asSafeInt(-17), asSafeInt(5));
268
288
  *
269
- * assert(quotient === -4);
270
- * assert.ok(SafeInt.is(quotient));
289
+ * assert.isTrue(quotient === -4);
290
+ *
291
+ * assert.isTrue(SafeInt.is(quotient));
271
292
  * ```
272
293
  *
273
294
  * @param a - The dividend
@@ -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
  });
@@ -4,9 +4,11 @@
4
4
  * @example
5
5
  *
6
6
  * ```ts
7
- * assert.ok(isUint(4));
8
- * assert.notOk(isUint(-1));
9
- * assert.ok(Uint.is(0));
7
+ * assert.isTrue(isUint(4));
8
+ *
9
+ * assert.isFalse(isUint(-1));
10
+ *
11
+ * assert.isTrue(Uint.is(0));
10
12
  * ```
11
13
  *
12
14
  * @param value The value to check.
@@ -21,8 +23,9 @@ export declare const isUint: (a: number) => a is NonNegativeInt;
21
23
  * ```ts
22
24
  * const branded = asUint(12);
23
25
  *
24
- * assert(branded === 12);
25
- * assert.ok(Uint.is(branded));
26
+ * assert.isTrue(branded === 12);
27
+ *
28
+ * assert.isTrue(Uint.is(branded));
26
29
  * ```
27
30
  *
28
31
  * @param value The value to cast.
@@ -55,9 +58,11 @@ export declare const Uint: {
55
58
  * @example
56
59
  *
57
60
  * ```ts
58
- * assert.ok(isUint(4));
59
- * assert.notOk(isUint(-1));
60
- * assert.ok(Uint.is(0));
61
+ * assert.isTrue(isUint(4));
62
+ *
63
+ * assert.isFalse(isUint(-1));
64
+ *
65
+ * assert.isTrue(Uint.is(0));
61
66
  * ```
62
67
  *
63
68
  * @param value The value to check.
@@ -79,7 +84,7 @@ export declare const Uint: {
79
84
  * ```ts
80
85
  * const smallest = Uint.min(asUint(7), asUint(3));
81
86
  *
82
- * assert(smallest === 3);
87
+ * assert.isTrue(smallest === 3);
83
88
  * ```
84
89
  *
85
90
  * @param a The first Uint.
@@ -95,7 +100,7 @@ export declare const Uint: {
95
100
  * ```ts
96
101
  * const largest = Uint.max(asUint(7), asUint(3));
97
102
  *
98
- * assert(largest === 7);
103
+ * assert.isTrue(largest === 7);
99
104
  * ```
100
105
  *
101
106
  * @param a The first Uint.
@@ -110,10 +115,12 @@ 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
- * assert(clampedNegative === 0);
116
- * assert(clampedPositive === 42);
121
+ * assert.isTrue(clampedNegative === 0);
122
+ *
123
+ * assert.isTrue(clampedPositive === 42);
117
124
  * ```
118
125
  *
119
126
  * @param value The number to clamp.
@@ -127,11 +134,14 @@ 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
- * assert.ok(Uint.is(randomValue));
134
- * assert.ok(randomValue >= 0 && randomValue <= 3);
142
+ * assert.isTrue(Uint.is(randomValue));
143
+ *
144
+ * assert.isTrue(randomValue >= 0 && randomValue <= 3);
135
145
  * ```
136
146
  *
137
147
  * @returns A random non-negative integer as a Uint.
@@ -144,10 +154,12 @@ 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
- * assert(power === 32);
162
+ * assert.isTrue(power === 32);
151
163
  * ```
152
164
  *
153
165
  * @param a The base Uint.
@@ -163,7 +175,7 @@ export declare const Uint: {
163
175
  * ```ts
164
176
  * const sum = Uint.add(asUint(5), asUint(8));
165
177
  *
166
- * assert(sum === 13);
178
+ * assert.isTrue(sum === 13);
167
179
  * ```
168
180
  *
169
181
  * @param a The first Uint.
@@ -179,7 +191,7 @@ export declare const Uint: {
179
191
  * ```ts
180
192
  * const difference = Uint.sub(asUint(5), asUint(8));
181
193
  *
182
- * assert(difference === 0);
194
+ * assert.isTrue(difference === 0);
183
195
  * ```
184
196
  *
185
197
  * @param a The minuend Uint.
@@ -195,7 +207,7 @@ export declare const Uint: {
195
207
  * ```ts
196
208
  * const product = Uint.mul(asUint(7), asUint(6));
197
209
  *
198
- * assert(product === 42);
210
+ * assert.isTrue(product === 42);
199
211
  * ```
200
212
  *
201
213
  * @param a The first Uint.
@@ -211,7 +223,7 @@ export declare const Uint: {
211
223
  * ```ts
212
224
  * const quotient = Uint.div(asUint(10), asUint(4));
213
225
  *
214
- * assert(quotient === 2);
226
+ * assert.isTrue(quotient === 2);
215
227
  * ```
216
228
  *
217
229
  * @param a The dividend Uint.
@@ -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"}
@@ -13,9 +13,11 @@ const { MIN_VALUE, add, castType, clamp, div, is, max: max_, min: min_, mul, pow
13
13
  * @example
14
14
  *
15
15
  * ```ts
16
- * assert.ok(isUint(4));
17
- * assert.notOk(isUint(-1));
18
- * assert.ok(Uint.is(0));
16
+ * assert.isTrue(isUint(4));
17
+ *
18
+ * assert.isFalse(isUint(-1));
19
+ *
20
+ * assert.isTrue(Uint.is(0));
19
21
  * ```
20
22
  *
21
23
  * @param value The value to check.
@@ -30,8 +32,9 @@ const isUint = is;
30
32
  * ```ts
31
33
  * const branded = asUint(12);
32
34
  *
33
- * assert(branded === 12);
34
- * assert.ok(Uint.is(branded));
35
+ * assert.isTrue(branded === 12);
36
+ *
37
+ * assert.isTrue(Uint.is(branded));
35
38
  * ```
36
39
  *
37
40
  * @param value The value to cast.
@@ -53,9 +56,11 @@ const Uint = {
53
56
  * @example
54
57
  *
55
58
  * ```ts
56
- * assert.ok(isUint(4));
57
- * assert.notOk(isUint(-1));
58
- * assert.ok(Uint.is(0));
59
+ * assert.isTrue(isUint(4));
60
+ *
61
+ * assert.isFalse(isUint(-1));
62
+ *
63
+ * assert.isTrue(Uint.is(0));
59
64
  * ```
60
65
  *
61
66
  * @param value The value to check.
@@ -77,7 +82,7 @@ const Uint = {
77
82
  * ```ts
78
83
  * const smallest = Uint.min(asUint(7), asUint(3));
79
84
  *
80
- * assert(smallest === 3);
85
+ * assert.isTrue(smallest === 3);
81
86
  * ```
82
87
  *
83
88
  * @param a The first Uint.
@@ -93,7 +98,7 @@ const Uint = {
93
98
  * ```ts
94
99
  * const largest = Uint.max(asUint(7), asUint(3));
95
100
  *
96
- * assert(largest === 7);
101
+ * assert.isTrue(largest === 7);
97
102
  * ```
98
103
  *
99
104
  * @param a The first Uint.
@@ -108,10 +113,12 @@ 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
- * assert(clampedNegative === 0);
114
- * assert(clampedPositive === 42);
119
+ * assert.isTrue(clampedNegative === 0);
120
+ *
121
+ * assert.isTrue(clampedPositive === 42);
115
122
  * ```
116
123
  *
117
124
  * @param value The number to clamp.
@@ -125,11 +132,14 @@ 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
- * assert.ok(Uint.is(randomValue));
132
- * assert.ok(randomValue >= 0 && randomValue <= 3);
140
+ * assert.isTrue(Uint.is(randomValue));
141
+ *
142
+ * assert.isTrue(randomValue >= 0 && randomValue <= 3);
133
143
  * ```
134
144
  *
135
145
  * @returns A random non-negative integer as a Uint.
@@ -142,10 +152,12 @@ 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
- * assert(power === 32);
160
+ * assert.isTrue(power === 32);
149
161
  * ```
150
162
  *
151
163
  * @param a The base Uint.
@@ -161,7 +173,7 @@ const Uint = {
161
173
  * ```ts
162
174
  * const sum = Uint.add(asUint(5), asUint(8));
163
175
  *
164
- * assert(sum === 13);
176
+ * assert.isTrue(sum === 13);
165
177
  * ```
166
178
  *
167
179
  * @param a The first Uint.
@@ -177,7 +189,7 @@ const Uint = {
177
189
  * ```ts
178
190
  * const difference = Uint.sub(asUint(5), asUint(8));
179
191
  *
180
- * assert(difference === 0);
192
+ * assert.isTrue(difference === 0);
181
193
  * ```
182
194
  *
183
195
  * @param a The minuend Uint.
@@ -193,7 +205,7 @@ const Uint = {
193
205
  * ```ts
194
206
  * const product = Uint.mul(asUint(7), asUint(6));
195
207
  *
196
- * assert(product === 42);
208
+ * assert.isTrue(product === 42);
197
209
  * ```
198
210
  *
199
211
  * @param a The first Uint.
@@ -209,7 +221,7 @@ const Uint = {
209
221
  * ```ts
210
222
  * const quotient = Uint.div(asUint(10), asUint(4));
211
223
  *
212
- * assert(quotient === 2);
224
+ * assert.isTrue(quotient === 2);
213
225
  * ```
214
226
  *
215
227
  * @param a The dividend Uint.
@@ -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;;;;;"}
@@ -24,7 +24,7 @@ export declare namespace Num {
24
24
  *
25
25
  * const result = Num.from(input);
26
26
  *
27
- * assert(result === 123.45);
27
+ * assert.isTrue(result === 123.45);
28
28
  * ```
29
29
  *
30
30
  * @param n The value to convert.
@@ -47,10 +47,11 @@ export declare namespace Num {
47
47
  * // Safe to divide now that we know value is non-zero
48
48
  * // eslint-disable-next-line total-functions/no-partial-division
49
49
  * const inverted = 1 / value;
50
- * assert(inverted === 0.2);
50
+ *
51
+ * assert.isTrue(inverted === 0.2);
51
52
  * }
52
53
  *
53
- * assert.notOk(Num.isNonZero(0));
54
+ * assert.isFalse(Num.isNonZero(0));
54
55
  * ```
55
56
  *
56
57
  * @template N - The numeric literal type or number type to check
@@ -73,10 +74,11 @@ export declare namespace Num {
73
74
  *
74
75
  * if (Num.isNonNegative(candidate)) {
75
76
  * const index: number = candidate;
76
- * assert(index === 10);
77
+ *
78
+ * assert.isTrue(index === 10);
77
79
  * }
78
80
  *
79
- * assert.notOk(Num.isNonNegative(-1));
81
+ * assert.isFalse(Num.isNonNegative(-1));
80
82
  * ```
81
83
  *
82
84
  * @template N - The numeric literal type or number type to check
@@ -97,10 +99,10 @@ export declare namespace Num {
97
99
  * const amount = 42;
98
100
  *
99
101
  * if (Num.isPositive(amount)) {
100
- * assert.ok(amount > 0);
102
+ * assert.isTrue(amount > 0);
101
103
  * }
102
104
  *
103
- * assert.notOk(Num.isPositive(0));
105
+ * assert.isFalse(Num.isPositive(0));
104
106
  * ```
105
107
  *
106
108
  * @template N - The numeric literal type or number type to check
@@ -117,8 +119,9 @@ export declare namespace Num {
117
119
  * ```ts
118
120
  * const isGrade = Num.isInRange(0, 100);
119
121
  *
120
- * assert.ok(isGrade(50));
121
- * assert.notOk(isGrade(100));
122
+ * assert.isTrue(isGrade(50));
123
+ *
124
+ * assert.isFalse(isGrade(100));
122
125
  * ```
123
126
  *
124
127
  * @param lowerBound The lower bound (inclusive).
@@ -136,8 +139,9 @@ export declare namespace Num {
136
139
  * ```ts
137
140
  * const isPercentage = Num.isInRangeInclusive(0, 100);
138
141
  *
139
- * assert.ok(isPercentage(100));
140
- * assert.notOk(isPercentage(-1));
142
+ * assert.isTrue(isPercentage(100));
143
+ *
144
+ * assert.isFalse(isPercentage(-1));
141
145
  * ```
142
146
  *
143
147
  * @param lowerBound The lower bound (inclusive).
@@ -189,9 +193,11 @@ export declare namespace Num {
189
193
  * ```ts
190
194
  * const indexGuard = Num.isUintInRange(0, 5);
191
195
  *
192
- * assert.ok(indexGuard(3));
193
- * assert.notOk(indexGuard(5));
194
- * assert.notOk(indexGuard(-1));
196
+ * assert.isTrue(indexGuard(3));
197
+ *
198
+ * assert.isFalse(indexGuard(5));
199
+ *
200
+ * assert.isFalse(indexGuard(-1));
195
201
  * ```
196
202
  *
197
203
  * @template L - The lower bound as a SmallUint literal type
@@ -219,8 +225,9 @@ export declare namespace Num {
219
225
  * ```ts
220
226
  * const inclusiveGuard = Num.isUintInRangeInclusive(0, 5);
221
227
  *
222
- * assert.ok(inclusiveGuard(5));
223
- * assert.notOk(inclusiveGuard(6));
228
+ * assert.isTrue(inclusiveGuard(5));
229
+ *
230
+ * assert.isFalse(inclusiveGuard(6));
224
231
  * ```
225
232
  *
226
233
  * @template L - The lower bound as a SmallUint literal type
@@ -243,13 +250,15 @@ export declare namespace Num {
243
250
  * @example
244
251
  *
245
252
  * ```ts
246
- * assert(Num.clamp(150, 0, 100) === 100);
247
- * assert(Num.clamp(-50, 0, 100) === 0);
253
+ * assert.isTrue(Num.clamp(150, 0, 100) === 100);
254
+ *
255
+ * assert.isTrue(Num.clamp(-50, 0, 100) === 0);
248
256
  *
249
257
  * const clampToPercentage = Num.clamp(0, 100);
250
258
  *
251
- * assert(clampToPercentage(75) === 75);
252
- * assert(clampToPercentage(150) === 100);
259
+ * assert.isTrue(clampToPercentage(75) === 75);
260
+ *
261
+ * assert.isTrue(clampToPercentage(150) === 100);
253
262
  * ```
254
263
  */
255
264
  export function clamp(target: number, lowerBound: number, upperBound: number): number;
@@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