ts-data-forge 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (527) hide show
  1. package/README.md +55 -6
  2. package/dist/array/impl/array-utils-creation.d.mts +14 -0
  3. package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
  4. package/dist/array/impl/array-utils-creation.mjs +12 -0
  5. package/dist/array/impl/array-utils-creation.mjs.map +1 -1
  6. package/dist/array/impl/array-utils-element-access.d.mts +10 -0
  7. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-element-access.mjs +6 -0
  9. package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
  10. package/dist/array/impl/array-utils-modification.d.mts +14 -0
  11. package/dist/array/impl/array-utils-modification.d.mts.map +1 -1
  12. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  13. package/dist/array/impl/array-utils-reducing-value.d.mts +26 -2
  14. package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
  15. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  16. package/dist/array/impl/array-utils-search.d.mts +30 -0
  17. package/dist/array/impl/array-utils-search.d.mts.map +1 -1
  18. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  19. package/dist/array/impl/array-utils-set-op.d.mts +13 -0
  20. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  21. package/dist/array/impl/array-utils-set-op.mjs +13 -0
  22. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  23. package/dist/array/impl/array-utils-size.d.mts +3 -0
  24. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  25. package/dist/array/impl/array-utils-size.mjs +3 -0
  26. package/dist/array/impl/array-utils-size.mjs.map +1 -1
  27. package/dist/array/impl/array-utils-slice-clamped.d.mts +2 -0
  28. package/dist/array/impl/array-utils-slice-clamped.d.mts.map +1 -1
  29. package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
  30. package/dist/array/impl/array-utils-slicing.d.mts +15 -0
  31. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  32. package/dist/array/impl/array-utils-slicing.mjs +7 -0
  33. package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
  34. package/dist/array/impl/array-utils-transformation.d.mts +27 -0
  35. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  36. package/dist/array/impl/array-utils-transformation.mjs +6 -0
  37. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  38. package/dist/array/impl/array-utils-validation.d.mts +17 -0
  39. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  40. package/dist/array/impl/array-utils-validation.mjs +11 -0
  41. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  42. package/dist/collections/imap-mapped.mjs.map +1 -1
  43. package/dist/collections/imap.d.mts +20 -0
  44. package/dist/collections/imap.d.mts.map +1 -1
  45. package/dist/collections/imap.mjs +2 -0
  46. package/dist/collections/imap.mjs.map +1 -1
  47. package/dist/collections/iset-mapped.d.mts +27 -0
  48. package/dist/collections/iset-mapped.d.mts.map +1 -1
  49. package/dist/collections/iset-mapped.mjs +7 -0
  50. package/dist/collections/iset-mapped.mjs.map +1 -1
  51. package/dist/collections/iset.d.mts +29 -0
  52. package/dist/collections/iset.d.mts.map +1 -1
  53. package/dist/collections/iset.mjs +7 -0
  54. package/dist/collections/iset.mjs.map +1 -1
  55. package/dist/collections/queue.d.mts +40 -0
  56. package/dist/collections/queue.d.mts.map +1 -1
  57. package/dist/collections/queue.mjs +8 -0
  58. package/dist/collections/queue.mjs.map +1 -1
  59. package/dist/collections/stack.d.mts +35 -0
  60. package/dist/collections/stack.d.mts.map +1 -1
  61. package/dist/collections/stack.mjs +7 -0
  62. package/dist/collections/stack.mjs.map +1 -1
  63. package/dist/entry-point.mjs +1 -1
  64. package/dist/functional/match.d.mts.map +1 -1
  65. package/dist/functional/match.mjs.map +1 -1
  66. package/dist/functional/optional/impl/optional-expect-to-be.d.mts +1 -0
  67. package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -1
  68. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  69. package/dist/functional/optional/impl/optional-filter.d.mts +3 -0
  70. package/dist/functional/optional/impl/optional-filter.d.mts.map +1 -1
  71. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  72. package/dist/functional/optional/impl/optional-flat-map.d.mts +2 -0
  73. package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -1
  74. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  75. package/dist/functional/optional/impl/optional-from-nullable.d.mts +2 -0
  76. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  77. package/dist/functional/optional/impl/optional-from-nullable.mjs +2 -0
  78. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  79. package/dist/functional/optional/impl/optional-is-optional.d.mts +2 -0
  80. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  81. package/dist/functional/optional/impl/optional-is-optional.mjs +2 -0
  82. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  83. package/dist/functional/optional/impl/optional-is-some.d.mts +1 -0
  84. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  85. package/dist/functional/optional/impl/optional-is-some.mjs +1 -0
  86. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  87. package/dist/functional/optional/impl/optional-map.d.mts +2 -0
  88. package/dist/functional/optional/impl/optional-map.d.mts.map +1 -1
  89. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  90. package/dist/functional/optional/impl/optional-none.d.mts +2 -0
  91. package/dist/functional/optional/impl/optional-none.d.mts.map +1 -1
  92. package/dist/functional/optional/impl/optional-none.mjs +2 -0
  93. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  94. package/dist/functional/optional/impl/optional-or-else.d.mts +4 -0
  95. package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -1
  96. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  97. package/dist/functional/optional/impl/optional-some.d.mts +3 -1
  98. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  99. package/dist/functional/optional/impl/optional-some.mjs +2 -0
  100. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  101. package/dist/functional/optional/impl/optional-to-nullable.d.mts +2 -0
  102. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  103. package/dist/functional/optional/impl/optional-to-nullable.mjs +2 -0
  104. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  105. package/dist/functional/optional/impl/optional-unwrap-or.d.mts +3 -0
  106. package/dist/functional/optional/impl/optional-unwrap-or.d.mts.map +1 -1
  107. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  108. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts +1 -0
  109. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  110. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +1 -0
  111. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  112. package/dist/functional/optional/impl/optional-unwrap.d.mts +2 -0
  113. package/dist/functional/optional/impl/optional-unwrap.d.mts.map +1 -1
  114. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  115. package/dist/functional/optional/impl/optional-zip.d.mts +2 -0
  116. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  117. package/dist/functional/optional/impl/optional-zip.mjs +2 -0
  118. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  119. package/dist/functional/result/impl/result-err.d.mts +3 -1
  120. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  121. package/dist/functional/result/impl/result-err.mjs +2 -0
  122. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  123. package/dist/functional/result/impl/result-expect-to-be.d.mts +1 -0
  124. package/dist/functional/result/impl/result-expect-to-be.d.mts.map +1 -1
  125. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
  126. package/dist/functional/result/impl/result-flat-map.d.mts +5 -0
  127. package/dist/functional/result/impl/result-flat-map.d.mts.map +1 -1
  128. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
  129. package/dist/functional/result/impl/result-fold.d.mts +4 -0
  130. package/dist/functional/result/impl/result-fold.d.mts.map +1 -1
  131. package/dist/functional/result/impl/result-fold.mjs.map +1 -1
  132. package/dist/functional/result/impl/result-from-promise.d.mts +3 -0
  133. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  134. package/dist/functional/result/impl/result-from-promise.mjs +3 -0
  135. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  136. package/dist/functional/result/impl/result-from-throwable.d.mts +2 -0
  137. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  138. package/dist/functional/result/impl/result-from-throwable.mjs +2 -0
  139. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
  140. package/dist/functional/result/impl/result-is-err.d.mts +2 -0
  141. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  142. package/dist/functional/result/impl/result-is-err.mjs +2 -0
  143. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  144. package/dist/functional/result/impl/result-is-ok.d.mts +2 -0
  145. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  146. package/dist/functional/result/impl/result-is-ok.mjs +2 -0
  147. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  148. package/dist/functional/result/impl/result-is-result.d.mts +4 -0
  149. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  150. package/dist/functional/result/impl/result-is-result.mjs +4 -0
  151. package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
  152. package/dist/functional/result/impl/result-map-err.d.mts +3 -0
  153. package/dist/functional/result/impl/result-map-err.d.mts.map +1 -1
  154. package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
  155. package/dist/functional/result/impl/result-map.d.mts +4 -0
  156. package/dist/functional/result/impl/result-map.d.mts.map +1 -1
  157. package/dist/functional/result/impl/result-map.mjs.map +1 -1
  158. package/dist/functional/result/impl/result-ok.d.mts +3 -1
  159. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  160. package/dist/functional/result/impl/result-ok.mjs +2 -0
  161. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  162. package/dist/functional/result/impl/result-or-else.d.mts +4 -0
  163. package/dist/functional/result/impl/result-or-else.d.mts.map +1 -1
  164. package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
  165. package/dist/functional/result/impl/result-swap.d.mts +2 -0
  166. package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
  167. package/dist/functional/result/impl/result-swap.mjs +2 -0
  168. package/dist/functional/result/impl/result-swap.mjs.map +1 -1
  169. package/dist/functional/result/impl/result-to-optional.d.mts +2 -0
  170. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
  171. package/dist/functional/result/impl/result-to-optional.mjs +2 -0
  172. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
  173. package/dist/functional/result/impl/result-unwrap-err-or.d.mts +3 -0
  174. package/dist/functional/result/impl/result-unwrap-err-or.d.mts.map +1 -1
  175. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
  176. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts +2 -0
  177. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
  178. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +2 -0
  179. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  180. package/dist/functional/result/impl/result-unwrap-err.d.mts +1 -0
  181. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  182. package/dist/functional/result/impl/result-unwrap-err.mjs +1 -0
  183. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
  184. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts +3 -0
  185. package/dist/functional/result/impl/result-unwrap-ok-or.d.mts.map +1 -1
  186. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
  187. package/dist/functional/result/impl/result-unwrap-ok.d.mts +1 -0
  188. package/dist/functional/result/impl/result-unwrap-ok.d.mts.map +1 -1
  189. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
  190. package/dist/functional/result/impl/result-unwrap-throw.d.mts +2 -0
  191. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  192. package/dist/functional/result/impl/result-unwrap-throw.mjs +2 -0
  193. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  194. package/dist/functional/result/impl/result-zip.d.mts +3 -1
  195. package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
  196. package/dist/functional/result/impl/result-zip.mjs +3 -1
  197. package/dist/functional/result/impl/result-zip.mjs.map +1 -1
  198. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts +2 -1
  199. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  200. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +1 -0
  201. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  202. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +1 -0
  203. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +1 -1
  204. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
  205. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +4 -0
  206. package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +1 -1
  207. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
  208. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts +2 -0
  209. package/dist/functional/ternary-result/impl/ternary-result-fold.d.mts.map +1 -1
  210. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
  211. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts +2 -0
  212. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
  213. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +2 -0
  214. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
  215. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts +2 -0
  216. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
  217. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +2 -0
  218. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
  219. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts +1 -0
  220. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
  221. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +1 -0
  222. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
  223. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +4 -0
  224. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
  225. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +4 -0
  226. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
  227. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +1 -0
  228. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
  229. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +1 -0
  230. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
  231. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts +3 -0
  232. package/dist/functional/ternary-result/impl/ternary-result-map-err.d.mts.map +1 -1
  233. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
  234. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +3 -0
  235. package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +1 -1
  236. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
  237. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts +6 -0
  238. package/dist/functional/ternary-result/impl/ternary-result-map.d.mts.map +1 -1
  239. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
  240. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts +1 -1
  241. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  242. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  243. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts +2 -0
  244. package/dist/functional/ternary-result/impl/ternary-result-or-else.d.mts.map +1 -1
  245. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
  246. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +2 -0
  247. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
  248. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +2 -0
  249. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
  250. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +2 -0
  251. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +1 -1
  252. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
  253. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts +1 -0
  254. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
  255. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +1 -0
  256. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  257. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts +2 -0
  258. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
  259. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +2 -0
  260. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
  261. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts +2 -0
  262. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.d.mts.map +1 -1
  263. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
  264. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts +2 -0
  265. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.d.mts.map +1 -1
  266. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
  267. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts +1 -0
  268. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
  269. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +1 -0
  270. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  271. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts +2 -0
  272. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.d.mts.map +1 -1
  273. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
  274. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts +1 -0
  275. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
  276. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +1 -0
  277. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  278. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts +2 -0
  279. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
  280. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +2 -0
  281. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
  282. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts +1 -1
  283. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  284. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  285. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +4 -0
  286. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
  287. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +4 -0
  288. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
  289. package/dist/globals.d.mts +10 -0
  290. package/dist/guard/index.mjs +1 -1
  291. package/dist/guard/is-record.d.mts +31 -0
  292. package/dist/guard/is-record.d.mts.map +1 -1
  293. package/dist/guard/is-record.mjs +32 -1
  294. package/dist/guard/is-record.mjs.map +1 -1
  295. package/dist/guard/is-type.d.mts +3 -0
  296. package/dist/guard/is-type.d.mts.map +1 -1
  297. package/dist/guard/is-type.mjs +3 -0
  298. package/dist/guard/is-type.mjs.map +1 -1
  299. package/dist/guard/key-is-in.d.mts +1 -0
  300. package/dist/guard/key-is-in.d.mts.map +1 -1
  301. package/dist/guard/key-is-in.mjs +1 -0
  302. package/dist/guard/key-is-in.mjs.map +1 -1
  303. package/dist/index.mjs +1 -1
  304. package/dist/iterator/range.d.mts +4 -0
  305. package/dist/iterator/range.d.mts.map +1 -1
  306. package/dist/iterator/range.mjs +1 -0
  307. package/dist/iterator/range.mjs.map +1 -1
  308. package/dist/json/json.d.mts +21 -0
  309. package/dist/json/json.d.mts.map +1 -1
  310. package/dist/json/json.mjs +21 -0
  311. package/dist/json/json.mjs.map +1 -1
  312. package/dist/number/branded-types/int.d.mts +14 -0
  313. package/dist/number/branded-types/int.d.mts.map +1 -1
  314. package/dist/number/branded-types/int.mjs +14 -0
  315. package/dist/number/branded-types/int.mjs.map +1 -1
  316. package/dist/number/branded-types/non-zero-safe-int.mjs +2 -2
  317. package/dist/number/branded-types/positive-int.d.mts +14 -0
  318. package/dist/number/branded-types/positive-int.d.mts.map +1 -1
  319. package/dist/number/branded-types/positive-int.mjs +14 -0
  320. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  321. package/dist/number/branded-types/positive-safe-int.d.mts +21 -0
  322. package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
  323. package/dist/number/branded-types/positive-safe-int.mjs +22 -1
  324. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  325. package/dist/number/branded-types/safe-int.d.mts +21 -0
  326. package/dist/number/branded-types/safe-int.d.mts.map +1 -1
  327. package/dist/number/branded-types/safe-int.mjs +23 -2
  328. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  329. package/dist/number/branded-types/safe-uint.mjs +1 -1
  330. package/dist/number/branded-types/uint.d.mts +12 -0
  331. package/dist/number/branded-types/uint.d.mts.map +1 -1
  332. package/dist/number/branded-types/uint.mjs +12 -0
  333. package/dist/number/branded-types/uint.mjs.map +1 -1
  334. package/dist/number/num.d.mts +9 -0
  335. package/dist/number/num.d.mts.map +1 -1
  336. package/dist/number/num.mjs +8 -1
  337. package/dist/number/num.mjs.map +1 -1
  338. package/dist/number/refined-number-utils.d.mts +22 -0
  339. package/dist/number/refined-number-utils.d.mts.map +1 -1
  340. package/dist/number/refined-number-utils.mjs +22 -0
  341. package/dist/number/refined-number-utils.mjs.map +1 -1
  342. package/dist/object/object.d.mts +9 -0
  343. package/dist/object/object.d.mts.map +1 -1
  344. package/dist/object/object.mjs +7 -0
  345. package/dist/object/object.mjs.map +1 -1
  346. package/dist/others/map-nullable.mjs.map +1 -1
  347. package/dist/others/tuple.d.mts +11 -0
  348. package/dist/others/tuple.d.mts.map +1 -1
  349. package/dist/others/tuple.mjs +11 -0
  350. package/dist/others/tuple.mjs.map +1 -1
  351. package/dist/others/unknown-to-string.d.mts.map +1 -1
  352. package/dist/others/unknown-to-string.mjs.map +1 -1
  353. package/dist/promise/promise.d.mts +4 -0
  354. package/dist/promise/promise.d.mts.map +1 -1
  355. package/dist/promise/promise.mjs +4 -0
  356. package/dist/promise/promise.mjs.map +1 -1
  357. package/package.json +18 -22
  358. package/src/array/impl/array-utils-creation.mts +20 -0
  359. package/src/array/impl/array-utils-creation.test.mts +71 -0
  360. package/src/array/impl/array-utils-element-access.mts +13 -0
  361. package/src/array/impl/array-utils-element-access.test.mts +21 -0
  362. package/src/array/impl/array-utils-iterators.test.mts +17 -0
  363. package/src/array/impl/array-utils-modification.mts +40 -0
  364. package/src/array/impl/array-utils-modification.test.mts +75 -0
  365. package/src/array/impl/array-utils-overload-type-error.test.mts +19 -0
  366. package/src/array/impl/array-utils-reducing-value.mts +53 -8
  367. package/src/array/impl/array-utils-reducing-value.test.mts +90 -0
  368. package/src/array/impl/array-utils-search.mts +53 -0
  369. package/src/array/impl/array-utils-search.test.mts +51 -0
  370. package/src/array/impl/array-utils-set-op.mts +19 -0
  371. package/src/array/impl/array-utils-set-op.test.mts +116 -0
  372. package/src/array/impl/array-utils-size.mts +3 -0
  373. package/src/array/impl/array-utils-size.test.mts +1 -0
  374. package/src/array/impl/array-utils-slice-clamped.mts +7 -0
  375. package/src/array/impl/array-utils-slice-clamped.test.mts +20 -0
  376. package/src/array/impl/array-utils-slicing.mts +27 -0
  377. package/src/array/impl/array-utils-slicing.test.mts +57 -0
  378. package/src/array/impl/array-utils-transformation.mts +58 -0
  379. package/src/array/impl/array-utils-transformation.test.mts +113 -1
  380. package/src/array/impl/array-utils-validation.mts +23 -0
  381. package/src/array/impl/array-utils-validation.test.mts +96 -0
  382. package/src/array/impl/array.test.mts +12 -0
  383. package/src/collections/imap-mapped.mts +11 -0
  384. package/src/collections/imap-mapped.test.mts +70 -0
  385. package/src/collections/imap.mts +32 -0
  386. package/src/collections/imap.test.mts +106 -0
  387. package/src/collections/iset-mapped.mts +35 -0
  388. package/src/collections/iset-mapped.test.mts +111 -0
  389. package/src/collections/iset.mts +34 -0
  390. package/src/collections/iset.test.mts +193 -0
  391. package/src/collections/queue.mts +53 -0
  392. package/src/collections/queue.test.mts +32 -0
  393. package/src/collections/stack.mts +42 -0
  394. package/src/collections/stack.test.mts +44 -0
  395. package/src/functional/match.mts +16 -0
  396. package/src/functional/match.test.mts +2 -0
  397. package/src/functional/optional/impl/optional-expect-to-be.mts +3 -0
  398. package/src/functional/optional/impl/optional-filter.mts +6 -0
  399. package/src/functional/optional/impl/optional-flat-map.mts +4 -0
  400. package/src/functional/optional/impl/optional-from-nullable.mts +2 -0
  401. package/src/functional/optional/impl/optional-is-optional.mts +2 -0
  402. package/src/functional/optional/impl/optional-is-some.mts +1 -0
  403. package/src/functional/optional/impl/optional-map.mts +5 -0
  404. package/src/functional/optional/impl/optional-none.mts +2 -0
  405. package/src/functional/optional/impl/optional-or-else.mts +6 -0
  406. package/src/functional/optional/impl/optional-some.mts +3 -1
  407. package/src/functional/optional/impl/optional-to-nullable.mts +2 -0
  408. package/src/functional/optional/impl/optional-unwrap-or.mts +5 -0
  409. package/src/functional/optional/impl/optional-unwrap-throw.mts +1 -0
  410. package/src/functional/optional/impl/optional-unwrap.mts +2 -0
  411. package/src/functional/optional/impl/optional-zip.mts +2 -0
  412. package/src/functional/optional.test.mts +73 -0
  413. package/src/functional/pipe.test.mts +3 -0
  414. package/src/functional/result/impl/result-err.mts +3 -1
  415. package/src/functional/result/impl/result-expect-to-be.mts +3 -0
  416. package/src/functional/result/impl/result-flat-map.mts +7 -0
  417. package/src/functional/result/impl/result-fold.mts +6 -0
  418. package/src/functional/result/impl/result-from-promise.mts +3 -0
  419. package/src/functional/result/impl/result-from-throwable.mts +4 -0
  420. package/src/functional/result/impl/result-is-err.mts +2 -0
  421. package/src/functional/result/impl/result-is-ok.mts +2 -0
  422. package/src/functional/result/impl/result-is-result.mts +4 -0
  423. package/src/functional/result/impl/result-map-err.mts +5 -0
  424. package/src/functional/result/impl/result-map.mts +6 -0
  425. package/src/functional/result/impl/result-ok.mts +3 -1
  426. package/src/functional/result/impl/result-or-else.mts +6 -0
  427. package/src/functional/result/impl/result-swap.mts +2 -0
  428. package/src/functional/result/impl/result-to-optional.mts +2 -0
  429. package/src/functional/result/impl/result-unwrap-err-or.mts +5 -0
  430. package/src/functional/result/impl/result-unwrap-err-throw.mts +2 -0
  431. package/src/functional/result/impl/result-unwrap-err.mts +1 -0
  432. package/src/functional/result/impl/result-unwrap-ok-or.mts +5 -0
  433. package/src/functional/result/impl/result-unwrap-ok.mts +2 -0
  434. package/src/functional/result/impl/result-unwrap-throw.mts +2 -0
  435. package/src/functional/result/impl/result-zip.mts +3 -1
  436. package/src/functional/result.test.mts +88 -0
  437. package/src/functional/ternary-result/impl/ternary-result-err.mts +2 -1
  438. package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +4 -0
  439. package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +7 -0
  440. package/src/functional/ternary-result/impl/ternary-result-fold.mts +5 -0
  441. package/src/functional/ternary-result/impl/ternary-result-from-promise.mts +2 -0
  442. package/src/functional/ternary-result/impl/ternary-result-from-throwable.mts +3 -0
  443. package/src/functional/ternary-result/impl/ternary-result-is-ok.mts +1 -0
  444. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +4 -0
  445. package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +1 -0
  446. package/src/functional/ternary-result/impl/ternary-result-map-err.mts +6 -0
  447. package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +6 -0
  448. package/src/functional/ternary-result/impl/ternary-result-map.mts +9 -0
  449. package/src/functional/ternary-result/impl/ternary-result-ok.mts +1 -1
  450. package/src/functional/ternary-result/impl/ternary-result-or-else.mts +5 -0
  451. package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +2 -0
  452. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +5 -0
  453. package/src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts +1 -0
  454. package/src/functional/ternary-result/impl/ternary-result-unwrap-err.mts +2 -0
  455. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mts +5 -0
  456. package/src/functional/ternary-result/impl/ternary-result-unwrap-ok.mts +3 -0
  457. package/src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts +1 -0
  458. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mts +5 -0
  459. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts +1 -0
  460. package/src/functional/ternary-result/impl/ternary-result-unwrap-warn.mts +2 -0
  461. package/src/functional/ternary-result/impl/ternary-result-warn.mts +4 -1
  462. package/src/functional/ternary-result/impl/ternary-result-zip.mts +4 -0
  463. package/src/functional/ternary-result.test.mts +91 -0
  464. package/src/globals.d.mts +10 -0
  465. package/src/guard/has-key.test.mts +9 -0
  466. package/src/guard/is-non-empty-string.test.mts +20 -0
  467. package/src/guard/is-non-null-object.test.mts +19 -0
  468. package/src/guard/is-primitive.test.mts +23 -0
  469. package/src/guard/is-record.mts +34 -0
  470. package/src/guard/is-record.test.mts +21 -0
  471. package/src/guard/is-type.mts +3 -0
  472. package/src/guard/is-type.test.mts +134 -0
  473. package/src/guard/key-is-in.mts +1 -0
  474. package/src/iterator/range.mts +9 -0
  475. package/src/json/json.mts +29 -0
  476. package/src/json/json.test.mts +87 -0
  477. package/src/number/branded-types/finite-number.test.mts +38 -0
  478. package/src/number/branded-types/int.mts +14 -0
  479. package/src/number/branded-types/int.test.mts +42 -0
  480. package/src/number/branded-types/int16.test.mts +47 -0
  481. package/src/number/branded-types/int32.test.mts +47 -0
  482. package/src/number/branded-types/non-negative-finite-number.test.mts +40 -0
  483. package/src/number/branded-types/non-negative-int16.test.mts +43 -0
  484. package/src/number/branded-types/non-negative-int32.test.mts +43 -0
  485. package/src/number/branded-types/non-zero-finite-number.test.mts +51 -0
  486. package/src/number/branded-types/non-zero-int.test.mts +53 -0
  487. package/src/number/branded-types/non-zero-int16.test.mts +44 -0
  488. package/src/number/branded-types/non-zero-int32.test.mts +44 -0
  489. package/src/number/branded-types/non-zero-safe-int.mts +2 -2
  490. package/src/number/branded-types/non-zero-safe-int.test.mts +62 -0
  491. package/src/number/branded-types/non-zero-uint16.test.mts +37 -0
  492. package/src/number/branded-types/non-zero-uint32.test.mts +37 -0
  493. package/src/number/branded-types/positive-finite-number.test.mts +45 -0
  494. package/src/number/branded-types/positive-int.mts +14 -0
  495. package/src/number/branded-types/positive-int.test.mts +47 -0
  496. package/src/number/branded-types/positive-int16.test.mts +35 -0
  497. package/src/number/branded-types/positive-int32.test.mts +35 -0
  498. package/src/number/branded-types/positive-safe-int.mts +22 -1
  499. package/src/number/branded-types/positive-safe-int.test.mts +49 -0
  500. package/src/number/branded-types/positive-uint16.test.mts +37 -0
  501. package/src/number/branded-types/positive-uint32.test.mts +37 -0
  502. package/src/number/branded-types/safe-int.mts +23 -2
  503. package/src/number/branded-types/safe-int.test.mts +52 -0
  504. package/src/number/branded-types/safe-uint.mts +1 -1
  505. package/src/number/branded-types/safe-uint.test.mts +48 -0
  506. package/src/number/branded-types/uint.mts +12 -0
  507. package/src/number/branded-types/uint.test.mts +43 -0
  508. package/src/number/branded-types/uint16.test.mts +41 -0
  509. package/src/number/branded-types/uint32.test.mts +41 -0
  510. package/src/number/enum/int8.test.mts +6 -0
  511. package/src/number/enum/uint8.test.mts +6 -0
  512. package/src/number/num.mts +12 -1
  513. package/src/number/num.test.mts +62 -0
  514. package/src/number/refined-number-utils.mts +25 -0
  515. package/src/object/object.mts +15 -0
  516. package/src/object/object.test.mts +10 -0
  517. package/src/others/cast-mutable.test.mts +7 -0
  518. package/src/others/cast-readonly.test.mts +17 -0
  519. package/src/others/if-then.test.mts +16 -0
  520. package/src/others/map-nullable.mts +3 -0
  521. package/src/others/map-nullable.test.mts +27 -0
  522. package/src/others/memoize-function.test.mts +41 -0
  523. package/src/others/tuple.mts +11 -0
  524. package/src/others/unknown-to-string.mts +2 -0
  525. package/src/others/unknown-to-string.test.mts +10 -0
  526. package/src/promise/promise.mts +4 -0
  527. package/src/promise/promise.test.mts +1 -0
