ts-data-forge 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (532) hide show
  1. package/README.md +55 -6
  2. package/dist/array/impl/array-utils-creation.d.mts +14 -0
  3. package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
  4. package/dist/array/impl/array-utils-creation.mjs +12 -0
  5. package/dist/array/impl/array-utils-creation.mjs.map +1 -1
  6. package/dist/array/impl/array-utils-element-access.d.mts +10 -0
  7. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-element-access.mjs +7 -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 +1 -0
  13. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  14. package/dist/array/impl/array-utils-reducing-value.d.mts +26 -2
  15. package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
  16. package/dist/array/impl/array-utils-reducing-value.mjs +2 -1
  17. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  18. package/dist/array/impl/array-utils-search.d.mts +30 -0
  19. package/dist/array/impl/array-utils-search.d.mts.map +1 -1
  20. package/dist/array/impl/array-utils-search.mjs +1 -0
  21. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  22. package/dist/array/impl/array-utils-set-op.d.mts +13 -0
  23. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  24. package/dist/array/impl/array-utils-set-op.mjs +13 -0
  25. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  26. package/dist/array/impl/array-utils-size.d.mts +3 -0
  27. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  28. package/dist/array/impl/array-utils-size.mjs +3 -0
  29. package/dist/array/impl/array-utils-size.mjs.map +1 -1
  30. package/dist/array/impl/array-utils-slice-clamped.d.mts +2 -0
  31. package/dist/array/impl/array-utils-slice-clamped.d.mts.map +1 -1
  32. package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
  33. package/dist/array/impl/array-utils-slicing.d.mts +15 -0
  34. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  35. package/dist/array/impl/array-utils-slicing.mjs +7 -0
  36. package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
  37. package/dist/array/impl/array-utils-transformation.d.mts +27 -0
  38. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  39. package/dist/array/impl/array-utils-transformation.mjs +7 -0
  40. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  41. package/dist/array/impl/array-utils-validation.d.mts +17 -0
  42. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  43. package/dist/array/impl/array-utils-validation.mjs +11 -0
  44. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  45. package/dist/collections/imap-mapped.mjs +1 -0
  46. package/dist/collections/imap-mapped.mjs.map +1 -1
  47. package/dist/collections/imap.d.mts +20 -0
  48. package/dist/collections/imap.d.mts.map +1 -1
  49. package/dist/collections/imap.mjs +3 -0
  50. package/dist/collections/imap.mjs.map +1 -1
  51. package/dist/collections/iset-mapped.d.mts +27 -0
  52. package/dist/collections/iset-mapped.d.mts.map +1 -1
  53. package/dist/collections/iset-mapped.mjs +7 -0
  54. package/dist/collections/iset-mapped.mjs.map +1 -1
  55. package/dist/collections/iset.d.mts +29 -0
  56. package/dist/collections/iset.d.mts.map +1 -1
  57. package/dist/collections/iset.mjs +7 -0
  58. package/dist/collections/iset.mjs.map +1 -1
  59. package/dist/collections/queue.d.mts +40 -0
  60. package/dist/collections/queue.d.mts.map +1 -1
  61. package/dist/collections/queue.mjs +9 -0
  62. package/dist/collections/queue.mjs.map +1 -1
  63. package/dist/collections/stack.d.mts +35 -0
  64. package/dist/collections/stack.d.mts.map +1 -1
  65. package/dist/collections/stack.mjs +8 -0
  66. package/dist/collections/stack.mjs.map +1 -1
  67. package/dist/entry-point.mjs +1 -1
  68. package/dist/functional/match.d.mts.map +1 -1
  69. package/dist/functional/match.mjs.map +1 -1
  70. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +1 -0
  71. package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -1
  72. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  73. package/dist/functional/optional/impl/optional-filter.d.mts +3 -0
  74. package/dist/functional/optional/impl/optional-filter.d.mts.map +1 -1
  75. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  76. package/dist/functional/optional/impl/optional-flat-map.d.mts +2 -0
  77. package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -1
  78. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  79. package/dist/functional/optional/impl/optional-from-nullable.d.mts +2 -0
  80. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  81. package/dist/functional/optional/impl/optional-from-nullable.mjs +2 -0
  82. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  83. package/dist/functional/optional/impl/optional-is-optional.d.mts +2 -0
  84. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  85. package/dist/functional/optional/impl/optional-is-optional.mjs +2 -0
  86. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  87. package/dist/functional/optional/impl/optional-is-some.d.mts +1 -0
  88. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  89. package/dist/functional/optional/impl/optional-is-some.mjs +1 -0
  90. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  91. package/dist/functional/optional/impl/optional-map.d.mts +2 -0
  92. package/dist/functional/optional/impl/optional-map.d.mts.map +1 -1
  93. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  94. package/dist/functional/optional/impl/optional-none.d.mts +2 -0
  95. package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
  96. package/dist/functional/optional/impl/optional-none.mjs +2 -0
  97. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  98. package/dist/functional/optional/impl/optional-or-else.d.mts +4 -0
  99. package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -1
  100. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  101. package/dist/functional/optional/impl/optional-some.d.mts +3 -1
  102. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  103. package/dist/functional/optional/impl/optional-some.mjs +2 -0
  104. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  105. package/dist/functional/optional/impl/optional-to-nullable.d.mts +2 -0
  106. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  107. package/dist/functional/optional/impl/optional-to-nullable.mjs +2 -0
  108. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  109. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +3 -0
  110. package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +1 -1
  111. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  112. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +1 -0
  113. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  114. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +1 -0
  115. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  116. package/dist/functional/optional/impl/optional-unwrap.d.mts +2 -0
  117. package/dist/functional/optional/impl/optional-unwrap.d.mts.map +1 -1
  118. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  119. package/dist/functional/optional/impl/optional-zip.d.mts +2 -0
  120. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  121. package/dist/functional/optional/impl/optional-zip.mjs +2 -0
  122. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  123. package/dist/functional/result/impl/result-err.d.mts +3 -1
  124. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  125. package/dist/functional/result/impl/result-err.mjs +2 -0
  126. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  127. package/dist/functional/result/impl/result-expect-to-be.d.mts +1 -0
  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 +3 -0
  137. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  138. package/dist/functional/result/impl/result-from-promise.mjs +3 -0
  139. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  140. package/dist/functional/result/impl/result-from-throwable.d.mts +2 -0
  141. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  142. package/dist/functional/result/impl/result-from-throwable.mjs +4 -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 +2 -0
  145. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  146. package/dist/functional/result/impl/result-is-err.mjs +2 -0
  147. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  148. package/dist/functional/result/impl/result-is-ok.d.mts +2 -0
  149. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  150. package/dist/functional/result/impl/result-is-ok.mjs +2 -0
  151. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  152. package/dist/functional/result/impl/result-is-result.d.mts +4 -0
  153. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  154. package/dist/functional/result/impl/result-is-result.mjs +4 -0
  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 +3 -1
  163. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  164. package/dist/functional/result/impl/result-ok.mjs +2 -0
  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 +3 -0
  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 +2 -0
  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 +2 -0
  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 +1 -0
  185. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  186. package/dist/functional/result/impl/result-unwrap-err.mjs +1 -0
  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 +3 -0
  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 +1 -0
  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 +2 -0
  195. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  196. package/dist/functional/result/impl/result-unwrap-throw.mjs +2 -0
  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 +2 -1
  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 +1 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +4 -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 +4 -0
  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 +4 -0
  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 +10 -0
  294. package/dist/guard/index.mjs +1 -1
  295. package/dist/guard/is-record.d.mts +31 -0
  296. package/dist/guard/is-record.d.mts.map +1 -1
  297. package/dist/guard/is-record.mjs +32 -1
  298. package/dist/guard/is-record.mjs.map +1 -1
  299. package/dist/guard/is-type.d.mts +3 -0
  300. package/dist/guard/is-type.d.mts.map +1 -1
  301. package/dist/guard/is-type.mjs +3 -0
  302. package/dist/guard/is-type.mjs.map +1 -1
  303. package/dist/guard/key-is-in.d.mts +1 -0
  304. package/dist/guard/key-is-in.d.mts.map +1 -1
  305. package/dist/guard/key-is-in.mjs +1 -0
  306. package/dist/guard/key-is-in.mjs.map +1 -1
  307. package/dist/index.mjs +1 -1
  308. package/dist/iterator/range.d.mts +4 -0
  309. package/dist/iterator/range.d.mts.map +1 -1
  310. package/dist/iterator/range.mjs +1 -0
  311. package/dist/iterator/range.mjs.map +1 -1
  312. package/dist/json/json.d.mts +21 -0
  313. package/dist/json/json.d.mts.map +1 -1
  314. package/dist/json/json.mjs +22 -0
  315. package/dist/json/json.mjs.map +1 -1
  316. package/dist/number/branded-types/int.d.mts +14 -0
  317. package/dist/number/branded-types/int.d.mts.map +1 -1
  318. package/dist/number/branded-types/int.mjs +14 -0
  319. package/dist/number/branded-types/int.mjs.map +1 -1
  320. package/dist/number/branded-types/non-zero-safe-int.mjs +2 -2
  321. package/dist/number/branded-types/positive-int.d.mts +14 -0
  322. package/dist/number/branded-types/positive-int.d.mts.map +1 -1
  323. package/dist/number/branded-types/positive-int.mjs +14 -0
  324. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  325. package/dist/number/branded-types/positive-safe-int.d.mts +21 -0
  326. package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
  327. package/dist/number/branded-types/positive-safe-int.mjs +22 -1
  328. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  329. package/dist/number/branded-types/safe-int.d.mts +21 -0
  330. package/dist/number/branded-types/safe-int.d.mts.map +1 -1
  331. package/dist/number/branded-types/safe-int.mjs +23 -2
  332. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  333. package/dist/number/branded-types/safe-uint.mjs +1 -1
  334. package/dist/number/branded-types/uint.d.mts +12 -0
  335. package/dist/number/branded-types/uint.d.mts.map +1 -1
  336. package/dist/number/branded-types/uint.mjs +12 -0
  337. package/dist/number/branded-types/uint.mjs.map +1 -1
  338. package/dist/number/num.d.mts +9 -0
  339. package/dist/number/num.d.mts.map +1 -1
  340. package/dist/number/num.mjs +8 -1
  341. package/dist/number/num.mjs.map +1 -1
  342. package/dist/number/refined-number-utils.d.mts +22 -0
  343. package/dist/number/refined-number-utils.d.mts.map +1 -1
  344. package/dist/number/refined-number-utils.mjs +23 -0
  345. package/dist/number/refined-number-utils.mjs.map +1 -1
  346. package/dist/object/object.d.mts +9 -0
  347. package/dist/object/object.d.mts.map +1 -1
  348. package/dist/object/object.mjs +7 -0
  349. package/dist/object/object.mjs.map +1 -1
  350. package/dist/others/map-nullable.mjs.map +1 -1
  351. package/dist/others/tuple.d.mts +11 -0
  352. package/dist/others/tuple.d.mts.map +1 -1
  353. package/dist/others/tuple.mjs +11 -0
  354. package/dist/others/tuple.mjs.map +1 -1
  355. package/dist/others/unknown-to-string.d.mts.map +1 -1
  356. package/dist/others/unknown-to-string.mjs +2 -1
  357. package/dist/others/unknown-to-string.mjs.map +1 -1
  358. package/dist/promise/promise.d.mts +4 -0
  359. package/dist/promise/promise.d.mts.map +1 -1
  360. package/dist/promise/promise.mjs +5 -0
  361. package/dist/promise/promise.mjs.map +1 -1
  362. package/package.json +20 -24
  363. package/src/array/impl/array-utils-creation.mts +20 -0
  364. package/src/array/impl/array-utils-creation.test.mts +71 -0
  365. package/src/array/impl/array-utils-element-access.mts +13 -0
  366. package/src/array/impl/array-utils-element-access.test.mts +21 -0
  367. package/src/array/impl/array-utils-iterators.test.mts +17 -0
  368. package/src/array/impl/array-utils-modification.mts +40 -0
  369. package/src/array/impl/array-utils-modification.test.mts +75 -0
  370. package/src/array/impl/array-utils-overload-type-error.test.mts +19 -0
  371. package/src/array/impl/array-utils-reducing-value.mts +55 -9
  372. package/src/array/impl/array-utils-reducing-value.test.mts +90 -0
  373. package/src/array/impl/array-utils-search.mts +53 -0
  374. package/src/array/impl/array-utils-search.test.mts +51 -0
  375. package/src/array/impl/array-utils-set-op.mts +19 -0
  376. package/src/array/impl/array-utils-set-op.test.mts +116 -0
  377. package/src/array/impl/array-utils-size.mts +3 -0
  378. package/src/array/impl/array-utils-size.test.mts +1 -0
  379. package/src/array/impl/array-utils-slice-clamped.mts +7 -0
  380. package/src/array/impl/array-utils-slice-clamped.test.mts +20 -0
  381. package/src/array/impl/array-utils-slicing.mts +27 -0
  382. package/src/array/impl/array-utils-slicing.test.mts +57 -0
  383. package/src/array/impl/array-utils-transformation.mts +58 -0
  384. package/src/array/impl/array-utils-transformation.test.mts +113 -1
  385. package/src/array/impl/array-utils-validation.mts +23 -0
  386. package/src/array/impl/array-utils-validation.test.mts +96 -0
  387. package/src/array/impl/array.test.mts +12 -0
  388. package/src/collections/imap-mapped.mts +11 -0
  389. package/src/collections/imap-mapped.test.mts +70 -0
  390. package/src/collections/imap.mts +32 -0
  391. package/src/collections/imap.test.mts +106 -0
  392. package/src/collections/iset-mapped.mts +35 -0
  393. package/src/collections/iset-mapped.test.mts +111 -0
  394. package/src/collections/iset.mts +34 -0
  395. package/src/collections/iset.test.mts +193 -0
  396. package/src/collections/queue.mts +53 -0
  397. package/src/collections/queue.test.mts +32 -0
  398. package/src/collections/stack.mts +42 -0
  399. package/src/collections/stack.test.mts +44 -0
  400. package/src/functional/match.mts +16 -0
  401. package/src/functional/match.test.mts +2 -0
  402. package/src/functional/optional/impl/optional-expect-to-be.mts +3 -0
  403. package/src/functional/optional/impl/optional-filter.mts +6 -0
  404. package/src/functional/optional/impl/optional-flat-map.mts +4 -0
  405. package/src/functional/optional/impl/optional-from-nullable.mts +2 -0
  406. package/src/functional/optional/impl/optional-is-optional.mts +2 -0
  407. package/src/functional/optional/impl/optional-is-some.mts +1 -0
  408. package/src/functional/optional/impl/optional-map.mts +5 -0
  409. package/src/functional/optional/impl/optional-none.mts +2 -0
  410. package/src/functional/optional/impl/optional-or-else.mts +6 -0
  411. package/src/functional/optional/impl/optional-some.mts +3 -1
  412. package/src/functional/optional/impl/optional-to-nullable.mts +2 -0
  413. package/src/functional/optional/impl/optional-unwrap-or.mts +5 -0
  414. package/src/functional/optional/impl/optional-unwrap-throw.mts +1 -0
  415. package/src/functional/optional/impl/optional-unwrap.mts +2 -0
  416. package/src/functional/optional/impl/optional-zip.mts +2 -0
  417. package/src/functional/optional.test.mts +73 -0
  418. package/src/functional/pipe.test.mts +3 -0
  419. package/src/functional/result/impl/result-err.mts +3 -1
  420. package/src/functional/result/impl/result-expect-to-be.mts +3 -0
  421. package/src/functional/result/impl/result-flat-map.mts +7 -0
  422. package/src/functional/result/impl/result-fold.mts +6 -0
  423. package/src/functional/result/impl/result-from-promise.mts +3 -0
  424. package/src/functional/result/impl/result-from-throwable.mts +6 -1
  425. package/src/functional/result/impl/result-is-err.mts +2 -0
  426. package/src/functional/result/impl/result-is-ok.mts +2 -0
  427. package/src/functional/result/impl/result-is-result.mts +4 -0
  428. package/src/functional/result/impl/result-map-err.mts +5 -0
  429. package/src/functional/result/impl/result-map.mts +6 -0
  430. package/src/functional/result/impl/result-ok.mts +3 -1
  431. package/src/functional/result/impl/result-or-else.mts +6 -0
  432. package/src/functional/result/impl/result-swap.mts +2 -0
  433. package/src/functional/result/impl/result-to-optional.mts +2 -0
  434. package/src/functional/result/impl/result-unwrap-err-or.mts +5 -0
  435. package/src/functional/result/impl/result-unwrap-err-throw.mts +2 -0
  436. package/src/functional/result/impl/result-unwrap-err.mts +1 -0
  437. package/src/functional/result/impl/result-unwrap-ok-or.mts +5 -0
  438. package/src/functional/result/impl/result-unwrap-ok.mts +2 -0
  439. package/src/functional/result/impl/result-unwrap-throw.mts +2 -0
  440. package/src/functional/result/impl/result-zip.mts +3 -1
  441. package/src/functional/result.test.mts +88 -0
  442. package/src/functional/ternary-result/impl/ternary-result-err.mts +2 -1
  443. package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +4 -0
  444. package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +7 -0
  445. package/src/functional/ternary-result/impl/ternary-result-fold.mts +5 -0
  446. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +2 -0
  447. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +5 -1
  448. package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +1 -0
  449. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +4 -0
  450. package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +1 -0
  451. package/src/functional/ternary-result/impl/ternary-result-map-err.mts +6 -0
  452. package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +6 -0
  453. package/src/functional/ternary-result/impl/ternary-result-map.mts +9 -0
  454. package/src/functional/ternary-result/impl/ternary-result-ok.mts +1 -1
  455. package/src/functional/ternary-result/impl/ternary-result-or-else.mts +5 -0
  456. package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +2 -0
  457. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +5 -0
  458. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +1 -0
  459. package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +2 -0
  460. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +5 -0
  461. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +3 -0
  462. package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +1 -0
  463. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +5 -0
  464. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +1 -0
  465. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +2 -0
  466. package/src/functional/ternary-result/impl/ternary-result-warn.mts +4 -1
  467. package/src/functional/ternary-result/impl/ternary-result-zip.mts +4 -0
  468. package/src/functional/ternary-result.test.mts +91 -0
  469. package/src/globals.d.mts +10 -0
  470. package/src/guard/has-key.test.mts +9 -0
  471. package/src/guard/is-non-empty-string.test.mts +20 -0
  472. package/src/guard/is-non-null-object.test.mts +19 -0
  473. package/src/guard/is-primitive.test.mts +23 -0
  474. package/src/guard/is-record.mts +34 -0
  475. package/src/guard/is-record.test.mts +21 -0
  476. package/src/guard/is-type.mts +3 -0
  477. package/src/guard/is-type.test.mts +134 -0
  478. package/src/guard/key-is-in.mts +1 -0
  479. package/src/iterator/range.mts +9 -0
  480. package/src/json/json.mts +29 -0
  481. package/src/json/json.test.mts +87 -0
  482. package/src/number/branded-types/finite-number.test.mts +38 -0
  483. package/src/number/branded-types/int.mts +14 -0
  484. package/src/number/branded-types/int.test.mts +42 -0
  485. package/src/number/branded-types/int16.test.mts +47 -0
  486. package/src/number/branded-types/int32.test.mts +47 -0
  487. package/src/number/branded-types/non-negative-finite-number.test.mts +40 -0
  488. package/src/number/branded-types/non-negative-int16.test.mts +43 -0
  489. package/src/number/branded-types/non-negative-int32.test.mts +43 -0
  490. package/src/number/branded-types/non-zero-finite-number.test.mts +51 -0
  491. package/src/number/branded-types/non-zero-int.test.mts +53 -0
  492. package/src/number/branded-types/non-zero-int16.test.mts +44 -0
  493. package/src/number/branded-types/non-zero-int32.test.mts +44 -0
  494. package/src/number/branded-types/non-zero-safe-int.mts +2 -2
  495. package/src/number/branded-types/non-zero-safe-int.test.mts +62 -0
  496. package/src/number/branded-types/non-zero-uint16.test.mts +37 -0
  497. package/src/number/branded-types/non-zero-uint32.test.mts +37 -0
  498. package/src/number/branded-types/positive-finite-number.test.mts +45 -0
  499. package/src/number/branded-types/positive-int.mts +14 -0
  500. package/src/number/branded-types/positive-int.test.mts +47 -0
  501. package/src/number/branded-types/positive-int16.test.mts +35 -0
  502. package/src/number/branded-types/positive-int32.test.mts +35 -0
  503. package/src/number/branded-types/positive-safe-int.mts +22 -1
  504. package/src/number/branded-types/positive-safe-int.test.mts +49 -0
  505. package/src/number/branded-types/positive-uint16.test.mts +37 -0
  506. package/src/number/branded-types/positive-uint32.test.mts +37 -0
  507. package/src/number/branded-types/safe-int.mts +23 -2
  508. package/src/number/branded-types/safe-int.test.mts +52 -0
  509. package/src/number/branded-types/safe-uint.mts +1 -1
  510. package/src/number/branded-types/safe-uint.test.mts +48 -0
  511. package/src/number/branded-types/uint.mts +12 -0
  512. package/src/number/branded-types/uint.test.mts +43 -0
  513. package/src/number/branded-types/uint16.test.mts +41 -0
  514. package/src/number/branded-types/uint32.test.mts +41 -0
  515. package/src/number/enum/int8.test.mts +6 -0
  516. package/src/number/enum/uint8.test.mts +6 -0
  517. package/src/number/num.mts +12 -1
  518. package/src/number/num.test.mts +62 -0
  519. package/src/number/refined-number-utils.mts +25 -0
  520. package/src/object/object.mts +15 -0
  521. package/src/object/object.test.mts +10 -0
  522. package/src/others/cast-mutable.test.mts +7 -0
  523. package/src/others/cast-readonly.test.mts +17 -0
  524. package/src/others/if-then.test.mts +16 -0
  525. package/src/others/map-nullable.mts +3 -0
  526. package/src/others/map-nullable.test.mts +27 -0
  527. package/src/others/memoize-function.test.mts +41 -0
  528. package/src/others/tuple.mts +11 -0
  529. package/src/others/unknown-to-string.mts +4 -1
  530. package/src/others/unknown-to-string.test.mts +10 -0
  531. package/src/promise/promise.mts +4 -0
  532. package/src/promise/promise.test.mts +1 -0