@@ -15,6 +15,7 @@ describe('ISet.create', () => {
15
15
  const set = ISet.create<string>([]);
16
16
 
17
17
  expect(set.size).toBe(0);
18
+
18
19
  expect(set.isEmpty).toBe(true);
19
20
  });
20
21
 
@@ -22,28 +23,39 @@ describe('ISet.create', () => {
22
23
  const set = ISet.create([1, 2, 3, 2, 1]);
23
24
 
24
25
  expect(set.size).toBe(3);
26
+
25
27
  expect(set.has(1)).toBe(true);
28
+
26
29
  expect(set.has(2)).toBe(true);
30
+
27
31
  expect(set.has(3)).toBe(true);
28
32
  });
29
33
 
30
34
  test('should create set from JavaScript Set', () => {
31
35
  const jsSet = new Set(['a', 'b', 'c']);
36
+
32
37
  const set = ISet.create(jsSet);
33
38
 
34
39
  expect(set.size).toBe(3);
40
+
35
41
  expect(set.has('a')).toBe(true);
42
+
36
43
  expect(set.has('b')).toBe(true);
44
+
37
45
  expect(set.has('c')).toBe(true);
38
46
  });
39
47
 
40
48
  test('should create set from another ISet', () => {
41
49
  const original = ISet.create([1, 2, 3]);
50
+
42
51
  const copy = ISet.create(original);
43
52
 
44
53
  expect(copy.size).toBe(3);
54
+
45
55
  expect(copy.has(1)).toBe(true);
56
+
46
57
  expect(copy.has(2)).toBe(true);
58
+
47
59
  expect(copy.has(3)).toBe(true);
48
60
  });