@@ -1,14 +1,18 @@
1
1
  import { ISetMapped } from './iset-mapped.mjs';
2
2
 
3
3
  const toKey = (a: Readonly<{ v: number }>): number => a.v;
4
+
4
5
  const fromKey = (k: number): Readonly<{ v: number }> => ({ v: k });
5
6
 
6
7
  // Test types for additional functionality
7
8
  type TestElement = { id: number; type: string };
9
+
8
10
  const testElementToString = (el: Readonly<TestElement>): string =>
9
11
  `${el.type}_${el.id}`;
12
+
10
13
  const stringToTestElement = (str: string): TestElement => {
11
14
  const [type, idStr] = str.split('_');
15
+
12
16
  return { type: type ?? '', id: Number(idStr ?? '0') };
13
17
  };
14
18
 
@@ -87,6 +91,7 @@ describe('ISetMapped.add', () => {
87
91
  fromKey,
88
92
  ),
89
93
  );
94
+
90
95
  assert.deepStrictEqual(
91
96
  s0,
92
97
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
@@ -104,6 +109,7 @@ describe('ISetMapped.add', () => {
104
109
  s0.add({ v: 3 }),
105
110
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
106
111
  );
112
+
107
113
  assert.deepStrictEqual(
108
114
  s0,
109
115
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
@@ -117,6 +123,7 @@ describe('ISetMapped.add', () => {
117
123
  s0.add({ v: 1 }),
118
124
  ISetMapped.create([{ v: 1 }], toKey, fromKey),
119
125
  );
126
+
120
127
  assert.deepStrictEqual(s0, ISetMapped.create([], toKey, fromKey));
121
128
  });
122
129
  });