49
61
  });
@@ -109,6 +121,7 @@ describe('ISet.has', () => {
109
121
  const set = ISet.create([true, false]);
110
122
 
111
123
  expect(set.has(true)).toBe(true);
124
+
112
125
  expect(set.has(false)).toBe(true);
113
126
  });
114
127
 
@@ -116,6 +129,7 @@ describe('ISet.has', () => {
116
129
  const set = ISet.create([null, undefined]);
117
130
 
118
131
  expect(set.has(null)).toBe(true);
132
+
119
133
  expect(set.has(undefined)).toBe(true);
120
134
  });
121
135
  });
@@ -166,9 +180,11 @@ describe('ISet.every', () => {
166
180
  describe('every method as type guard', () => {
167
181
  test('should narrow type when used as type guard', () => {
168
182
  const set = ISet.create<string | number>(['hello', 'world']);
183
+
169
184
  if (set.every((value): value is string => typeof value === 'string')) {
170
185
  // Type should be narrowed to ISet<string>
171
186
  const values = set.toArray();
187
+
172
188
  for (const value of values) {
173
189
  expect(isString(value)).toBe(true);
174
190
  }
@@ -230,6 +246,7 @@ describe('ISet.some', () => {
230
246
  const set = ISet.create(['hello', 'world', 'test']);
231
247
 
232
248
  expect(set.some((str) => str.includes('o'))).toBe(true);
249
+
233
250
  expect(set.some((str) => str.includes('z'))).toBe(false);
234
251
  });
235
252
  });
@@ -239,9 +256,11 @@ describe('ISet.add', () => {
239
256
  const s0 = ISet.create<number>([1, 2, 3]);
240
257
 
241
258
  expectType<typeof s0.add, (value: number) => ISet<number>>('<=');
259
+
242
260
  const s1 = ISet.create<number>([1, 2, 3, 4]);
243
261
 
244
262
  assert.deepStrictEqual(s0.add(4), s1);
263
+
245
264
  assert.deepStrictEqual(s0, ISet.create<number>([1, 2, 3]));
246
265
  });
247
266
 
@@ -249,6 +268,7 @@ describe('ISet.add', () => {
249
268
  const s0 = ISet.create<number>([1, 2, 3]);
250
269
 
251
270
  assert.deepStrictEqual(s0.add(2), ISet.create([1, 2, 3]));
271
+
252
272
  assert.deepStrictEqual(s0, ISet.create([1, 2, 3]));
253
273
  });
254
274
 
@@ -256,21 +276,27 @@ describe('ISet.add', () => {
256
276
  const s0 = ISet.create<number>([]);
257
277
 
258
278
  assert.deepStrictEqual(s0.add(1), ISet.create([1]));
279
+
259
280
  assert.deepStrictEqual(s0, ISet.create<number>([]));
260
281
  });
261
282
 
262
283
  test('should add new elements and maintain immutability', () => {
263
284
  const original = ISet.create<number>([1, 2, 3]);
285
+
264
286
  const modified = original.add(4);
265
287
 
266
288
  expect(original.size).toBe(3);
289
+
267
290
  expect(modified.size).toBe(4);
291
+
268
292
  expect(original.has(4)).toBe(false);
293
+
269
294
  expect(modified.has(4)).toBe(true);
270
295
  });
271
296
 
272
297
  test('should return same instance when adding existing element', () => {
273
298
  const set = ISet.create([1, 2, 3]);
299
+
274
300
  const result = set.add(2);
275
301
 
276
302
  expect(result).toBe(set);
@@ -278,12 +304,17 @@ describe('ISet.add', () => {
278
304
 
279
305
  test('should handle special values', () => {
280
306
  const set = ISet.create<number | null | undefined>([]);
307
+
281
308
  const withNull = set.add(null);
309
+
282
310
  const withUndefined = withNull.add(undefined);
311
+
283
312
  const withNaN = withUndefined.add(Number.NaN);
284
313
 
285
314
  expect(withNaN.has(null)).toBe(true);
315
+
286
316
  expect(withNaN.has(undefined)).toBe(true);
317
+
287
318
  expect(withNaN.has(Number.NaN)).toBe(true);
288
319
  });
289
320
  });
@@ -295,6 +326,7 @@ describe('ISet.delete', () => {
295
326
  expectType<typeof s0.delete, (value: number) => ISet<number>>('<=');
296
327
 
297
328
  assert.deepStrictEqual(s0.delete(4), ISet.create<number>([1, 2, 3]));
329
+
298
330
  assert.deepStrictEqual(s0, ISet.create<number>([1, 2, 3]));
299
331
  });
300
332
 
@@ -302,6 +334,7 @@ describe('ISet.delete', () => {
302
334
  const s0 = ISet.create([1, 2, 3]);
303
335
 
304
336
  assert.deepStrictEqual(s0.delete(2), ISet.create<1 | 2 | 3>([1, 3]));
337
+
305
338
  assert.deepStrictEqual(s0, ISet.create([1, 2, 3]));
306
339
  });
307
340
 
@@ -309,21 +342,27 @@ describe('ISet.delete', () => {
309
342
  const s0 = ISet.create<number>([]);
310
343
 
311
344
  assert.deepStrictEqual(s0.delete(1), ISet.create<number>([]));
345
+
312
346
  assert.deepStrictEqual(s0, ISet.create<number>([]));
313
347
  });
314
348
 
315
349
  test('should delete existing elements and maintain immutability', () => {
316
350
  const original = ISet.create([1, 2, 3, 4]);
351
+
317
352
  const modified = original.delete(2);
318
353
 
319
354
  expect(original.size).toBe(4);
355
+
320
356
  expect(modified.size).toBe(3);
357
+
321
358
  expect(original.has(2)).toBe(true);
359
+
322
360
  expect(modified.has(2)).toBe(false);
323
361
  });
324
362
 
325
363
  test('should return same instance when deleting non-existent element', () => {
326
364
  const set = ISet.create<number>([1, 2, 3]);
365
+
327
366
  const result = set.delete(4);
328
367
 
329
368
  expect(result).toBe(set);
@@ -356,6 +395,7 @@ describe('ISet.map', () => {
356
395
 
357
396
  test('should transform all elements', () => {
358
397
  const set = ISet.create([1, 2, 3]);
398
+
359
399
  const doubled = set.map((x) => x * 2);
360
400
 
361
401
  assert.deepStrictEqual(
@@ -366,10 +406,13 @@ describe('ISet.map', () => {
366
406
 
367
407
  test('should handle type transformations', () => {
368
408
  const set = ISet.create([1, 2, 3]);
409
+
369
410
  const strings = set.map((x) => x.toString());
370
411
 
371
412
  expect(strings.has('1')).toBe(true);
413
+
372
414
  expect(strings.has('2')).toBe(true);
415
+
373
416
  expect(strings.has('3')).toBe(true);
374
417
  });
375
418
  });
@@ -402,30 +445,39 @@ describe('ISet.filter', () => {
402
445
 
403
446
  test('should filter elements based on predicate', () => {
404
447
  const set = ISet.create([1, 2, 3, 4, 5, 6]);
448
+
405
449
  const evens = set.filter((x) => x % 2 === 0);
406
450
 
407
451
  expect(evens.size).toBe(3);
452
+
408
453
  expect(evens.has(2)).toBe(true);
454
+
409
455
  expect(evens.has(4)).toBe(true);
456
+
410
457
  expect(evens.has(6)).toBe(true);
411
458
  });
412
459
 
413
460
  test('should work as type guard', () => {
414
461
  const set = ISet.create<string | number>(['hello', 42, 'world', 123]);
462
+
415
463
  const strings = set.filter(
416
464
  (value): value is string => typeof value === 'string',
417
465
  );
418
466
 
419
467
  expect(strings.size).toBe(2);
468
+
420
469
  expect(strings.has('hello')).toBe(true);
470
+
421
471
  expect(strings.has('world')).toBe(true);
422
472
  });
423
473
 
424
474
  test('should return empty set when no elements match', () => {
425
475
  const set = ISet.create([1, 3, 5]);
476
+
426
477
  const evens = set.filter((x) => x % 2 === 0);
427
478
 
428
479
  expect(evens.size).toBe(0);
480
+
429
481
  expect(evens.isEmpty).toBe(true);
430
482
  });
431
483
  });
@@ -433,24 +485,31 @@ describe('ISet.filter', () => {
433
485
  describe('ISet.filterNot', () => {
434
486
  test('should filter out elements that satisfy predicate', () => {
435
487
  const set = ISet.create([1, 2, 3, 4, 5, 6]);
488
+
436
489
  const odds = set.filterNot((x) => x % 2 === 0);
437
490
 
438
491
  expect(odds.size).toBe(3);
492
+
439
493
  expect(odds.has(1)).toBe(true);
494
+
440
495
  expect(odds.has(3)).toBe(true);
496
+
441
497
  expect(odds.has(5)).toBe(true);
442
498
  });
443
499
 
444
500
  test('should return same set when no elements satisfy predicate', () => {
445
501
  const set = ISet.create([1, 3, 5]);
502
+
446
503
  const nonEvens = set.filterNot((x) => x % 2 === 0);
447
504
 
448
505
  expect(nonEvens.size).toBe(3);
506
+
449
507
  expect(ISet.equal(set, nonEvens)).toBe(true);
450
508
  });
451
509
 
452
510
  test('should return empty set when all elements satisfy predicate', () => {
453
511
  const set = ISet.create([2, 4, 6]);
512
+
454
513
  const nonEvens = set.filterNot((x) => x % 2 === 0);
455
514
 
456
515
  expect(nonEvens.isEmpty).toBe(true);
@@ -460,6 +519,7 @@ describe('ISet.filterNot', () => {
460
519
  describe('ISet.isSubsetOf', () => {
461
520
  test('case 1', () => {
462
521
  const s0 = ISet.create<number>([1, 2]);
522
+
463
523
  const s1 = ISet.create<number>([1, 2, 3]);
464
524
 
465
525
  expectType<typeof s0.isSubsetOf, (other: ISet<number>) => boolean>('<=');
@@ -469,6 +529,7 @@ describe('ISet.isSubsetOf', () => {
469
529
 
470
530
  test('case 2', () => {
471
531
  const s0 = ISet.create<number>([1, 2, 3]);
532
+
472
533
  const s1 = ISet.create<number>([1, 2]);
473
534
 
474
535
  expect(s0.isSubsetOf(s1)).toBe(false);
@@ -476,6 +537,7 @@ describe('ISet.isSubsetOf', () => {
476
537
 
477
538
  test('case 3', () => {
478
539
  const s0 = ISet.create<number>([]);
540
+
479
541
  const s1 = ISet.create<number>([1, 2, 3]);
480
542
 
481
543
  expect(s0.isSubsetOf(s1)).toBe(true);
@@ -483,6 +545,7 @@ describe('ISet.isSubsetOf', () => {
483
545
 
484
546
  test('should return true for subset relationship', () => {
485
547
  const subset = ISet.create<number>([1, 2]);
548
+
486
549
  const superset = ISet.create<number>([1, 2, 3, 4]);
487
550
 
488
551
  expect(subset.isSubsetOf(superset)).toBe(true);
@@ -490,6 +553,7 @@ describe('ISet.isSubsetOf', () => {
490
553
 
491
554
  test('should return true for equal sets', () => {
492
555
  const set1 = ISet.create<number>([1, 2, 3]);
556
+
493
557
  const set2 = ISet.create<number>([1, 2, 3]);
494
558
 
495
559
  expect(set1.isSubsetOf(set2)).toBe(true);
@@ -497,6 +561,7 @@ describe('ISet.isSubsetOf', () => {
497
561
 
498
562
  test('should return false for non-subset', () => {
499
563
  const set1 = ISet.create<number>([1, 2, 5]);
564
+
500
565
  const set2 = ISet.create<number>([1, 2, 3, 4]);
501
566
 
502
567
  expect(set1.isSubsetOf(set2)).toBe(false);
@@ -506,6 +571,7 @@ describe('ISet.isSubsetOf', () => {
506
571
  describe('ISet.isSupersetOf', () => {
507
572
  test('case 1', () => {
508
573
  const s0 = ISet.create<number>([1, 2, 3]);
574
+
509
575
  const s1 = ISet.create<number>([1, 2]);
510
576
 
511
577
  expectType<typeof s0.isSupersetOf, (other: ISet<number>) => boolean>('<=');
@@ -515,6 +581,7 @@ describe('ISet.isSupersetOf', () => {
515
581
 
516
582
  test('case 2', () => {
517
583
  const s0 = ISet.create<number>([1, 2]);
584
+
518
585
  const s1 = ISet.create<number>([1, 2, 3]);
519
586
 
520
587
  expect(s0.isSupersetOf(s1)).toBe(false);
@@ -522,6 +589,7 @@ describe('ISet.isSupersetOf', () => {
522
589
 
523
590
  test('case 3', () => {
524
591
  const s0 = ISet.create<number>([1, 2, 3]);
592
+
525
593
  const s1 = ISet.create<number>([]);
526
594
 
527
595
  expect(s0.isSupersetOf(s1)).toBe(true);
@@ -529,6 +597,7 @@ describe('ISet.isSupersetOf', () => {
529
597
 
530
598
  test('should return true for superset relationship', () => {
531
599
  const superset = ISet.create<number>([1, 2, 3, 4]);
600
+
532
601
  const subset = ISet.create<number>([1, 2]);
533
602
 
534
603
  expect(superset.isSupersetOf(subset)).toBe(true);
@@ -536,6 +605,7 @@ describe('ISet.isSupersetOf', () => {
536
605
 
537
606
  test('should return true for equal sets', () => {
538
607
  const set1 = ISet.create<number>([1, 2, 3]);
608
+
539
609
  const set2 = ISet.create<number>([1, 2, 3]);
540
610
 
541
611
  expect(set1.isSupersetOf(set2)).toBe(true);
@@ -543,6 +613,7 @@ describe('ISet.isSupersetOf', () => {
543
613
 
544
614
  test('should return false for non-superset', () => {
545
615
  const set1 = ISet.create<number>([1, 2, 3]);
616
+
546
617
  const set2 = ISet.create<number>([1, 2, 3, 4]);
547
618
 
548
619
  expect(set1.isSupersetOf(set2)).toBe(false);
@@ -552,6 +623,7 @@ describe('ISet.isSupersetOf', () => {
552
623
  describe('ISet.subtract', () => {
553
624
  test('case 1', () => {
554
625
  const s0 = ISet.create<number>([1, 2, 3]);
626
+
555
627
  const s1 = ISet.create<number>([2, 4]);
556
628
 
557
629
  expectType<typeof s0.subtract, (other: ISet<number>) => ISet<number>>('<=');
@@ -561,6 +633,7 @@ describe('ISet.subtract', () => {
561
633
 
562
634
  test('case 2', () => {
563
635
  const s0 = ISet.create<number>([1, 2, 3]);
636
+
564
637
  const s1 = ISet.create<number>([]);
565
638
 
566
639
  assert.deepStrictEqual(s0.subtract(s1), ISet.create<number>([1, 2, 3]));
@@ -568,6 +641,7 @@ describe('ISet.subtract', () => {
568
641
 
569
642
  test('case 3', () => {
570
643
  const s0 = ISet.create<number>([]);
644
+
571
645
  const s1 = ISet.create<number>([1, 2, 3]);
572
646
 
573
647
  assert.deepStrictEqual(s0.subtract(s1), ISet.create<number>([]));
@@ -575,17 +649,23 @@ describe('ISet.subtract', () => {
575
649
 
576
650
  test('should return elements in first set but not in second', () => {
577
651
  const set1 = ISet.create<number>([1, 2, 3, 4, 5]);
652
+
578
653
  const set2 = ISet.create<number>([3, 4, 5, 6, 7]);
654
+
579
655
  const result = set1.subtract(set2);
580
656
 
581
657
  expect(result.size).toBe(2);
658
+
582
659
  expect(result.has(1)).toBe(true);
660
+
583
661
  expect(result.has(2)).toBe(true);
584
662
  });
585
663
 
586
664
  test('should return empty set when all elements are removed', () => {
587
665
  const set1 = ISet.create<number>([1, 2, 3]);
666
+
588
667
  const set2 = ISet.create<number>([1, 2, 3, 4, 5]);
668
+
589
669
  const result = set1.subtract(set2);
590
670
 
591
671
  expect(result.isEmpty).toBe(true);
@@ -595,6 +675,7 @@ describe('ISet.subtract', () => {
595
675
  describe('ISet.intersection', () => {
596
676
  test('case 1', () => {
597
677
  const s0 = ISet.create<number>([1, 2, 3]);
678
+
598
679
  const s1 = ISet.create<number>([2, 3, 4]);
599
680
 
600
681
  expectType<
@@ -610,6 +691,7 @@ describe('ISet.intersection', () => {
610
691
 
611
692
  test('case 2', () => {
612
693
  const s0 = ISet.create<number>([1, 2, 3]);
694
+
613
695
  const s1 = ISet.create<number>([]);
614
696
 
615
697
  assert.deepStrictEqual(ISet.intersection(s0, s1), ISet.create<number>([]));
@@ -617,6 +699,7 @@ describe('ISet.intersection', () => {
617
699
 
618
700
  test('case 3', () => {
619
701
  const s0 = ISet.create<number>([]);
702
+
620
703
  const s1 = ISet.create<number>([1, 2, 3]);
621
704
 
622
705
  assert.deepStrictEqual(ISet.intersection(s0, s1), ISet.create<number>([]));
@@ -624,17 +707,23 @@ describe('ISet.intersection', () => {
624
707
 
625
708
  test('should return common elements', () => {
626
709
  const set1 = ISet.create<number>([1, 2, 3, 4]);
710
+
627
711
  const set2 = ISet.create<number>([3, 4, 5, 6]);
712
+
628
713
  const result = ISet.intersection(set1, set2);
629
714
 
630
715
  expect(result.size).toBe(2);
716
+
631
717
  expect(result.has(3)).toBe(true);
718
+
632
719
  expect(result.has(4)).toBe(true);
633
720
  });
634
721
 
635
722
  test('should return empty set when no common elements', () => {
636
723
  const set1 = ISet.create<number>([1, 2]);
724
+
637
725
  const set2 = ISet.create<number>([3, 4]);
726
+
638
727
  const result = ISet.intersection(set1, set2);
639
728
 
640
729
  expect(result.isEmpty).toBe(true);
@@ -644,6 +733,7 @@ describe('ISet.intersection', () => {
644
733
  describe('ISet.intersect', () => {
645
734
  test('case 1', () => {
646
735
  const s0 = ISet.create<number>([1, 2, 3]);
736
+
647
737
  const s1 = ISet.create<number>([2, 3, 4]);
648
738
 
649
739
  expectType<typeof s0.intersect, (other: ISet<number>) => ISet<number>>(
@@ -655,6 +745,7 @@ describe('ISet.intersect', () => {
655
745
 
656
746
  test('case 2', () => {
657
747
  const s0 = ISet.create<number>([1, 2, 3]);
748
+
658
749
  const s1 = ISet.create<number>([]);
659
750
 
660
751
  assert.deepStrictEqual(s0.intersect(s1), ISet.create<number>([]));
@@ -662,6 +753,7 @@ describe('ISet.intersect', () => {
662
753
 
663
754
  test('case 3', () => {
664
755
  const s0 = ISet.create<number>([]);
756
+
665
757
  const s1 = ISet.create<number>([1, 2, 3]);
666
758
 
667
759
  assert.deepStrictEqual(s0.intersect(s1), ISet.create<number>([]));
@@ -669,11 +761,15 @@ describe('ISet.intersect', () => {
669
761
 
670
762
  test('should return common elements using instance method', () => {
671
763
  const set1 = ISet.create<number>([1, 2, 3, 4]);
764
+
672
765
  const set2 = ISet.create<number>([3, 4, 5, 6]);
766
+
673
767
  const result = set1.intersect(set2);
674
768
 
675
769
  expect(result.size).toBe(2);
770
+
676
771
  expect(result.has(3)).toBe(true);
772
+
677
773
  expect(result.has(4)).toBe(true);
678
774
  });
679
775
  });
@@ -681,6 +777,7 @@ describe('ISet.intersect', () => {
681
777
  describe('ISet.union', () => {
682
778
  test('case 1', () => {
683
779
  const s0 = ISet.create<number>([1, 2, 3]);
780
+
684
781
  const s1 = ISet.create<number>([3, 4, 5]);
685
782
 
686
783
  expectType<
@@ -696,6 +793,7 @@ describe('ISet.union', () => {
696
793
 
697
794
  test('case 2', () => {
698
795
  const s0 = ISet.create([1, 2, 3]);
796
+
699
797
  const s1 = ISet.create<number>([]);
700
798
 
701
799
  assert.deepStrictEqual(ISet.union(s0, s1), ISet.create<number>([1, 2, 3]));
@@ -703,6 +801,7 @@ describe('ISet.union', () => {
703
801
 
704
802
  test('case 3', () => {
705
803
  const s0 = ISet.create<number>([]);
804
+
706
805
  const s1 = ISet.create<number>([1, 2, 3]);
707
806
 
708
807
  assert.deepStrictEqual(ISet.union(s0, s1), ISet.create<number>([1, 2, 3]));
@@ -710,20 +809,28 @@ describe('ISet.union', () => {
710
809
 
711
810
  test('should return combined elements using static method', () => {
712
811
  const set1 = ISet.create<number>([1, 2, 3]);
812
+
713
813
  const set2 = ISet.create<number>([3, 4, 5]);
814
+
714
815
  const result = ISet.union(set1, set2);
715
816
 
716
817
  expect(result.size).toBe(5);
818
+
717
819
  expect(result.has(1)).toBe(true);
820
+
718
821
  expect(result.has(2)).toBe(true);
822
+
719
823
  expect(result.has(3)).toBe(true);
824
+
720
825
  expect(result.has(4)).toBe(true);
826
+
721
827
  expect(result.has(5)).toBe(true);
722
828
  });
723
829
 
724
830
  describe('instance method', () => {
725
831
  test('case 1', () => {
726
832
  const s0 = ISet.create([1, 2, 3] as const);
833
+
727
834
  const s1 = ISet.create([3, 4, 5] as const);
728
835
 
729
836
  expectType<typeof s0.union, (other: ISet<number>) => ISet<number>>('<=');
@@ -736,6 +843,7 @@ describe('ISet.union', () => {
736
843
 
737
844
  test('case 2', () => {
738
845
  const s0 = ISet.create<number>([1, 2, 3]);
846
+
739
847
  const s1 = ISet.create<number>([]);
740
848
 
741
849
  assert.deepStrictEqual(s0.union(s1), ISet.create<number>([1, 2, 3]));
@@ -743,6 +851,7 @@ describe('ISet.union', () => {
743
851
 
744
852
  test('case 3', () => {
745
853
  const s0 = ISet.create<number>([]);
854
+
746
855
  const s1 = ISet.create<number>([1, 2, 3]);
747
856
 
748
857
  assert.deepStrictEqual(s0.union(s1), ISet.create<number>([1, 2, 3]));
@@ -750,14 +859,21 @@ describe('ISet.union', () => {
750
859
 
751
860
  test('should return combined elements using instance method', () => {
752
861
  const set1 = ISet.create<number>([1, 2, 3]);
862
+
753
863
  const set2 = ISet.create<number>([3, 4, 5]);
864
+
754
865
  const result = set1.union(set2);
755
866
 
756
867
  expect(result.size).toBe(5);
868
+
757
869
  expect(result.has(1)).toBe(true);
870
+
758
871
  expect(result.has(2)).toBe(true);
872
+
759
873
  expect(result.has(3)).toBe(true);
874
+
760
875
  expect(result.has(4)).toBe(true);
876
+
761
877
  expect(result.has(5)).toBe(true);
762
878
  });
763
879
  });
@@ -773,6 +889,7 @@ describe('ISet.forEach', () => {
773
889
  >('<=');
774
890
 
775
891
  const mut_result: (1 | 2 | 3)[] = [];
892
+
776
893
  for (const x of s0) {
777
894
  mut_result.push(x);
778
895
  }
@@ -785,6 +902,7 @@ describe('ISet.forEach', () => {
785
902
 
786
903
  test('should execute callback for each element', () => {
787
904
  const set = ISet.create([1, 2, 3]);
905
+
788
906
  const mut_collected: number[] = [];
789
907
 
790
908
  for (const value of set) {
@@ -799,6 +917,7 @@ describe('ISet.forEach', () => {
799
917
 
800
918
  test('should not call callback for empty set', () => {
801
919
  const set = ISet.create<number>([]);
920
+
802
921
  let mut_callCount = 0;
803
922
 
804
923
  // eslint-disable-next-line unicorn/no-array-for-each
@@ -817,6 +936,7 @@ describe('ISet.keys', () => {
817
936
  expectType<typeof s0.keys, () => IterableIterator<1 | 2 | 3>>('<=');
818
937
 
819
938
  const mut_result: (1 | 2 | 3)[] = [];
939
+
820
940
  for (const x of s0.keys()) {
821
941
  mut_result.push(x);
822
942
  }
@@ -835,6 +955,7 @@ describe('ISet.values', () => {
835
955
  expectType<typeof s0.values, () => IterableIterator<1 | 2 | 3>>('<=');
836
956
 
837
957
  const mut_result: (1 | 2 | 3)[] = [];
958
+
838
959
  for (const x of s0.values()) {
839
960
  mut_result.push(x);
840
961
  }
@@ -856,6 +977,7 @@ describe('ISet.entries', () => {
856
977
  >('<=');
857
978
 
858
979
  const mut_result: [1 | 2 | 3, 1 | 2 | 3][] = [];
980
+
859
981
  for (const x of s0.entries()) {
860
982
  mut_result.push([x[0], x[1]]);
861
983
  }
@@ -891,6 +1013,7 @@ describe('ISet.toArray', () => {
891
1013
 
892
1014
  test('should convert set to array', () => {
893
1015
  const set = ISet.create([1, 3, 2]);
1016
+
894
1017
  const array = set.toArray();
895
1018
 
896
1019
  expect(array).toHaveLength(3);
@@ -905,16 +1028,21 @@ describe('ISet.toArray', () => {
905
1028
  describe('ISet.toRawSet', () => {
906
1029
  test('should return underlying ReadonlySet', () => {
907
1030
  const set = ISet.create([1, 2, 3]);
1031
+
908
1032
  const rawSet = set.toRawSet();
909
1033
 
910
1034
  expect(rawSet.size).toBe(3);
1035
+
911
1036
  expect(rawSet.has(1)).toBe(true);
1037
+
912
1038
  expect(rawSet.has(2)).toBe(true);
1039
+
913
1040
  expect(rawSet.has(3)).toBe(true);
914
1041
  });
915
1042
 
916
1043
  test('should return empty ReadonlySet for empty ISet', () => {
917
1044
  const set = ISet.create<number>([]);
1045
+
918
1046
  const rawSet = set.toRawSet();
919
1047
 
920
1048
  expect(rawSet.size).toBe(0);
@@ -924,6 +1052,7 @@ describe('ISet.toRawSet', () => {
924
1052
  describe('ISet.equal', () => {
925
1053
  test('should return true for equal sets', () => {
926
1054
  const set1 = ISet.create([1, 2, 3]);
1055
+
927
1056
  const set2 = ISet.create([3, 2, 1]); // Different order
928
1057
 
929
1058
  expect(ISet.equal(set1, set2)).toBe(true);
@@ -931,6 +1060,7 @@ describe('ISet.equal', () => {
931
1060
 
932
1061
  test('should return false for sets with different sizes', () => {
933
1062
  const set1 = ISet.create<'a' | 'b' | 'c' | 'd'>(['a', 'b']);
1063
+
934
1064
  const set2 = ISet.create<'a' | 'b' | 'c' | 'd'>(['a', 'b', 'c']);
935
1065
 
936
1066
  expect(ISet.equal(set1, set2)).toBe(false);
@@ -938,6 +1068,7 @@ describe('ISet.equal', () => {
938
1068
 
939
1069
  test('should return false for sets with different elements', () => {
940
1070
  const set1 = ISet.create<'a' | 'b' | 'c' | 'd'>(['a', 'b', 'c']);
1071
+
941
1072
  const set2 = ISet.create<'a' | 'b' | 'c' | 'd'>(['a', 'b', 'd']);
942
1073
 
943
1074
  expect(ISet.equal(set1, set2)).toBe(false);
@@ -945,6 +1076,7 @@ describe('ISet.equal', () => {
945
1076
 
946
1077
  test('should return true for empty sets', () => {
947
1078
  const set1 = ISet.create<string>([]);
1079
+
948
1080
  const set2 = ISet.create<string>([]);
949
1081
 
950
1082
  expect(ISet.equal(set1, set2)).toBe(true);
@@ -952,6 +1084,7 @@ describe('ISet.equal', () => {
952
1084
 
953
1085
  test('should handle sets with special values', () => {
954
1086
  const set1 = ISet.create([Number.NaN, null, undefined]);
1087
+
955
1088
  const set2 = ISet.create([undefined, Number.NaN, null]);
956
1089
 
957
1090
  expect(ISet.equal(set1, set2)).toBe(true);
@@ -961,54 +1094,67 @@ describe('ISet.equal', () => {
961
1094
  describe('ISet.diff', () => {
962
1095
  test('should compute differences between sets', () => {
963
1096
  const oldSet = ISet.create<'a' | 'b' | 'c' | 'd'>(['a', 'b', 'c']);
1097
+
964
1098
  const newSet = ISet.create<'a' | 'b' | 'c' | 'd'>(['b', 'c', 'd']);
965
1099
 
966
1100
  const diff = ISet.diff(oldSet, newSet);
967
1101
 
968
1102
  expect(diff.deleted.size).toBe(1);
1103
+
969
1104
  expect(diff.deleted.has('a')).toBe(true);
970
1105
 
971
1106
  expect(diff.added.size).toBe(1);
1107
+
972
1108
  expect(diff.added.has('d')).toBe(true);
973
1109
  });
974
1110
 
975
1111
  test('should handle no changes', () => {
976
1112
  const set1 = ISet.create(['a', 'b', 'c']);
1113
+
977
1114
  const set2 = ISet.create(['a', 'b', 'c']);
978
1115
 
979
1116
  const diff = ISet.diff(set1, set2);
980
1117
 
981
1118
  expect(diff.deleted.isEmpty).toBe(true);
1119
+
982
1120
  expect(diff.added.isEmpty).toBe(true);
983
1121
  });
984
1122
 
985
1123
  test('should handle complete replacement', () => {
986
1124
  const oldSet = ISet.create<'a' | 'b' | 'c' | 'd'>(['a', 'b']);
1125
+
987
1126
  const newSet = ISet.create<'a' | 'b' | 'c' | 'd'>(['c', 'd']);
988
1127
 
989
1128
  const diff = ISet.diff(oldSet, newSet);
990
1129
 
991
1130
  expect(diff.deleted.size).toBe(2);
1131
+
992
1132
  expect(diff.deleted.has('a')).toBe(true);
1133
+
993
1134
  expect(diff.deleted.has('b')).toBe(true);
994
1135
 
995
1136
  expect(diff.added.size).toBe(2);
1137
+
996
1138
  expect(diff.added.has('c')).toBe(true);
1139
+
997
1140
  expect(diff.added.has('d')).toBe(true);
998
1141
  });
999
1142
 
1000
1143
  test('should handle empty sets', () => {
1001
1144
  const emptySet = ISet.create<string>([]);
1145
+
1002
1146
  const nonEmptySet = ISet.create<string>(['a', 'b']);
1003
1147
 
1004
1148
  const diff1 = ISet.diff(emptySet, nonEmptySet);
1005
1149
 
1006
1150
  expect(diff1.deleted.isEmpty).toBe(true);
1151
+
1007
1152
  expect(diff1.added.size).toBe(2);
1008
1153
 
1009
1154
  const diff2 = ISet.diff(nonEmptySet, emptySet);
1010
1155
 
1011
1156
  expect(diff2.deleted.size).toBe(2);
1157
+
1012
1158
  expect(diff2.added.isEmpty).toBe(true);
1013
1159
  });
1014
1160
  });
@@ -1024,22 +1170,29 @@ describe('ISet.withMutations', () => {
1024
1170
  ]);
1025
1171
 
1026
1172
  expect(updated.size).toBe(3);
1173
+
1027
1174
  expect(updated.has('b')).toBe(true);
1175
+
1028
1176
  expect(updated.has('c')).toBe(true);
1177
+
1029
1178
  expect(updated.has('d')).toBe(true);
1179
+
1030
1180
  expect(updated.has('a')).toBe(false);
1031
1181
  });
1032
1182
 
1033
1183
  test('should handle empty mutations array', () => {
1034
1184
  const set = ISet.create(['a', 'b', 'c']);
1185
+
1035
1186
  const updated = set.withMutations([]);
1036
1187
 
1037
1188
  expect(updated.size).toBe(set.size);
1189
+
1038
1190
  expect(ISet.equal(set, updated)).toBe(true);
1039
1191
  });
1040
1192
 
1041
1193
  test('should handle duplicate operations', () => {
1042
1194
  const set = ISet.create<'a' | 'b'>(['a']);
1195
+
1043
1196
  const updated = set.withMutations([
1044
1197
  { type: 'add', key: 'a' }, // Already exists
1045
1198
  { type: 'delete', key: 'b' }, // Doesn't exist
@@ -1047,7 +1200,9 @@ describe('ISet.withMutations', () => {
1047
1200
  ]);
1048
1201
 
1049
1202
  expect(updated.size).toBe(2);
1203
+
1050
1204
  expect(updated.has('a')).toBe(true);
1205
+
1051
1206
  expect(updated.has('b')).toBe(true);
1052
1207
  });
1053
1208
  });
@@ -1055,6 +1210,7 @@ describe('ISet.withMutations', () => {
1055
1210
  describe('iterable functionality', () => {
1056
1211
  test('should work with for-of loops', () => {
1057
1212
  const set = ISet.create([1, 2, 3]);
1213
+
1058
1214
  const mut_collected: number[] = [];
1059
1215
 
1060
1216
  for (const value of set) {
@@ -1069,6 +1225,7 @@ describe('iterable functionality', () => {
1069
1225
 
1070
1226
  test('should work with spread operator', () => {
1071
1227
  const set = ISet.create([1, 2, 3]);
1228
+
1072
1229
  const array = Array.from(set);
1073
1230
 
1074
1231
  assert.deepStrictEqual(
@@ -1079,6 +1236,7 @@ describe('iterable functionality', () => {
1079
1236
 
1080
1237
  test('should work with Array.from', () => {
1081
1238
  const set = ISet.create([1, 2, 3]);
1239
+
1082
1240
  const array = Array.from(set);
1083
1241
 
1084
1242
  assert.deepStrictEqual(
@@ -1089,6 +1247,7 @@ describe('iterable functionality', () => {
1089
1247
 
1090
1248
  test('should work with destructuring', () => {
1091
1249
  const set = ISet.create([1, 2]);
1250
+
1092
1251
  const values = Array.from(set);
1093
1252
 
1094
1253
  assert.deepStrictEqual(
@@ -1103,6 +1262,7 @@ describe('edge cases', () => {
1103
1262
  const set = ISet.create([Number.NaN, 1, 2]);
1104
1263
 
1105
1264
  expect(set.has(Number.NaN)).toBe(true);
1265
+
1106
1266
  expect(set.size).toBe(3);
1107
1267
  });
1108
1268
 
@@ -1110,7 +1270,9 @@ describe('edge cases', () => {
1110
1270
  const set = ISet.create([true, false, true]);
1111
1271
 
1112
1272
  expect(set.size).toBe(2);
1273
+
1113
1274
  expect(set.has(true)).toBe(true);
1275
+
1114
1276
  expect(set.has(false)).toBe(true);
1115
1277
  });
1116
1278
 
@@ -1118,18 +1280,25 @@ describe('edge cases', () => {
1118
1280
  const set = ISet.create([null, undefined, null]);
1119
1281
 
1120
1282
  expect(set.size).toBe(2);
1283
+
1121
1284
  expect(set.has(null)).toBe(true);
1285
+
1122
1286
  expect(set.has(undefined)).toBe(true);
1123
1287
  });
1124
1288
 
1125
1289
  test('should handle symbols by reference', () => {
1126
1290
  const sym1 = Symbol('test');
1291
+
1127
1292
  const sym2 = Symbol('test'); // Different symbol, same description
1293
+
1128
1294
  const set = ISet.create([sym1, sym2]);
1129
1295
 
1130
1296
  expect(set.size).toBe(2);
1297
+
1131
1298
  expect(set.has(sym1)).toBe(true);
1299
+
1132
1300
  expect(set.has(sym2)).toBe(true);
1301
+
1133
1302
  expect(set.has(Symbol('test'))).toBe(false); // Different symbol
1134
1303
  });
1135
1304
  });
@@ -1137,57 +1306,81 @@ describe('edge cases', () => {
1137
1306
  describe('immutability', () => {
1138
1307
  test('should not modify original set when adding', () => {
1139
1308
  const original = ISet.create<number>([1, 2, 3]);
1309
+
1140
1310
  const modified = original.add(4);
1141
1311
 
1142
1312
  expect(original.size).toBe(3);
1313
+
1143
1314
  expect(modified.size).toBe(4);
1315
+
1144
1316
  expect(original.has(4)).toBe(false);
1317
+
1145
1318
  expect(modified.has(4)).toBe(true);
1146
1319
  });
1147
1320
 
1148
1321
  test('should not modify original set when deleting', () => {
1149
1322
  const original = ISet.create([1, 2, 3]);
1323
+
1150
1324
  const modified = original.delete(2);
1151
1325
 
1152
1326
  expect(original.size).toBe(3);
1327
+
1153
1328
  expect(modified.size).toBe(2);
1329
+
1154
1330
  expect(original.has(2)).toBe(true);
1331
+
1155
1332
  expect(modified.has(2)).toBe(false);
1156
1333
  });
1157
1334
 
1158
1335
  test('should not modify original set when filtering', () => {
1159
1336
  const original = ISet.create([1, 2, 3, 4, 5]);
1337
+
1160
1338
  const filtered = original.filter((x) => x % 2 === 0);
1161
1339
 
1162
1340
  expect(original.size).toBe(5);
1341
+
1163
1342
  expect(filtered.size).toBe(2);
1343
+
1164
1344
  expect(original.has(1)).toBe(true);
1345
+
1165
1346
  expect(filtered.has(1)).toBe(false);
1166
1347
  });
1167
1348
 
1168
1349
  test('should not modify original set when mapping', () => {
1169
1350
  const original = ISet.create([1, 2, 3]);
1351
+
1170
1352
  const mapped = original.map((x) => x * 2);
1171
1353
 
1172
1354
  expect(original.size).toBe(3);
1355
+
1173
1356
  expect(mapped.size).toBe(3);
1357
+
1174
1358
  expect(original.has(1)).toBe(true);
1359
+
1175
1360
  expect(mapped.has(1)).toBe(false);
1361
+
1176
1362
  expect(mapped.has(2)).toBe(true);
1177
1363
  });
1178
1364
 
1179
1365
  test('should not modify original sets during set operations', () => {
1180
1366
  const set1 = ISet.create<number>([1, 2, 3]);
1367
+
1181
1368
  const set2 = ISet.create<number>([3, 4, 5]);
1182
1369
 
1183
1370
  const union = set1.union(set2);
1371
+
1184
1372
  const intersection = set1.intersect(set2);
1373
+
1185
1374
  const difference = set1.subtract(set2);
1186
1375
 
1187
1376
  expect(set1.size).toBe(3);
1377
+
1188
1378
  expect(set2.size).toBe(3);
1379
+
1189
1380
  expect(union.size).toBe(5);
1381
+
1190
1382
  expect(intersection.size).toBe(1);
1383
+
1191
1384
  expect(difference.size).toBe(2);
1192
1385
  });
1193
1386
  });