@@ -133,6 +140,7 @@ describe('ISetMapped.delete', () => {
133
140
  s0.delete({ v: 10 }),
134
141
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
135
142
  );
143
+
136
144
  assert.deepStrictEqual(
137
145
  s0,
138
146
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
@@ -150,6 +158,7 @@ describe('ISetMapped.delete', () => {
150
158
  s0.delete({ v: 3 }),
151
159
  ISetMapped.create([{ v: 1 }, { v: 2 }], toKey, fromKey),
152
160
  );
161
+
153
162
  assert.deepStrictEqual(
154
163
  s0,
155
164
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
@@ -163,6 +172,7 @@ describe('ISetMapped.delete', () => {
163
172
  s0.delete({ v: 1 }),
164
173
  ISetMapped.create([], toKey, fromKey),
165
174
  );
175
+
166
176
  assert.deepStrictEqual(s0, ISetMapped.create([], toKey, fromKey));
167
177
  });
168
178
  });
@@ -174,6 +184,7 @@ describe('ISetMapped.forEach', () => {
174
184
  toKey,
175
185
  fromKey,
176
186
  );
187
+
177
188
  const elements = [{ v: 1 }, { v: 2 }, { v: 3 }];
178
189
 
179
190
  for (const el of s0) {
@@ -189,6 +200,7 @@ describe('ISetMapped.keys', () => {
189
200
  toKey,
190
201
  fromKey,
191
202
  );
203
+
192
204
  const elements = [{ v: 1 }, { v: 2 }, { v: 3 }];
193
205
 
194
206
  for (const k of s0.keys()) {
@@ -204,6 +216,7 @@ describe('ISetMapped.values', () => {
204
216
  toKey,
205
217
  fromKey,
206
218
  );
219
+
207
220
  const elements = [{ v: 1 }, { v: 2 }, { v: 3 }];
208
221
 
209
222
  for (const v of s0.values()) {
@@ -219,10 +232,12 @@ describe('ISetMapped.entries', () => {
219
232
  toKey,
220
233
  fromKey,
221
234
  );
235
+
222
236
  const elements = [{ v: 1 }, { v: 2 }, { v: 3 }];
223
237
 
224
238
  for (const [k, v] of s0.entries()) {
225
239
  expect(elements).toContainEqual(k);
240
+
226
241
  expect(elements).toContainEqual(v);
227
242
 
228
243
  assert.deepStrictEqual(k, v);
@@ -237,6 +252,7 @@ describe('ISetMapped.subtract', () => {
237
252
  toKey,
238
253
  fromKey,
239
254
  );
255
+
240
256
  const s1 = ISetMapped.create([{ v: 2 }, { v: 4 }], toKey, fromKey);
241
257
 
242
258
  assert.deepStrictEqual(
@@ -251,6 +267,7 @@ describe('ISetMapped.subtract', () => {
251
267
  toKey,
252
268
  fromKey,
253
269
  );
270
+
254
271
  const s1 = ISetMapped.create([], toKey, fromKey);
255
272
 
256
273
  assert.deepStrictEqual(
@@ -261,6 +278,7 @@ describe('ISetMapped.subtract', () => {
261
278
 
262
279
  test('case 3', () => {
263
280
  const s0 = ISetMapped.create([], toKey, fromKey);
281
+
264
282
  const s1 = ISetMapped.create(
265
283
  [{ v: 1 }, { v: 2 }, { v: 3 }],
266
284
  toKey,
@@ -281,6 +299,7 @@ describe('ISetMapped.diff', () => {
281
299
  toKey,
282
300
  fromKey,
283
301
  );
302
+
284
303
  const s1 = ISetMapped.create(
285
304
  [{ v: 2 }, { v: 3 }, { v: 4 }],
286
305
  toKey,
@@ -293,6 +312,7 @@ describe('ISetMapped.diff', () => {
293
312
  diff.deleted,
294
313
  ISetMapped.create([{ v: 1 }], toKey, fromKey),
295
314
  );
315
+
296
316
  assert.deepStrictEqual(
297
317
  diff.added,
298
318
  ISetMapped.create([{ v: 4 }], toKey, fromKey),
@@ -305,6 +325,7 @@ describe('ISetMapped.diff', () => {
305
325
  toKey,
306
326
  fromKey,
307
327
  );
328
+
308
329
  const s1 = ISetMapped.create([], toKey, fromKey);
309
330
 
310
331
  const diff = ISetMapped.diff(s0, s1);
@@ -313,11 +334,13 @@ describe('ISetMapped.diff', () => {
313
334
  diff.deleted,
314
335
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
315
336
  );
337
+
316
338
  assert.deepStrictEqual(diff.added, ISetMapped.create([], toKey, fromKey));
317
339
  });
318
340
 
319
341
  test('case 3', () => {
320
342
  const s0 = ISetMapped.create([], toKey, fromKey);
343
+
321
344
  const s1 = ISetMapped.create(
322
345
  [{ v: 1 }, { v: 2 }, { v: 3 }],
323
346
  toKey,
@@ -327,6 +350,7 @@ describe('ISetMapped.diff', () => {
327
350
  const diff = ISetMapped.diff(s0, s1);
328
351
 
329
352
  assert.deepStrictEqual(diff.deleted, ISetMapped.create([], toKey, fromKey));
353
+
330
354
  assert.deepStrictEqual(
331
355
  diff.added,
332
356
  ISetMapped.create([{ v: 1 }, { v: 2 }, { v: 3 }], toKey, fromKey),
@@ -341,6 +365,7 @@ describe('ISetMapped.union', () => {
341
365
  toKey,
342
366
  fromKey,
343
367
  );
368
+
344
369
  const s1 = ISetMapped.create(
345
370
  [{ v: 3 }, { v: 4 }, { v: 5 }],
346
371
  toKey,
@@ -363,6 +388,7 @@ describe('ISetMapped.union', () => {
363
388
  toKey,
364
389
  fromKey,
365
390
  );
391
+
366
392
  const s1 = ISetMapped.create([], toKey, fromKey);
367
393
 
368
394
  assert.deepStrictEqual(
@@ -373,6 +399,7 @@ describe('ISetMapped.union', () => {
373
399
 
374
400
  test('case 3', () => {
375
401
  const s0 = ISetMapped.create([], toKey, fromKey);
402
+
376
403
  const s1 = ISetMapped.create(
377
404
  [{ v: 1 }, { v: 2 }, { v: 3 }],
378
405
  toKey,
@@ -393,6 +420,7 @@ describe('ISetMapped.intersection', () => {
393
420
  toKey,
394
421
  fromKey,
395
422
  );
423
+
396
424
  const s1 = ISetMapped.create(
397
425
  [{ v: 2 }, { v: 3 }, { v: 4 }],
398
426
  toKey,
@@ -411,6 +439,7 @@ describe('ISetMapped.intersection', () => {
411
439
  toKey,
412
440
  fromKey,
413
441
  );
442
+
414
443
  const s1 = ISetMapped.create([], toKey, fromKey);
415
444
 
416
445
  assert.deepStrictEqual(
@@ -421,6 +450,7 @@ describe('ISetMapped.intersection', () => {
421
450
 
422
451
  test('case 3', () => {
423
452
  const s0 = ISetMapped.create([], toKey, fromKey);
453
+
424
454
  const s1 = ISetMapped.create(
425
455
  [{ v: 1 }, { v: 2 }, { v: 3 }],
426
456
  toKey,
@@ -457,7 +487,9 @@ describe('ISetMapped additional functionality with complex types', () => {
457
487
  );
458
488
 
459
489
  expect(set.size).toBe(2);
490
+
460
491
  expect(set.has({ id: 1, type: 'user' })).toBe(true);
492
+
461
493
  expect(set.has({ id: 2, type: 'admin' })).toBe(true);
462
494
  });
463
495
 
@@ -486,6 +518,7 @@ describe('ISetMapped additional functionality with complex types', () => {
486
518
  testElementToString,
487
519
  stringToTestElement,
488
520
  );
521
+
489
522
  const set2 = ISetMapped.create(
490
523
  [
491
524
  { id: 2, type: 'admin' },
@@ -507,6 +540,7 @@ describe('ISetMapped additional functionality with complex types', () => {
507
540
  testElementToString,
508
541
  stringToTestElement,
509
542
  );
543
+
510
544
  const set2 = ISetMapped.create(
511
545
  [
512
546
  { id: 1, type: 'user' },
@@ -525,6 +559,7 @@ describe('ISetMapped additional functionality with complex types', () => {
525
559
  testElementToString,
526
560
  stringToTestElement,
527
561
  );
562
+
528
563
  const set2 = ISetMapped.create<TestElement, string>(
529
564
  [],
530
565
  testElementToString,
@@ -546,6 +581,7 @@ describe('ISetMapped additional functionality with complex types', () => {
546
581
  testElementToString,
547
582
  stringToTestElement,
548
583
  );
584
+
549
585
  const newSet = ISetMapped.create(
550
586
  [
551
587
  { id: 2, type: 'admin' },
@@ -559,9 +595,11 @@ describe('ISetMapped additional functionality with complex types', () => {
559
595
  const diff = ISetMapped.diff(oldSet, newSet);
560
596
 
561
597
  expect(diff.deleted.size).toBe(1);
598
+
562
599
  expect(diff.deleted.has({ id: 1, type: 'user' })).toBe(true);
563
600
 
564
601
  expect(diff.added.size).toBe(1);
602
+
565
603
  expect(diff.added.has({ id: 4, type: 'user' })).toBe(true);
566
604
  });
567
605
 
@@ -574,6 +612,7 @@ describe('ISetMapped additional functionality with complex types', () => {
574
612
  testElementToString,
575
613
  stringToTestElement,
576
614
  );
615
+
577
616
  const set2 = ISetMapped.create(
578
617
  [
579
618
  { id: 1, type: 'user' },
@@ -586,6 +625,7 @@ describe('ISetMapped additional functionality with complex types', () => {
586
625
  const diff = ISetMapped.diff(set1, set2);
587
626
 
588
627
  expect(diff.deleted.size).toBe(0);
628
+
589
629
  expect(diff.added.size).toBe(0);
590
630
  });
591
631
  });
@@ -601,6 +641,7 @@ describe('ISetMapped additional functionality with complex types', () => {
601
641
  testElementToString,
602
642
  stringToTestElement,
603
643
  );
644
+
604
645
  const set2 = ISetMapped.create(
605
646
  [
606
647
  { id: 2, type: 'admin' },
@@ -614,7 +655,9 @@ describe('ISetMapped additional functionality with complex types', () => {
614
655
  const intersection = ISetMapped.intersection(set1, set2);
615
656
 
616
657
  expect(intersection.size).toBe(2);
658
+
617
659
  expect(intersection.has({ id: 2, type: 'admin' })).toBe(true);
660
+
618
661
  expect(intersection.has({ id: 3, type: 'guest' })).toBe(true);
619
662
  });
620
663
 
@@ -627,6 +670,7 @@ describe('ISetMapped additional functionality with complex types', () => {
627
670
  testElementToString,
628
671
  stringToTestElement,
629
672
  );
673
+
630
674
  const set2 = ISetMapped.create(
631
675
  [
632
676
  { id: 3, type: 'guest' },
@@ -639,9 +683,13 @@ describe('ISetMapped additional functionality with complex types', () => {
639
683
  const union = ISetMapped.union(set1, set2);
640
684
 
641
685
  expect(union.size).toBe(4);
686
+
642
687
  expect(union.has({ id: 1, type: 'user' })).toBe(true);
688
+
643
689
  expect(union.has({ id: 2, type: 'admin' })).toBe(true);
690
+
644
691
  expect(union.has({ id: 3, type: 'guest' })).toBe(true);
692
+
645
693
  expect(union.has({ id: 4, type: 'user' })).toBe(true);
646
694
  });
647
695
  });
@@ -709,10 +757,13 @@ describe('ISetMapped additional functionality with complex types', () => {
709
757
  testElementToString,
710
758
  stringToTestElement,
711
759
  );
760
+
712
761
  const updated = set.add({ id: 2, type: 'admin' });
713
762
 
714
763
  expect(updated.size).toBe(2);
764
+
715
765
  expect(updated.has({ id: 1, type: 'user' })).toBe(true);
766
+
716
767
  expect(updated.has({ id: 2, type: 'admin' })).toBe(true);
717
768
  });
718
769
 
@@ -722,6 +773,7 @@ describe('ISetMapped additional functionality with complex types', () => {
722
773
  testElementToString,
723
774
  stringToTestElement,
724
775
  );
776
+
725
777
  const updated = set.add({ id: 1, type: 'user' });
726
778
 
727
779
  expect(updated).toBe(set);
@@ -738,10 +790,13 @@ describe('ISetMapped additional functionality with complex types', () => {
738
790
  testElementToString,
739
791
  stringToTestElement,
740
792
  );
793
+
741
794
  const updated = set.delete({ id: 1, type: 'user' });
742
795
 
743
796
  expect(updated.size).toBe(1);
797
+
744
798
  expect(updated.has({ id: 1, type: 'user' })).toBe(false);
799
+
745
800
  expect(updated.has({ id: 2, type: 'admin' })).toBe(true);
746
801
  });
747
802
 
@@ -751,6 +806,7 @@ describe('ISetMapped additional functionality with complex types', () => {
751
806
  testElementToString,
752
807
  stringToTestElement,
753
808
  );
809
+
754
810
  const updated = set.delete({ id: 2, type: 'admin' });
755
811
 
756
812
  expect(updated).toBe(set);
@@ -772,8 +828,11 @@ describe('ISetMapped additional functionality with complex types', () => {
772
828
  ]);
773
829
 
774
830
  expect(updated.size).toBe(2);
831
+
775
832
  expect(updated.has({ id: 1, type: 'user' })).toBe(false);
833
+
776
834
  expect(updated.has({ id: 2, type: 'admin' })).toBe(true);
835
+
777
836
  expect(updated.has({ id: 3, type: 'guest' })).toBe(true);
778
837
  });
779
838
 
@@ -783,9 +842,11 @@ describe('ISetMapped additional functionality with complex types', () => {
783
842
  testElementToString,
784
843
  stringToTestElement,
785
844
  );
845
+
786
846
  const updated = set.withMutations([]);
787
847
 
788
848
  expect(updated.size).toBe(1);
849
+
789
850
  expect(ISetMapped.equal(set, updated)).toBe(true);
790
851
  });
791
852
  });
@@ -800,13 +861,16 @@ describe('ISetMapped additional functionality with complex types', () => {
800
861
  testElementToString,
801
862
  stringToTestElement,
802
863
  );
864
+
803
865
  const transformed = set.map((el) => ({
804
866
  ...el,
805
867
  type: el.type.toUpperCase(),
806
868
  }));
807
869
 
808
870
  expect(transformed.size).toBe(2);
871
+
809
872
  expect(transformed.has({ id: 1, type: 'USER' })).toBe(true);
873
+
810
874
  expect(transformed.has({ id: 2, type: 'ADMIN' })).toBe(true);
811
875
  });
812
876
  });
@@ -822,11 +886,15 @@ describe('ISetMapped additional functionality with complex types', () => {
822
886
  testElementToString,
823
887
  stringToTestElement,
824
888
  );
889
+
825
890
  const filtered = set.filter((el) => el.type === 'user');
826
891
 
827
892
  expect(filtered.size).toBe(2);
893
+
828
894
  expect(filtered.has({ id: 1, type: 'user' })).toBe(true);
895
+
829
896
  expect(filtered.has({ id: 3, type: 'user' })).toBe(true);
897
+
830
898
  expect(filtered.has({ id: 2, type: 'admin' })).toBe(false);
831
899
  });
832
900
  });
@@ -842,11 +910,15 @@ describe('ISetMapped additional functionality with complex types', () => {
842
910
  testElementToString,
843
911
  stringToTestElement,
844
912
  );
913
+
845
914
  const filtered = set.filterNot((el) => el.type === 'user');
846
915
 
847
916
  expect(filtered.size).toBe(1);
917
+
848
918
  expect(filtered.has({ id: 2, type: 'admin' })).toBe(true);
919
+
849
920
  expect(filtered.has({ id: 1, type: 'user' })).toBe(false);
921
+
850
922
  expect(filtered.has({ id: 3, type: 'user' })).toBe(false);
851
923
  });
852
924
  });
@@ -861,6 +933,7 @@ describe('ISetMapped additional functionality with complex types', () => {
861
933
  testElementToString,
862
934
  stringToTestElement,
863
935
  );
936
+
864
937
  const mut_collected: TestElement[] = [];
865
938
 
866
939
  for (const el of set) {
@@ -868,7 +941,9 @@ describe('ISetMapped additional functionality with complex types', () => {
868
941
  }
869
942
 
870
943
  expect(mut_collected).toHaveLength(2);
944
+
871
945
  expect(mut_collected).toContainEqual({ id: 1, type: 'user' });
946
+
872
947
  expect(mut_collected).toContainEqual({ id: 2, type: 'admin' });
873
948
  });
874
949
  });
@@ -880,6 +955,7 @@ describe('ISetMapped additional functionality with complex types', () => {
880
955
  testElementToString,
881
956
  stringToTestElement,
882
957
  );
958
+
883
959
  const superset = ISetMapped.create(
884
960
  [
885
961
  { id: 1, type: 'user' },
@@ -901,6 +977,7 @@ describe('ISetMapped additional functionality with complex types', () => {
901
977
  testElementToString,
902
978
  stringToTestElement,
903
979
  );
980
+
904
981
  const set2 = ISetMapped.create(
905
982
  [
906
983
  { id: 1, type: 'user' },
@@ -924,6 +1001,7 @@ describe('ISetMapped additional functionality with complex types', () => {
924
1001
  testElementToString,
925
1002
  stringToTestElement,
926
1003
  );
1004
+
927
1005
  const subset = ISetMapped.create(
928
1006
  [{ id: 1, type: 'user' }],
929
1007
  testElementToString,
@@ -942,6 +1020,7 @@ describe('ISetMapped additional functionality with complex types', () => {
942
1020
  testElementToString,
943
1021
  stringToTestElement,
944
1022
  );
1023
+
945
1024
  const set2 = ISetMapped.create(
946
1025
  [
947
1026
  { id: 1, type: 'user' },
@@ -966,6 +1045,7 @@ describe('ISetMapped additional functionality with complex types', () => {
966
1045
  testElementToString,
967
1046
  stringToTestElement,
968
1047
  );
1048
+
969
1049
  const set2 = ISetMapped.create(
970
1050
  [
971
1051
  { id: 2, type: 'admin' },
@@ -974,11 +1054,15 @@ describe('ISetMapped additional functionality with complex types', () => {
974
1054
  testElementToString,
975
1055
  stringToTestElement,
976
1056
  );
1057
+
977
1058
  const result = set1.subtract(set2);
978
1059
 
979
1060
  expect(result.size).toBe(2);
1061
+
980
1062
  expect(result.has({ id: 1, type: 'user' })).toBe(true);
1063
+
981
1064
  expect(result.has({ id: 3, type: 'guest' })).toBe(true);
1065
+
982
1066
  expect(result.has({ id: 2, type: 'admin' })).toBe(false);
983
1067
  });
984
1068
  });
@@ -994,6 +1078,7 @@ describe('ISetMapped additional functionality with complex types', () => {
994
1078
  testElementToString,
995
1079
  stringToTestElement,
996
1080
  );
1081
+
997
1082
  const set2 = ISetMapped.create(
998
1083
  [
999
1084
  { id: 2, type: 'admin' },
@@ -1003,11 +1088,15 @@ describe('ISetMapped additional functionality with complex types', () => {
1003
1088
  testElementToString,
1004
1089
  stringToTestElement,
1005
1090
  );
1091
+
1006
1092
  const result = set1.intersect(set2);
1007
1093
 
1008
1094
  expect(result.size).toBe(2);
1095
+
1009
1096
  expect(result.has({ id: 2, type: 'admin' })).toBe(true);
1097
+
1010
1098
  expect(result.has({ id: 3, type: 'guest' })).toBe(true);
1099
+
1011
1100
  expect(result.has({ id: 1, type: 'user' })).toBe(false);
1012
1101
  });
1013
1102
  });
@@ -1022,6 +1111,7 @@ describe('ISetMapped additional functionality with complex types', () => {
1022
1111
  testElementToString,
1023
1112
  stringToTestElement,
1024
1113
  );
1114
+
1025
1115
  const set2 = ISetMapped.create(
1026
1116
  [
1027
1117
  { id: 3, type: 'guest' },
@@ -1030,12 +1120,17 @@ describe('ISetMapped additional functionality with complex types', () => {
1030
1120
  testElementToString,
1031
1121
  stringToTestElement,
1032
1122
  );
1123
+
1033
1124
  const result = set1.union(set2);
1034
1125
 
1035
1126
  expect(result.size).toBe(4);
1127
+
1036
1128
  expect(result.has({ id: 1, type: 'user' })).toBe(true);
1129
+
1037
1130
  expect(result.has({ id: 2, type: 'admin' })).toBe(true);
1131
+
1038
1132
  expect(result.has({ id: 3, type: 'guest' })).toBe(true);
1133
+
1039
1134
  expect(result.has({ id: 4, type: 'user' })).toBe(true);
1040
1135
  });
1041
1136
  });
@@ -1050,10 +1145,13 @@ describe('ISetMapped additional functionality with complex types', () => {
1050
1145
  testElementToString,
1051
1146
  stringToTestElement,
1052
1147
  );
1148
+
1053
1149
  const keys = Array.from(set.keys());
1054
1150
 
1055
1151
  expect(keys).toHaveLength(2);
1152
+
1056
1153
  expect(keys).toContainEqual({ id: 1, type: 'user' });
1154
+
1057
1155
  expect(keys).toContainEqual({ id: 2, type: 'admin' });
1058
1156
  });
1059
1157
 
@@ -1066,10 +1164,13 @@ describe('ISetMapped additional functionality with complex types', () => {
1066
1164
  testElementToString,
1067
1165
  stringToTestElement,
1068
1166
  );
1167
+
1069
1168
  const values = Array.from(set.values());
1070
1169
 
1071
1170
  expect(values).toHaveLength(2);
1171
+
1072
1172
  expect(values).toContainEqual({ id: 1, type: 'user' });
1173
+
1073
1174
  expect(values).toContainEqual({ id: 2, type: 'admin' });
1074
1175
  });
1075
1176
 
@@ -1082,6 +1183,7 @@ describe('ISetMapped additional functionality with complex types', () => {
1082
1183
  testElementToString,
1083
1184
  stringToTestElement,
1084
1185
  );
1186
+
1085
1187
  const entries = Array.from(set.entries());
1086
1188
 
1087
1189
  expect(entries).toHaveLength(2);
@@ -1100,6 +1202,7 @@ describe('ISetMapped additional functionality with complex types', () => {
1100
1202
  testElementToString,
1101
1203
  stringToTestElement,
1102
1204
  );
1205
+
1103
1206
  const mut_collected: TestElement[] = [];
1104
1207
 
1105
1208
  for (const element of set) {
@@ -1107,7 +1210,9 @@ describe('ISetMapped additional functionality with complex types', () => {
1107
1210
  }
1108
1211
 
1109
1212
  expect(mut_collected).toHaveLength(2);
1213
+
1110
1214
  expect(mut_collected).toContainEqual({ id: 1, type: 'user' });
1215
+
1111
1216
  expect(mut_collected).toContainEqual({ id: 2, type: 'admin' });
1112
1217
  });
1113
1218
  });
@@ -1122,10 +1227,13 @@ describe('ISetMapped additional functionality with complex types', () => {
1122
1227
  testElementToString,
1123
1228
  stringToTestElement,
1124
1229
  );
1230
+
1125
1231
  const array = set.toArray();
1126
1232
 
1127
1233
  expect(array).toHaveLength(2);
1234
+
1128
1235
  expect(array).toContainEqual({ id: 1, type: 'user' });
1236
+
1129
1237
  expect(array).toContainEqual({ id: 2, type: 'admin' });
1130
1238
  });
1131
1239
 
@@ -1138,10 +1246,13 @@ describe('ISetMapped additional functionality with complex types', () => {
1138
1246
  testElementToString,
1139
1247
  stringToTestElement,
1140
1248
  );
1249
+
1141
1250
  const rawSet = set.toRawSet();
1142
1251
 
1143
1252
  expect(rawSet.size).toBe(2);
1253
+
1144
1254
  expect(rawSet.has('user_1')).toBe(true);
1255
+
1145
1256
  expect(rawSet.has('admin_2')).toBe(true);
1146
1257
  });
1147
1258
  });