ts-data-forge 8.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
  2. package/dist/array/impl/array-utils-creation.mjs +17 -112
  3. package/dist/array/impl/array-utils-creation.mjs.map +1 -1
  4. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  5. package/dist/array/impl/array-utils-element-access.mjs +22 -61
  6. package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
  7. package/dist/array/impl/array-utils-iterators.d.mts.map +1 -1
  8. package/dist/array/impl/array-utils-iterators.mjs +9 -63
  9. package/dist/array/impl/array-utils-iterators.mjs.map +1 -1
  10. package/dist/array/impl/array-utils-modification.mjs +78 -78
  11. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  12. package/dist/array/impl/array-utils-reducing-value.mjs +95 -89
  13. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  14. package/dist/array/impl/array-utils-search.mjs +100 -92
  15. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  16. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  17. package/dist/array/impl/array-utils-set-op.mjs +31 -141
  18. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  19. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  20. package/dist/array/impl/array-utils-size.mjs +4 -8
  21. package/dist/array/impl/array-utils-size.mjs.map +1 -1
  22. package/dist/array/impl/array-utils-slice-clamped.mjs +11 -12
  23. package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
  24. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  25. package/dist/array/impl/array-utils-slicing.mjs +44 -96
  26. package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
  27. package/dist/array/impl/array-utils-transformation.d.mts +1 -1
  28. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  29. package/dist/array/impl/array-utils-transformation.mjs +150 -292
  30. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  31. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  32. package/dist/array/impl/array-utils-validation.mjs +18 -169
  33. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  34. package/dist/collections/imap-mapped.d.mts.map +1 -1
  35. package/dist/collections/imap-mapped.mjs +243 -330
  36. package/dist/collections/imap-mapped.mjs.map +1 -1
  37. package/dist/collections/imap.d.mts.map +1 -1
  38. package/dist/collections/imap.mjs +190 -275
  39. package/dist/collections/imap.mjs.map +1 -1
  40. package/dist/collections/iset-mapped.d.mts +1 -1
  41. package/dist/collections/iset-mapped.d.mts.map +1 -1
  42. package/dist/collections/iset-mapped.mjs +222 -444
  43. package/dist/collections/iset-mapped.mjs.map +1 -1
  44. package/dist/collections/iset.d.mts +1 -1
  45. package/dist/collections/iset.d.mts.map +1 -1
  46. package/dist/collections/iset.mjs +158 -324
  47. package/dist/collections/iset.mjs.map +1 -1
  48. package/dist/collections/queue.d.mts.map +1 -1
  49. package/dist/collections/queue.mjs +106 -178
  50. package/dist/collections/queue.mjs.map +1 -1
  51. package/dist/collections/stack.d.mts.map +1 -1
  52. package/dist/collections/stack.mjs +95 -165
  53. package/dist/collections/stack.mjs.map +1 -1
  54. package/dist/entry-point.mjs +1 -0
  55. package/dist/entry-point.mjs.map +1 -1
  56. package/dist/expect-type.d.mts +1 -1
  57. package/dist/expect-type.d.mts.map +1 -1
  58. package/dist/expect-type.mjs +1 -69
  59. package/dist/expect-type.mjs.map +1 -1
  60. package/dist/functional/match.mjs +9 -9
  61. package/dist/functional/match.mjs.map +1 -1
  62. package/dist/functional/optional/impl/optional-expect-to-be.mjs +13 -14
  63. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  64. package/dist/functional/optional/impl/optional-filter.mjs +14 -15
  65. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  66. package/dist/functional/optional/impl/optional-flat-map.mjs +10 -11
  67. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  68. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  69. package/dist/functional/optional/impl/optional-from-nullable.mjs +1 -25
  70. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  71. package/dist/functional/optional/impl/optional-is-none.d.mts.map +1 -1
  72. package/dist/functional/optional/impl/optional-is-none.mjs +0 -19
  73. package/dist/functional/optional/impl/optional-is-none.mjs.map +1 -1
  74. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  75. package/dist/functional/optional/impl/optional-is-optional.mjs +1 -23
  76. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  77. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  78. package/dist/functional/optional/impl/optional-is-some.mjs +0 -20
  79. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  80. package/dist/functional/optional/impl/optional-map.mjs +13 -14
  81. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  82. package/dist/functional/optional/impl/optional-none.mjs +0 -16
  83. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  84. package/dist/functional/optional/impl/optional-or-else.mjs +10 -11
  85. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  86. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  87. package/dist/functional/optional/impl/optional-some.mjs +2 -21
  88. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  89. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  90. package/dist/functional/optional/impl/optional-to-nullable.mjs +1 -27
  91. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  92. package/dist/functional/optional/impl/optional-unwrap-or.mjs +9 -10
  93. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  94. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  95. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +4 -32
  96. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  97. package/dist/functional/optional/impl/optional-unwrap.mjs +4 -4
  98. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  99. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  100. package/dist/functional/optional/impl/optional-zip.mjs +1 -35
  101. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  102. package/dist/functional/optional/impl/tag.mjs +2 -3
  103. package/dist/functional/optional/impl/tag.mjs.map +1 -1
  104. package/dist/functional/pipe.d.mts.map +1 -1
  105. package/dist/functional/pipe.mjs +9 -34
  106. package/dist/functional/pipe.mjs.map +1 -1
  107. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  108. package/dist/functional/result/impl/result-err.mjs +2 -27
  109. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  110. package/dist/functional/result/impl/result-expect-to-be.mjs +13 -15
  111. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
  112. package/dist/functional/result/impl/result-flat-map.mjs +16 -16
  113. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
  114. package/dist/functional/result/impl/result-fold.mjs +16 -16
  115. package/dist/functional/result/impl/result-fold.mjs.map +1 -1
  116. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  117. package/dist/functional/result/impl/result-from-promise.mjs +4 -31
  118. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  119. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  120. package/dist/functional/result/impl/result-from-throwable.mjs +8 -38
  121. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
  122. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  123. package/dist/functional/result/impl/result-is-err.mjs +0 -19
  124. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  125. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  126. package/dist/functional/result/impl/result-is-ok.mjs +0 -19
  127. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  128. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  129. package/dist/functional/result/impl/result-is-result.mjs +1 -23
  130. package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
  131. package/dist/functional/result/impl/result-map-err.mjs +16 -16
  132. package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
  133. package/dist/functional/result/impl/result-map.mjs +16 -16
  134. package/dist/functional/result/impl/result-map.mjs.map +1 -1
  135. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  136. package/dist/functional/result/impl/result-ok.mjs +2 -27
  137. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  138. package/dist/functional/result/impl/result-or-else.mjs +10 -12
  139. package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
  140. package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
  141. package/dist/functional/result/impl/result-swap.mjs +4 -22
  142. package/dist/functional/result/impl/result-swap.mjs.map +1 -1
  143. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
  144. package/dist/functional/result/impl/result-to-optional.mjs +0 -27
  145. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
  146. package/dist/functional/result/impl/result-unwrap-err-or.mjs +9 -11
  147. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
  148. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
  149. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +13 -40
  150. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  151. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  152. package/dist/functional/result/impl/result-unwrap-err.mjs +4 -32
  153. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
  154. package/dist/functional/result/impl/result-unwrap-ok-or.mjs +9 -11
  155. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
  156. package/dist/functional/result/impl/result-unwrap-ok.mjs +4 -4
  157. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
  158. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  159. package/dist/functional/result/impl/result-unwrap-throw.mjs +4 -35
  160. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  161. package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
  162. package/dist/functional/result/impl/result-zip.mjs +1 -34
  163. package/dist/functional/result/impl/result-zip.mjs.map +1 -1
  164. package/dist/functional/result/impl/tag.mjs +2 -3
  165. package/dist/functional/result/impl/tag.mjs.map +1 -1
  166. package/dist/functional/ternary-result/impl/tag.mjs +3 -5
  167. package/dist/functional/ternary-result/impl/tag.mjs.map +1 -1
  168. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  169. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +2 -15
  170. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  171. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +13 -13
  172. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
  173. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +27 -26
  174. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
  175. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +21 -22
  176. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
  177. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
  178. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +4 -20
  179. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
  180. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
  181. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +7 -25
  182. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
  183. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +1 -1
  184. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +0 -17
  185. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +1 -1
  186. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
  187. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +0 -19
  188. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
  189. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
  190. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +1 -25
  191. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
  192. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
  193. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +0 -18
  194. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
  195. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +13 -15
  196. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
  197. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +18 -18
  198. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
  199. package/dist/functional/ternary-result/impl/ternary-result-map.mjs +21 -22
  200. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
  201. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  202. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +2 -16
  203. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  204. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +9 -9
  205. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
  206. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
  207. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +4 -22
  208. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
  209. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +9 -9
  210. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
  211. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
  212. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +12 -27
  213. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  214. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
  215. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +4 -19
  216. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
  217. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +9 -9
  218. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
  219. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +4 -5
  220. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
  221. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
  222. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +15 -27
  223. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  224. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +9 -9
  225. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
  226. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
  227. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +10 -24
  228. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  229. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
  230. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +4 -19
  231. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
  232. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  233. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +3 -19
  234. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  235. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
  236. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +14 -45
  237. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
  238. package/dist/functional/ternary-result/impl/variant-name.d.mts +1 -1
  239. package/dist/functional/ternary-result/impl/variant-name.d.mts.map +1 -1
  240. package/dist/functional/ternary-result/impl/variant-name.mjs +8 -9
  241. package/dist/functional/ternary-result/impl/variant-name.mjs.map +1 -1
  242. package/dist/functional/ternary-result/ternary-result.d.mts.map +1 -1
  243. package/dist/guard/has-key.d.mts.map +1 -1
  244. package/dist/guard/has-key.mjs +0 -41
  245. package/dist/guard/has-key.mjs.map +1 -1
  246. package/dist/guard/index.d.mts +1 -0
  247. package/dist/guard/index.d.mts.map +1 -1
  248. package/dist/guard/index.mjs +1 -0
  249. package/dist/guard/index.mjs.map +1 -1
  250. package/dist/guard/is-length-bounded-string.d.mts +164 -0
  251. package/dist/guard/is-length-bounded-string.d.mts.map +1 -0
  252. package/dist/guard/is-length-bounded-string.mjs +7 -0
  253. package/dist/guard/is-length-bounded-string.mjs.map +1 -0
  254. package/dist/guard/is-non-empty-string.d.mts +1 -1
  255. package/dist/guard/is-non-empty-string.d.mts.map +1 -1
  256. package/dist/guard/is-non-empty-string.mjs +1 -38
  257. package/dist/guard/is-non-empty-string.mjs.map +1 -1
  258. package/dist/guard/is-non-null-object.d.mts.map +1 -1
  259. package/dist/guard/is-non-null-object.mjs +1 -35
  260. package/dist/guard/is-non-null-object.mjs.map +1 -1
  261. package/dist/guard/is-primitive.d.mts.map +1 -1
  262. package/dist/guard/is-primitive.mjs +12 -43
  263. package/dist/guard/is-primitive.mjs.map +1 -1
  264. package/dist/guard/is-record.d.mts.map +1 -1
  265. package/dist/guard/is-record.mjs +0 -86
  266. package/dist/guard/is-record.mjs.map +1 -1
  267. package/dist/guard/is-type.d.mts.map +1 -1
  268. package/dist/guard/is-type.mjs +12 -399
  269. package/dist/guard/is-type.mjs.map +1 -1
  270. package/dist/guard/key-is-in.d.mts.map +1 -1
  271. package/dist/guard/key-is-in.mjs +0 -40
  272. package/dist/guard/key-is-in.mjs.map +1 -1
  273. package/dist/index.mjs +1 -0
  274. package/dist/index.mjs.map +1 -1
  275. package/dist/iterator/range.mjs +16 -16
  276. package/dist/iterator/range.mjs.map +1 -1
  277. package/dist/json/json.d.mts.map +1 -1
  278. package/dist/json/json.mjs +52 -340
  279. package/dist/json/json.mjs.map +1 -1
  280. package/dist/number/branded-types/finite-number.d.mts +3 -3
  281. package/dist/number/branded-types/finite-number.mjs +135 -154
  282. package/dist/number/branded-types/finite-number.mjs.map +1 -1
  283. package/dist/number/branded-types/int.d.mts +4 -4
  284. package/dist/number/branded-types/int.mjs +205 -245
  285. package/dist/number/branded-types/int.mjs.map +1 -1
  286. package/dist/number/branded-types/int16.d.mts +15 -15
  287. package/dist/number/branded-types/int16.mjs +116 -123
  288. package/dist/number/branded-types/int16.mjs.map +1 -1
  289. package/dist/number/branded-types/int32.d.mts +11 -11
  290. package/dist/number/branded-types/int32.mjs +116 -123
  291. package/dist/number/branded-types/int32.mjs.map +1 -1
  292. package/dist/number/branded-types/negative-finite-number.d.mts +4 -4
  293. package/dist/number/branded-types/negative-finite-number.mjs +129 -144
  294. package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
  295. package/dist/number/branded-types/negative-int.d.mts +5 -5
  296. package/dist/number/branded-types/negative-int.mjs +94 -113
  297. package/dist/number/branded-types/negative-int.mjs.map +1 -1
  298. package/dist/number/branded-types/negative-safe-int.d.mts +5 -5
  299. package/dist/number/branded-types/negative-safe-int.mjs +103 -124
  300. package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
  301. package/dist/number/branded-types/non-negative-finite-number.d.mts +5 -5
  302. package/dist/number/branded-types/non-negative-finite-number.mjs +136 -142
  303. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
  304. package/dist/number/branded-types/non-negative-int16.d.mts +16 -16
  305. package/dist/number/branded-types/non-negative-int16.mjs +109 -118
  306. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
  307. package/dist/number/branded-types/non-negative-int32.d.mts +12 -12
  308. package/dist/number/branded-types/non-negative-int32.mjs +110 -119
  309. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
  310. package/dist/number/branded-types/non-positive-finite-number.d.mts +3 -3
  311. package/dist/number/branded-types/non-positive-finite-number.mjs +120 -124
  312. package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
  313. package/dist/number/branded-types/non-positive-int.d.mts +4 -4
  314. package/dist/number/branded-types/non-positive-int.mjs +167 -212
  315. package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
  316. package/dist/number/branded-types/non-positive-safe-int.d.mts +4 -4
  317. package/dist/number/branded-types/non-positive-safe-int.mjs +95 -106
  318. package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
  319. package/dist/number/branded-types/non-zero-finite-number.d.mts +4 -4
  320. package/dist/number/branded-types/non-zero-finite-number.mjs +114 -123
  321. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
  322. package/dist/number/branded-types/non-zero-int.d.mts +2 -2
  323. package/dist/number/branded-types/non-zero-int.mjs +72 -83
  324. package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
  325. package/dist/number/branded-types/non-zero-int16.d.mts +7 -7
  326. package/dist/number/branded-types/non-zero-int16.mjs +96 -107
  327. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
  328. package/dist/number/branded-types/non-zero-int32.d.mts +5 -5
  329. package/dist/number/branded-types/non-zero-int32.mjs +97 -108
  330. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
  331. package/dist/number/branded-types/non-zero-safe-int.d.mts +2 -2
  332. package/dist/number/branded-types/non-zero-safe-int.mjs +100 -111
  333. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
  334. package/dist/number/branded-types/non-zero-uint16.d.mts +8 -8
  335. package/dist/number/branded-types/non-zero-uint16.mjs +96 -107
  336. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
  337. package/dist/number/branded-types/non-zero-uint32.d.mts +6 -6
  338. package/dist/number/branded-types/non-zero-uint32.mjs +96 -107
  339. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
  340. package/dist/number/branded-types/positive-finite-number.d.mts +8 -8
  341. package/dist/number/branded-types/positive-finite-number.mjs +139 -141
  342. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
  343. package/dist/number/branded-types/positive-int.d.mts +11 -11
  344. package/dist/number/branded-types/positive-int.mjs +228 -271
  345. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  346. package/dist/number/branded-types/positive-int16.d.mts +19 -19
  347. package/dist/number/branded-types/positive-int16.mjs +109 -118
  348. package/dist/number/branded-types/positive-int16.mjs.map +1 -1
  349. package/dist/number/branded-types/positive-int32.d.mts +15 -15
  350. package/dist/number/branded-types/positive-int32.mjs +109 -118
  351. package/dist/number/branded-types/positive-int32.mjs.map +1 -1
  352. package/dist/number/branded-types/positive-safe-int.d.mts +11 -11
  353. package/dist/number/branded-types/positive-safe-int.mjs +244 -275
  354. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  355. package/dist/number/branded-types/positive-uint16.d.mts +17 -17
  356. package/dist/number/branded-types/positive-uint16.mjs +109 -118
  357. package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
  358. package/dist/number/branded-types/positive-uint32.d.mts +13 -13
  359. package/dist/number/branded-types/positive-uint32.mjs +110 -119
  360. package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
  361. package/dist/number/branded-types/safe-int.d.mts +4 -4
  362. package/dist/number/branded-types/safe-int.mjs +251 -292
  363. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  364. package/dist/number/branded-types/safe-uint.d.mts +8 -8
  365. package/dist/number/branded-types/safe-uint.mjs +111 -119
  366. package/dist/number/branded-types/safe-uint.mjs.map +1 -1
  367. package/dist/number/branded-types/uint.d.mts +8 -8
  368. package/dist/number/branded-types/uint.mjs +198 -225
  369. package/dist/number/branded-types/uint.mjs.map +1 -1
  370. package/dist/number/branded-types/uint16.d.mts +14 -14
  371. package/dist/number/branded-types/uint16.mjs +109 -119
  372. package/dist/number/branded-types/uint16.mjs.map +1 -1
  373. package/dist/number/branded-types/uint32.d.mts +10 -10
  374. package/dist/number/branded-types/uint32.mjs +110 -117
  375. package/dist/number/branded-types/uint32.mjs.map +1 -1
  376. package/dist/number/enum/int8.mjs +119 -145
  377. package/dist/number/enum/int8.mjs.map +1 -1
  378. package/dist/number/enum/uint8.mjs +107 -121
  379. package/dist/number/enum/uint8.mjs.map +1 -1
  380. package/dist/number/num.d.mts +2 -2
  381. package/dist/number/num.d.mts.map +1 -1
  382. package/dist/number/num.mjs +76 -537
  383. package/dist/number/num.mjs.map +1 -1
  384. package/dist/number/refined-number-utils.d.mts +1 -1
  385. package/dist/number/refined-number-utils.d.mts.map +1 -1
  386. package/dist/number/refined-number-utils.mjs +127 -263
  387. package/dist/number/refined-number-utils.mjs.map +1 -1
  388. package/dist/object/object.d.mts.map +1 -1
  389. package/dist/object/object.mjs +107 -222
  390. package/dist/object/object.mjs.map +1 -1
  391. package/dist/others/cast-mutable.d.mts.map +1 -1
  392. package/dist/others/cast-mutable.mjs +8 -37
  393. package/dist/others/cast-mutable.mjs.map +1 -1
  394. package/dist/others/cast-readonly.d.mts.map +1 -1
  395. package/dist/others/cast-readonly.mjs +8 -36
  396. package/dist/others/cast-readonly.mjs.map +1 -1
  397. package/dist/others/debounce-function.d.mts.map +1 -1
  398. package/dist/others/debounce-function.mjs +7 -16
  399. package/dist/others/debounce-function.mjs.map +1 -1
  400. package/dist/others/fast-deep-equal.d.mts.map +1 -1
  401. package/dist/others/fast-deep-equal.mjs +43 -59
  402. package/dist/others/fast-deep-equal.mjs.map +1 -1
  403. package/dist/others/if-then.d.mts.map +1 -1
  404. package/dist/others/if-then.mjs +0 -29
  405. package/dist/others/if-then.mjs.map +1 -1
  406. package/dist/others/map-nullable.mjs +9 -9
  407. package/dist/others/map-nullable.mjs.map +1 -1
  408. package/dist/others/memoize-function.mjs +12 -12
  409. package/dist/others/memoize-function.mjs.map +1 -1
  410. package/dist/others/tuple.d.mts.map +1 -1
  411. package/dist/others/tuple.mjs +0 -50
  412. package/dist/others/tuple.mjs.map +1 -1
  413. package/dist/others/unknown-to-string.d.mts.map +1 -1
  414. package/dist/others/unknown-to-string.mjs +41 -88
  415. package/dist/others/unknown-to-string.mjs.map +1 -1
  416. package/dist/promise/promise.d.mts.map +1 -1
  417. package/dist/promise/promise.mjs +4 -49
  418. package/dist/promise/promise.mjs.map +1 -1
  419. package/package.json +17 -16
  420. package/src/array/impl/array-utils-transformation.mts +1 -2
  421. package/src/array/impl/array-utils-transformation.test.mts +3 -36
  422. package/src/array/impl/array-utils-validation.test.mts +1 -3
  423. package/src/expect-type.mts +4 -5
  424. package/src/functional/ternary-result/ternary-result.mts +2 -6
  425. package/src/guard/index.mts +1 -0
  426. package/src/guard/is-length-bounded-string.mts +199 -0
  427. package/src/guard/is-length-bounded-string.test.mts +170 -0
  428. package/src/number/refined-number-utils.mts +1 -9
  429. package/src/object/object.mts +25 -23
@@ -37,333 +37,167 @@ import '../number/refined-number-utils.mjs';
37
37
  import '@sindresorhus/is';
38
38
  import { unknownToString } from '../others/unknown-to-string.mjs';
39
39
 
40
- /** Provides utility functions for ISet. */
41
40
  var ISet;
42
- (function (ISet) {
43
- /**
44
- * Creates a new ISet instance from an iterable of elements.
45
- *
46
- * This factory function accepts any iterable of elements, including arrays,
47
- * JavaScript Sets, other ISets, or custom iterables. Duplicate elements in
48
- * the input iterable will be automatically deduplicated in the resulting
49
- * set.
50
- *
51
- * **Performance:** O(n) where n is the number of elements in the iterable.
52
- *
53
- * @example
54
- *
55
- * ```ts
56
- * const set = ISet.create(['a', 'a', 'b']);
57
- *
58
- * assert.deepStrictEqual(Array.from(set), ['a', 'b']);
59
- * ```
60
- *
61
- * @template K The type of the elements. Must extend MapSetKeyType.
62
- * @param iterable An iterable of elements (e.g., Array, Set, ISet, etc.)
63
- * @returns A new ISet instance containing all unique elements from the
64
- * iterable.
65
- */
66
- ISet.create = (iterable) => new ISetClass(iterable);
67
- /**
68
- * Checks if two ISet instances are structurally equal.
69
- *
70
- * Two ISets are considered equal if they have the same size and contain
71
- * exactly the same elements. The order of elements does not matter for
72
- * equality comparison since sets are unordered collections. Elements are
73
- * compared using JavaScript's `===` operator.
74
- *
75
- * **Performance:** O(n) where n is the size of the smaller set.
76
- *
77
- * @example
78
- *
79
- * ```ts
80
- * const first = ISet.create<number>([1, 2]);
81
- *
82
- * const second = ISet.create<number>([2, 1]);
83
- *
84
- * const third = ISet.create<number>([1, 3]);
85
- *
86
- * assert.isTrue(ISet.equal(first, second));
87
- *
88
- * assert.isFalse(ISet.equal(first, third));
89
- * ```
90
- *
91
- * @template K The type of the elements.
92
- * @param a The first ISet instance to compare.
93
- * @param b The second ISet instance to compare.
94
- * @returns `true` if the sets contain exactly the same elements, `false`
95
- * otherwise.
96
- */
97
- ISet.equal = (a, b) => a.size === b.size && a.every((e) => b.has(e));
98
- /**
99
- * Computes the difference between two ISet instances, identifying added and
100
- * deleted elements.
101
- *
102
- * This function performs a set difference operation to determine what
103
- * elements were added and what elements were deleted when transitioning from
104
- * the old set to the new set. This is useful for change detection, state
105
- * management, and synchronization scenarios.
106
- *
107
- * **Performance:** O(n + m) where n and m are the sizes of the old and new
108
- * sets respectively.
109
- *
110
- * @example
111
- *
112
- * ```ts
113
- * const previous = ISet.create<string>(['draft', 'review']);
114
- *
115
- * const current = ISet.create<string>(['review', 'published']);
116
- *
117
- * const { added, deleted } = ISet.diff(previous, current);
118
- *
119
- * assert.deepStrictEqual(Array.from(added), ['published']);
120
- *
121
- * assert.deepStrictEqual(Array.from(deleted), ['draft']);
122
- * ```
123
- *
124
- * @template K The type of the elements.
125
- * @param oldSet The original set representing the previous state.
126
- * @param newSet The new set representing the current state.
127
- * @returns An object with `added` and `deleted` properties, each containing
128
- * an ISet of elements that were added or removed respectively.
129
- */
130
- ISet.diff = (oldSet, newSet) => ({
131
- deleted: oldSet.subtract(newSet),
132
- added: newSet.subtract(oldSet),
133
- });
134
- /**
135
- * Computes the intersection of two ISet instances.
136
- *
137
- * Returns a new set containing only the elements that are present in both
138
- * input sets. This operation is commutative: `intersection(a, b) ===
139
- * intersection(b, a)`.
140
- *
141
- * **Performance:** O(min(n, m)) where n and m are the sizes of the input
142
- * sets.
143
- *
144
- * @example
145
- *
146
- * ```ts
147
- * const left = ISet.create<number>([1, 2, 3]);
148
- *
149
- * const right = ISet.create<number>([2, 4]);
150
- *
151
- * const overlap = ISet.intersection(left, right);
152
- *
153
- * assert.deepStrictEqual(Array.from(overlap), [2]);
154
- * ```
155
- *
156
- * @template K The type of the elements.
157
- * @param a The first set.
158
- * @param b The second set.
159
- * @returns A new ISet instance containing elements common to both sets.
160
- */
161
- ISet.intersection = (a, b) => a.intersect(b);
162
- /**
163
- * Computes the union of two ISet instances.
164
- *
165
- * Returns a new set containing all elements that are present in either input
166
- * set. Duplicate elements are automatically handled since sets only contain
167
- * unique values. This operation is commutative: `union(a, b) === union(b,
168
- * a)`.
169
- *
170
- * **Performance:** O(n + m) where n and m are the sizes of the input sets.
171
- *
172
- * @example
173
- *
174
- * ```ts
175
- * const numbers = ISet.create([1, 2]);
176
- *
177
- * const words = ISet.create(['one', 'two']);
178
- *
179
- * const union = ISet.union(numbers, words);
180
- *
181
- * assert.deepStrictEqual(Array.from(union), [1, 2, 'one', 'two']);
182
- * ```
183
- *
184
- * @template K1 The type of elements in the first set.
185
- * @template K2 The type of elements in the second set.
186
- * @param a The first set.
187
- * @param b The second set.
188
- * @returns A new ISet instance containing all elements from both sets.
189
- */
190
- ISet.union = (a, b) => a.union(b);
41
+ ((ISet2) => {
42
+ ISet2.create = (iterable) => new ISetClass(iterable);
43
+ ISet2.equal = (a, b) => a.size === b.size && a.every((e) => b.has(e));
44
+ ISet2.diff = (oldSet, newSet) => ({
45
+ deleted: oldSet.subtract(newSet),
46
+ added: newSet.subtract(oldSet)
47
+ });
48
+ ISet2.intersection = (a, b) => a.intersect(b);
49
+ ISet2.union = (a, b) => a.union(b);
191
50
  })(ISet || (ISet = {}));
192
- /**
193
- * Internal class implementation for ISet providing immutable set operations.
194
- *
195
- * This class implements the ISet interface using JavaScript's native Set as the
196
- * underlying storage mechanism for optimal performance. All mutation operations
197
- * create new instances rather than modifying the existing set, ensuring
198
- * immutability.
199
- *
200
- * **Implementation Details:**
201
- *
202
- * - Uses ReadonlySet<K> internally for type safety and performance
203
- * - Implements copy-on-write semantics for efficiency
204
- * - Provides optional debug messaging for development
205
- *
206
- * @template K The type of the elements. Must extend MapSetKeyType.
207
- * @implements ISet
208
- * @implements Iterable
209
- * @internal This class should not be used directly. Use ISet.create() instead.
210
- */
211
51
  class ISetClass {
212
- #set;
213
- #showNotFoundMessage;
214
- /**
215
- * Constructs an ISetClass instance with the given elements.
216
- *
217
- * @param iterable An iterable of elements to populate the set.
218
- * @param showNotFoundMessage Whether to log warning messages when operations
219
- * are performed on non-existent elements. Useful for debugging. Defaults to
220
- * false for production use.
221
- * @internal Use ISet.create() instead of calling this constructor directly.
222
- */
223
- constructor(iterable, showNotFoundMessage = false) {
224
- this.#set = new Set(iterable);
225
- this.#showNotFoundMessage = showNotFoundMessage;
226
- }
227
- /** @inheritdoc */
228
- get size() {
229
- return asUint32(this.#set.size);
230
- }
231
- /** @inheritdoc */
232
- get isEmpty() {
233
- return this.size === 0;
234
- }
235
- /** @inheritdoc */
236
- has(key) {
237
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
238
- return this.#set.has(key);
239
- }
240
- /** @inheritdoc */
241
- every(predicate) {
242
- for (const key of this.values()) {
243
- if (!predicate(key))
244
- return false;
245
- }
246
- return true;
247
- }
248
- /** @inheritdoc */
249
- some(predicate) {
250
- for (const key of this.values()) {
251
- if (predicate(key))
252
- return true;
253
- }
254
- return false;
255
- }
256
- /** @inheritdoc */
257
- add(key) {
258
- if (this.has(key))
259
- return this;
260
- return ISet.create([...this.#set, key]);
261
- }
262
- /** @inheritdoc */
263
- delete(key) {
264
- if (!this.has(key)) {
265
- if (this.#showNotFoundMessage) {
266
- const keyStr = unknownToString(key);
267
- console.warn(`ISet.delete: key not found: ${keyStr}`);
268
- }
269
- return this;
270
- }
271
- return ISet.create(Array.from(this.#set).filter((k) => !Object.is(k, key)));
272
- }
273
- /** @inheritdoc */
274
- withMutations(actions) {
275
- const mut_result = new Set(this.#set);
276
- const updateFn = (action) => {
277
- switch (action.type) {
278
- case 'delete':
279
- mut_result.delete(action.key);
280
- break;
281
- case 'add':
282
- mut_result.add(action.key);
283
- break;
284
- }
285
- };
286
- for (const action of actions) {
287
- updateFn(action);
288
- }
289
- return ISet.create(mut_result);
290
- }
291
- /** @inheritdoc */
292
- map(mapFn) {
293
- return ISet.create(this.toArray().map(mapFn));
294
- }
295
- /** @inheritdoc */
296
- filter(predicate) {
297
- return ISet.create(this.toArray().filter(predicate));
298
- }
299
- /** @inheritdoc */
300
- filterNot(predicate) {
301
- return ISet.create(this.toArray().filter((e) => !predicate(e)));
302
- }
303
- /** @inheritdoc */
304
- forEach(callbackfn) {
305
- for (const v of this.#set) {
306
- callbackfn(v);
307
- }
308
- }
309
- /** @inheritdoc */
310
- isSubsetOf(set) {
311
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
312
- return this.every((k) => set.has(k));
313
- }
314
- /** @inheritdoc */
315
- isSupersetOf(set) {
316
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
317
- return set.every((k) => this.has(k));
318
- }
319
- /** @inheritdoc */
320
- subtract(set) {
321
- return ISet.create(this.toArray().filter((k) => !set.has(k)));
322
- }
323
- /** @inheritdoc */
324
- intersect(set) {
325
- return ISet.create(this.toArray().filter((k) => set.has(k)));
326
- }
327
- /** @inheritdoc */
328
- union(set) {
329
- return ISet.create([...this, ...set]);
330
- }
331
- /**
332
- * @example
333
- *
334
- * ```ts
335
- * const set = ISet.create(['first', 'second']);
336
- *
337
- * const collected = Array.from(set);
338
- *
339
- * assert.deepStrictEqual(collected, ['first', 'second']);
340
- * ```
341
- *
342
- * @inheritdoc
343
- */
344
- [Symbol.iterator]() {
345
- return this.#set[Symbol.iterator]();
346
- }
347
- /** @inheritdoc */
348
- keys() {
349
- return this.#set.keys();
350
- }
351
- /** @inheritdoc */
352
- values() {
353
- return this.#set.values();
354
- }
355
- /** @inheritdoc */
356
- entries() {
357
- return this.#set.entries();
358
- }
359
- /** @inheritdoc */
360
- toArray() {
361
- return Array.from(this.values());
362
- }
363
- /** @inheritdoc */
364
- toRawSet() {
365
- return this.#set;
366
- }
52
+ #set;
53
+ #showNotFoundMessage;
54
+ /**
55
+ * Constructs an ISetClass instance with the given elements.
56
+ *
57
+ * @param iterable An iterable of elements to populate the set.
58
+ * @param showNotFoundMessage Whether to log warning messages when operations
59
+ * are performed on non-existent elements. Useful for debugging. Defaults to
60
+ * false for production use.
61
+ * @internal Use ISet.create() instead of calling this constructor directly.
62
+ */
63
+ constructor(iterable, showNotFoundMessage = false) {
64
+ this.#set = new Set(iterable);
65
+ this.#showNotFoundMessage = showNotFoundMessage;
66
+ }
67
+ /** @inheritdoc */
68
+ get size() {
69
+ return asUint32(this.#set.size);
70
+ }
71
+ /** @inheritdoc */
72
+ get isEmpty() {
73
+ return this.size === 0;
74
+ }
75
+ /** @inheritdoc */
76
+ has(key) {
77
+ return this.#set.has(key);
78
+ }
79
+ /** @inheritdoc */
80
+ every(predicate) {
81
+ for (const key of this.values()) {
82
+ if (!predicate(key)) return false;
83
+ }
84
+ return true;
85
+ }
86
+ /** @inheritdoc */
87
+ some(predicate) {
88
+ for (const key of this.values()) {
89
+ if (predicate(key)) return true;
90
+ }
91
+ return false;
92
+ }
93
+ /** @inheritdoc */
94
+ add(key) {
95
+ if (this.has(key)) return this;
96
+ return ISet.create([...this.#set, key]);
97
+ }
98
+ /** @inheritdoc */
99
+ delete(key) {
100
+ if (!this.has(key)) {
101
+ if (this.#showNotFoundMessage) {
102
+ const keyStr = unknownToString(key);
103
+ console.warn(`ISet.delete: key not found: ${keyStr}`);
104
+ }
105
+ return this;
106
+ }
107
+ return ISet.create(Array.from(this.#set).filter((k) => !Object.is(k, key)));
108
+ }
109
+ /** @inheritdoc */
110
+ withMutations(actions) {
111
+ const mut_result = new Set(this.#set);
112
+ const updateFn = (action) => {
113
+ switch (action.type) {
114
+ case "delete":
115
+ mut_result.delete(action.key);
116
+ break;
117
+ case "add":
118
+ mut_result.add(action.key);
119
+ break;
120
+ }
121
+ };
122
+ for (const action of actions) {
123
+ updateFn(action);
124
+ }
125
+ return ISet.create(mut_result);
126
+ }
127
+ /** @inheritdoc */
128
+ map(mapFn) {
129
+ return ISet.create(this.toArray().map(mapFn));
130
+ }
131
+ /** @inheritdoc */
132
+ filter(predicate) {
133
+ return ISet.create(this.toArray().filter(predicate));
134
+ }
135
+ /** @inheritdoc */
136
+ filterNot(predicate) {
137
+ return ISet.create(this.toArray().filter((e) => !predicate(e)));
138
+ }
139
+ /** @inheritdoc */
140
+ forEach(callbackfn) {
141
+ for (const v of this.#set) {
142
+ callbackfn(v);
143
+ }
144
+ }
145
+ /** @inheritdoc */
146
+ isSubsetOf(set) {
147
+ return this.every((k) => set.has(k));
148
+ }
149
+ /** @inheritdoc */
150
+ isSupersetOf(set) {
151
+ return set.every((k) => this.has(k));
152
+ }
153
+ /** @inheritdoc */
154
+ subtract(set) {
155
+ return ISet.create(this.toArray().filter((k) => !set.has(k)));
156
+ }
157
+ /** @inheritdoc */
158
+ intersect(set) {
159
+ return ISet.create(this.toArray().filter((k) => set.has(k)));
160
+ }
161
+ /** @inheritdoc */
162
+ union(set) {
163
+ return ISet.create([...this, ...set]);
164
+ }
165
+ /**
166
+ * @example
167
+ *
168
+ * ```ts
169
+ * const set = ISet.create(['first', 'second']);
170
+ *
171
+ * const collected = Array.from(set);
172
+ *
173
+ * assert.deepStrictEqual(collected, ['first', 'second']);
174
+ * ```
175
+ *
176
+ * @inheritdoc
177
+ */
178
+ [Symbol.iterator]() {
179
+ return this.#set[Symbol.iterator]();
180
+ }
181
+ /** @inheritdoc */
182
+ keys() {
183
+ return this.#set.keys();
184
+ }
185
+ /** @inheritdoc */
186
+ values() {
187
+ return this.#set.values();
188
+ }
189
+ /** @inheritdoc */
190
+ entries() {
191
+ return this.#set.entries();
192
+ }
193
+ /** @inheritdoc */
194
+ toArray() {
195
+ return Array.from(this.values());
196
+ }
197
+ /** @inheritdoc */
198
+ toRawSet() {
199
+ return this.#set;
200
+ }
367
201
  }
368
202
 
369
203
  export { ISet };
@@ -1 +1 @@
1
- {"version":3,"file":"iset.mjs","sources":["../../src/collections/iset.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkhBA;AACM,IAAW;AAAjB,CAAA,UAAiB,IAAI,EAAA;AACnB;;;;;;;;;;;;;;;;;;;;;;AAsBG;IACU,IAAA,CAAA,MAAM,GAAG,CACpB,QAAqB,KACT,IAAI,SAAS,CAAI,QAAQ,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACU,IAAA,IAAA,CAAA,KAAK,GAAG,CACnB,CAAU,EACV,CAAU,KACE,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;IACU,IAAA,CAAA,IAAI,GAAG,CAClB,MAAe,EACf,MAAe,MAEd;AACC,QAAA,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChC,QAAA,KAAK,EAAE,MAAM,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AK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D;;AAGA,IAAA,SAAS,CAAC,GAAY,EAAA;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D;;AAGA,IAAA,KAAK,CAA2B,GAAa,EAAA;AAC3C,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC;IACvC;AAEA;;;;;;;;;;;;AAYG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAA;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;IACrC;;IAGA,IAAI,GAAA;AACF,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;IACzB;;IAGA,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;IAC3B;;IAGA,OAAO,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IAC5B;;IAGA,OAAO,GAAA;QACL,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC;;IAGA,QAAQ,GAAA;QACN,OAAO,IAAI,CAAC,IAAI;IAClB;AACD;;;;"}
1
+ {"version":3,"file":"iset.mjs","sources":["../../src/collections/iset.mts"],"sourcesContent":["/* eslint-disable unicorn/prefer-iterator-to-array-at-end */\nimport { type ReadonlyRecord, type WidenLiteral } from 'ts-type-forge';\nimport { asUint32 } from '../number/index.mjs';\nimport { unknownToString } from '../others/index.mjs';\nimport { type MapSetKeyType, type SizeType } from '../types.mjs';\n\n/**\n * Interface for an immutable set with membership testing and set operation\n * support.\n *\n * This interface defines all methods and properties available on ISet\n * instances. All operations that modify the set return new ISet instances,\n * preserving immutability. The underlying implementation uses JavaScript's\n * native Set but creates copies on mutations to maintain immutability.\n *\n * **Immutability Guarantees:**\n *\n * - All mutation operations (add, delete) return new ISet instances\n * - Original ISet instances are never modified\n * - Safe for concurrent access and functional programming patterns\n *\n * **Performance Characteristics:**\n *\n * - has: O(1) average case\n * - add/delete: O(n) due to copying for immutability\n * - set operations (union, intersection, difference): O(n)\n * - map/filter operations: O(n)\n * - iteration: O(n)\n *\n * @template K The type of the elements in the set. Must extend MapSetKeyType\n * (string, number, boolean, etc.)\n */\ntype ISetInterface<K extends MapSetKeyType> = Readonly<{\n // Getting information\n\n /**\n * The number of elements in the set.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create([1, 2, 3]);\n *\n * assert.isTrue(set.size === 3);\n * ```\n */\n size: SizeType.Arr;\n\n /**\n * Checks if the set is empty.\n *\n * @example\n *\n * ```ts\n * const emptySet = ISet.create<number>([]);\n *\n * const filledSet = ISet.create([1, 2]);\n *\n * assert.isTrue(emptySet.isEmpty);\n *\n * assert.isFalse(filledSet.isEmpty);\n * ```\n */\n isEmpty: boolean;\n\n /**\n * Checks if an element exists in the set. Allows for wider literal types for\n * keys during checking.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create(['apple', 'banana']);\n *\n * assert.isTrue(set.has('apple'));\n *\n * assert.isFalse(set.has('cherry'));\n * ```\n *\n * @param key The element to check.\n * @returns `true` if the element exists, `false` otherwise.\n */\n has: (key: K | (WidenLiteral<K> & {})) => boolean;\n\n // Reducing a value\n\n /**\n * Checks if all elements in the set satisfy a predicate. Also supports a\n * type predicate overload that narrows the type of elements in the set if\n * the predicate returns true for all elements.\n *\n * @example\n *\n * ```ts\n * const numbers = ISet.create([2, 4, 6]);\n *\n * const allEven = numbers.every((value) => value % 2 === 0);\n *\n * const narrowed = numbers.every(\n * (value): value is 2 | 4 | 6 => value % 2 === 0,\n * );\n *\n * assert.isTrue(allEven);\n *\n * assert.isTrue(narrowed);\n * ```\n *\n * @template L The narrowed type of the elements.\n * @param predicate A function to test each element.\n * @returns `true` if all elements satisfy the predicate, `false` otherwise.\n */\n every: ((predicate: (key: K) => boolean) => boolean) &\n (<L extends K>(predicate: (key: K) => key is L) => this is ISet<L>);\n\n /**\n * Checks if at least one element in the set satisfies a predicate.\n *\n * @example\n *\n * ```ts\n * const numbers = ISet.create([1, 3, 5]);\n *\n * assert.isTrue(numbers.some((value) => value > 4));\n *\n * assert.isFalse(numbers.some((value) => value > 10));\n * ```\n *\n * @param predicate A function to test each element.\n * @returns `true` if at least one element satisfies the predicate, `false`\n * otherwise.\n */\n some: (predicate: (key: K) => boolean) => boolean;\n\n // Mutation\n\n /**\n * Adds an element to the set.\n *\n * @example\n *\n * ```ts\n * const base = ISet.create<number>([1, 2]);\n *\n * const withThree = base.add(3);\n *\n * const unchanged = base.add(2);\n *\n * assert.deepStrictEqual(Array.from(withThree), [1, 2, 3]);\n *\n * assert.isTrue(unchanged === base);\n * ```\n *\n * @param key The element to add.\n * @returns A new ISet instance with the element added.\n */\n add: (key: K) => ISet<K>;\n\n /**\n * Deletes an element from the set.\n *\n * @example\n *\n * ```ts\n * const base = ISet.create<number>([1, 2, 3]);\n *\n * const withoutTwo = base.delete(2);\n *\n * const unchanged = base.delete(4);\n *\n * assert.deepStrictEqual(Array.from(withoutTwo), [1, 3]);\n *\n * assert.isTrue(unchanged === base);\n * ```\n *\n * @param key The element to delete.\n * @returns A new ISet instance without the specified element.\n */\n delete: (key: K) => ISet<K>;\n\n /**\n * Applies a series of mutations to the set.\n *\n * @example\n *\n * ```ts\n * const base = ISet.create<string>(['a', 'b']);\n *\n * const actions: readonly Readonly<\n * { type: 'add'; key: string } | { type: 'delete'; key: string }\n * >[] = [\n * { type: 'add', key: 'c' },\n * { type: 'delete', key: 'a' },\n * ] as const;\n *\n * const mutated = base.withMutations(actions);\n *\n * assert.deepStrictEqual(Array.from(mutated), ['b', 'c']);\n *\n * assert.deepStrictEqual(Array.from(base), ['a', 'b']);\n * ```\n *\n * @param actions An array of mutation actions (add or delete).\n * @returns A new ISet instance with all mutations applied.\n */\n withMutations: (\n actions: readonly Readonly<\n { type: 'add'; key: K } | { type: 'delete'; key: K }\n >[],\n ) => ISet<K>;\n\n // Sequence algorithms\n\n /**\n * Maps the elements of the set to new elements.\n *\n * @example\n *\n * ```ts\n * const letters = ISet.create(['a', 'b']);\n *\n * const upper = letters.map((value) => value.toUpperCase());\n *\n * assert.deepStrictEqual(Array.from(upper), ['A', 'B']);\n * ```\n *\n * @template K2 The type of the new elements.\n * @param mapFn A function that maps an element to a new element.\n * @returns A new ISet instance with mapped elements.\n */\n map: <K2 extends MapSetKeyType>(mapFn: (key: K) => K2) => ISet<K2>;\n\n /**\n * Filters the elements of the set based on a predicate. Also supports a type\n * predicate overload that narrows the type of elements in the resulting set.\n *\n * @example\n *\n * ```ts\n * const letters = ISet.create(['apple', 'bee', 'cat']);\n *\n * const shortWords = letters.filter((value) => value.length <= 3);\n *\n * const narrowed = letters.filter(\n * (value): value is 'bee' | 'cat' => value.length === 3,\n * );\n *\n * assert.deepStrictEqual(Array.from(shortWords), ['bee', 'cat']);\n *\n * assert.deepStrictEqual(Array.from(narrowed), ['bee', 'cat']);\n * ```\n *\n * @template K2 The narrowed type of the elements.\n * @param predicate A function to test each element.\n * @returns A new ISet instance with elements that satisfy the predicate.\n */\n filter: (<K2 extends K>(predicate: (key: K) => key is K2) => ISet<K2>) &\n ((predicate: (key: K) => boolean) => ISet<K>);\n\n /**\n * Filters the elements of the set by excluding elements for which the\n * predicate returns true.\n *\n * @example\n *\n * ```ts\n * const numbers = ISet.create([1, 2, 3, 4]);\n *\n * const withoutEven = numbers.filterNot((value) => value % 2 === 0);\n *\n * assert.deepStrictEqual(Array.from(withoutEven), [1, 3]);\n * ```\n *\n * @param predicate A function to test each element.\n * @returns A new ISet instance with elements for which the predicate returned\n * `false`.\n */\n filterNot: (predicate: (key: K) => boolean) => ISet<K>;\n\n // Set operations\n\n /**\n * Checks if this set is a subset of another set.\n *\n * @example\n *\n * ```ts\n * const subset = ISet.create<number>([1, 2]);\n *\n * const superset = ISet.create<number>([1, 2, 3]);\n *\n * assert.isTrue(subset.isSubsetOf(superset));\n *\n * assert.isFalse(superset.isSubsetOf(subset));\n * ```\n *\n * @param set The other set.\n * @returns `true` if this set is a subset of the other set, `false`\n * otherwise.\n */\n isSubsetOf: (set: ISet<WidenLiteral<K>>) => boolean;\n\n /**\n * Checks if this set is a superset of another set.\n *\n * @example\n *\n * ```ts\n * const superset = ISet.create<string>(['a', 'b', 'c']);\n *\n * const subset = ISet.create<string>(['a', 'c']);\n *\n * assert.isTrue(superset.isSupersetOf(subset));\n *\n * assert.isFalse(subset.isSupersetOf(superset));\n * ```\n *\n * @param set The other set.\n * @returns `true` if this set is a superset of the other set, `false`\n * otherwise.\n */\n isSupersetOf: (set: ISet<WidenLiteral<K>>) => boolean;\n\n /**\n * Returns a new set with elements that are in this set but not in another\n * set.\n *\n * @example\n *\n * ```ts\n * const all = ISet.create<number>([1, 2, 3, 4]);\n *\n * const toRemove = ISet.create<number>([2, 4]);\n *\n * const difference = all.subtract(toRemove);\n *\n * assert.deepStrictEqual(Array.from(difference), [1, 3]);\n * ```\n *\n * @param set The other set.\n * @returns A new ISet instance representing the set difference.\n */\n subtract: (set: ISet<K>) => ISet<K>;\n\n /**\n * Returns a new set with elements that are common to both this set and\n * another set.\n *\n * @example\n *\n * ```ts\n * const left = ISet.create<string>(['x', 'y']);\n *\n * const right = ISet.create<string>(['y', 'z']);\n *\n * const shared = left.intersect(right);\n *\n * assert.deepStrictEqual(Array.from(shared), ['y']);\n * ```\n *\n * @param set The other set.\n * @returns A new ISet instance representing the set intersection.\n */\n intersect: (set: ISet<K>) => ISet<K>;\n\n /**\n * Returns a new set with all elements from both this set and another set.\n *\n * @example\n *\n * ```ts\n * const numbers = ISet.create([1, 2]);\n *\n * const letters = ISet.create(['a', 'b']);\n *\n * const combined = numbers.union(letters);\n *\n * assert.deepStrictEqual(Array.from(combined), [1, 2, 'a', 'b']);\n * ```\n *\n * @template K2 The type of elements in the other set.\n * @param set The other set.\n * @returns A new ISet instance representing the set union.\n */\n union: <K2 extends MapSetKeyType>(set: ISet<K2>) => ISet<K | K2>;\n\n // Side effects\n\n /**\n * Executes a callback function for each element in the set.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create(['alpha', 'beta']);\n *\n * const mut_collected: string[] = [];\n *\n * set.forEach((value) => {\n * mut_collected.push(value);\n * });\n *\n * assert.deepStrictEqual(mut_collected, ['alpha', 'beta']);\n * ```\n *\n * @param callbackfn A function to execute for each element.\n */\n forEach: (callbackfn: (key: K) => void) => void;\n\n // Iterators\n\n /**\n * Returns an iterator for the elements in the set (alias for values).\n *\n * @example\n *\n * ```ts\n * const set = ISet.create([1, 2]);\n *\n * const keys = Array.from(set.keys());\n *\n * assert.deepStrictEqual(keys, [1, 2]);\n * ```\n *\n * @returns An iterable iterator of elements.\n */\n keys: () => IterableIterator<K>;\n\n /**\n * Returns an iterator for the elements in the set.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create(['x', 'y']);\n *\n * const values = Array.from(set.values());\n *\n * assert.deepStrictEqual(values, ['x', 'y']);\n * ```\n *\n * @returns An iterable iterator of elements.\n */\n values: () => IterableIterator<K>;\n\n /**\n * Returns an iterator for the entries (element-element pairs) in the set.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create(['red', 'blue']);\n *\n * const entries = Array.from(set.entries());\n *\n * assert.deepStrictEqual(entries, [\n * ['red', 'red'],\n * ['blue', 'blue'],\n * ]);\n * ```\n *\n * @returns An iterable iterator of entries.\n */\n entries: () => IterableIterator<readonly [K, K]>;\n\n // Conversion\n\n /**\n * Converts the elements of the set to an array.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create(['north', 'south']);\n *\n * assert.deepStrictEqual(set.toArray(), ['north', 'south']);\n * ```\n *\n * @returns A readonly array of elements.\n */\n toArray: () => readonly K[];\n\n /**\n * Returns the underlying readonly JavaScript Set.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create(['alpha']);\n *\n * const raw = set.toRawSet();\n *\n * assert.isTrue(isSet(raw));\n *\n * assert.isTrue(raw.has('alpha'));\n * ```\n *\n * @returns The raw ReadonlySet instance.\n */\n toRawSet: () => ReadonlySet<K>;\n}>;\n\n/**\n * Represents an immutable set with high-performance operations and\n * comprehensive set algebra support.\n *\n * ISet is a persistent data structure that provides all the functionality of\n * JavaScript's Set while maintaining immutability. All operations that would\n * normally mutate the set instead return new ISet instances, making it safe for\n * functional programming and concurrent access.\n *\n * **Key Features:**\n *\n * - **Immutable**: All mutation operations return new instances\n * - **Set Operations**: Full support for union, intersection, difference,\n * subset/superset checks\n * - **Type Safe**: Full TypeScript support with generic element types\n * - **Iterable**: Implements standard JavaScript iteration protocols\n * - **Functional**: Rich API for map, filter, and functional composition\n *\n * **When to Use:**\n *\n * - Managing collections of unique values with immutability guarantees\n * - Set algebra operations (unions, intersections, differences)\n * - Membership testing with O(1) performance\n * - Functional programming patterns requiring immutable collections\n *\n * @template K The type of the elements in the set. Must extend MapSetKeyType.\n */\nexport type ISet<K extends MapSetKeyType> = Iterable<K> & ISetInterface<K>;\n\n/** Provides utility functions for ISet. */\nexport namespace ISet {\n /**\n * Creates a new ISet instance from an iterable of elements.\n *\n * This factory function accepts any iterable of elements, including arrays,\n * JavaScript Sets, other ISets, or custom iterables. Duplicate elements in\n * the input iterable will be automatically deduplicated in the resulting\n * set.\n *\n * **Performance:** O(n) where n is the number of elements in the iterable.\n *\n * @example\n *\n * ```ts\n * const set = ISet.create(['a', 'a', 'b']);\n *\n * assert.deepStrictEqual(Array.from(set), ['a', 'b']);\n * ```\n *\n * @template K The type of the elements. Must extend MapSetKeyType.\n * @param iterable An iterable of elements (e.g., Array, Set, ISet, etc.)\n * @returns A new ISet instance containing all unique elements from the\n * iterable.\n */\n export const create = <K extends MapSetKeyType>(\n iterable: Iterable<K>,\n ): ISet<K> => new ISetClass<K>(iterable);\n\n /**\n * Checks if two ISet instances are structurally equal.\n *\n * Two ISets are considered equal if they have the same size and contain\n * exactly the same elements. The order of elements does not matter for\n * equality comparison since sets are unordered collections. Elements are\n * compared using JavaScript's `===` operator.\n *\n * **Performance:** O(n) where n is the size of the smaller set.\n *\n * @example\n *\n * ```ts\n * const first = ISet.create<number>([1, 2]);\n *\n * const second = ISet.create<number>([2, 1]);\n *\n * const third = ISet.create<number>([1, 3]);\n *\n * assert.isTrue(ISet.equal(first, second));\n *\n * assert.isFalse(ISet.equal(first, third));\n * ```\n *\n * @template K The type of the elements.\n * @param a The first ISet instance to compare.\n * @param b The second ISet instance to compare.\n * @returns `true` if the sets contain exactly the same elements, `false`\n * otherwise.\n */\n export const equal = <K extends MapSetKeyType>(\n a: ISet<K>,\n b: ISet<K>,\n ): boolean => a.size === b.size && a.every((e) => b.has(e));\n\n /**\n * Computes the difference between two ISet instances, identifying added and\n * deleted elements.\n *\n * This function performs a set difference operation to determine what\n * elements were added and what elements were deleted when transitioning from\n * the old set to the new set. This is useful for change detection, state\n * management, and synchronization scenarios.\n *\n * **Performance:** O(n + m) where n and m are the sizes of the old and new\n * sets respectively.\n *\n * @example\n *\n * ```ts\n * const previous = ISet.create<string>(['draft', 'review']);\n *\n * const current = ISet.create<string>(['review', 'published']);\n *\n * const { added, deleted } = ISet.diff(previous, current);\n *\n * assert.deepStrictEqual(Array.from(added), ['published']);\n *\n * assert.deepStrictEqual(Array.from(deleted), ['draft']);\n * ```\n *\n * @template K The type of the elements.\n * @param oldSet The original set representing the previous state.\n * @param newSet The new set representing the current state.\n * @returns An object with `added` and `deleted` properties, each containing\n * an ISet of elements that were added or removed respectively.\n */\n export const diff = <K extends MapSetKeyType>(\n oldSet: ISet<K>,\n newSet: ISet<K>,\n ): ReadonlyRecord<'added' | 'deleted', ISet<K>> =>\n ({\n deleted: oldSet.subtract(newSet),\n added: newSet.subtract(oldSet),\n }) as const;\n\n /**\n * Computes the intersection of two ISet instances.\n *\n * Returns a new set containing only the elements that are present in both\n * input sets. This operation is commutative: `intersection(a, b) ===\n * intersection(b, a)`.\n *\n * **Performance:** O(min(n, m)) where n and m are the sizes of the input\n * sets.\n *\n * @example\n *\n * ```ts\n * const left = ISet.create<number>([1, 2, 3]);\n *\n * const right = ISet.create<number>([2, 4]);\n *\n * const overlap = ISet.intersection(left, right);\n *\n * assert.deepStrictEqual(Array.from(overlap), [2]);\n * ```\n *\n * @template K The type of the elements.\n * @param a The first set.\n * @param b The second set.\n * @returns A new ISet instance containing elements common to both sets.\n */\n export const intersection = <K extends MapSetKeyType>(\n a: ISet<K>,\n b: ISet<K>,\n ): ISet<K> => a.intersect(b);\n\n /**\n * Computes the union of two ISet instances.\n *\n * Returns a new set containing all elements that are present in either input\n * set. Duplicate elements are automatically handled since sets only contain\n * unique values. This operation is commutative: `union(a, b) === union(b,\n * a)`.\n *\n * **Performance:** O(n + m) where n and m are the sizes of the input sets.\n *\n * @example\n *\n * ```ts\n * const numbers = ISet.create([1, 2]);\n *\n * const words = ISet.create(['one', 'two']);\n *\n * const union = ISet.union(numbers, words);\n *\n * assert.deepStrictEqual(Array.from(union), [1, 2, 'one', 'two']);\n * ```\n *\n * @template K1 The type of elements in the first set.\n * @template K2 The type of elements in the second set.\n * @param a The first set.\n * @param b The second set.\n * @returns A new ISet instance containing all elements from both sets.\n */\n export const union = <K1 extends MapSetKeyType, K2 extends MapSetKeyType>(\n a: ISet<K1>,\n b: ISet<K2>,\n ): ISet<K1 | K2> => a.union(b);\n}\n\n/**\n * Internal class implementation for ISet providing immutable set operations.\n *\n * This class implements the ISet interface using JavaScript's native Set as the\n * underlying storage mechanism for optimal performance. All mutation operations\n * create new instances rather than modifying the existing set, ensuring\n * immutability.\n *\n * **Implementation Details:**\n *\n * - Uses ReadonlySet<K> internally for type safety and performance\n * - Implements copy-on-write semantics for efficiency\n * - Provides optional debug messaging for development\n *\n * @template K The type of the elements. Must extend MapSetKeyType.\n * @implements ISet\n * @implements Iterable\n * @internal This class should not be used directly. Use ISet.create() instead.\n */\nclass ISetClass<K extends MapSetKeyType> implements ISet<K>, Iterable<K> {\n readonly #set: ReadonlySet<K>;\n readonly #showNotFoundMessage: boolean;\n\n /**\n * Constructs an ISetClass instance with the given elements.\n *\n * @param iterable An iterable of elements to populate the set.\n * @param showNotFoundMessage Whether to log warning messages when operations\n * are performed on non-existent elements. Useful for debugging. Defaults to\n * false for production use.\n * @internal Use ISet.create() instead of calling this constructor directly.\n */\n constructor(iterable: Iterable<K>, showNotFoundMessage: boolean = false) {\n this.#set = new Set(iterable);\n\n this.#showNotFoundMessage = showNotFoundMessage;\n }\n\n /** @inheritdoc */\n get size(): SizeType.Arr {\n return asUint32(this.#set.size);\n }\n\n /** @inheritdoc */\n get isEmpty(): boolean {\n return this.size === 0;\n }\n\n /** @inheritdoc */\n has(key: K | (WidenLiteral<K> & {})): boolean {\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n return this.#set.has(key as K);\n }\n\n /** @inheritdoc */\n every<L extends K>(predicate: (key: K) => key is L): this is ISet<L>;\n\n /** @inheritdoc */\n every(predicate: (key: K) => boolean): boolean;\n\n /** @inheritdoc */\n every(predicate: (key: K) => boolean): boolean {\n for (const key of this.values()) {\n if (!predicate(key)) return false;\n }\n\n return true;\n }\n\n /** @inheritdoc */\n some(predicate: (key: K) => boolean): boolean {\n for (const key of this.values()) {\n if (predicate(key)) return true;\n }\n\n return false;\n }\n\n /** @inheritdoc */\n add(key: K): ISet<K> {\n if (this.has(key)) return this;\n\n return ISet.create([...this.#set, key]);\n }\n\n /** @inheritdoc */\n delete(key: K): ISet<K> {\n if (!this.has(key)) {\n if (this.#showNotFoundMessage) {\n const keyStr = unknownToString(key);\n\n console.warn(`ISet.delete: key not found: ${keyStr}`);\n }\n\n return this;\n }\n\n return ISet.create(Array.from(this.#set).filter((k) => !Object.is(k, key)));\n }\n\n /** @inheritdoc */\n withMutations(\n actions: readonly Readonly<\n { type: 'add'; key: K } | { type: 'delete'; key: K }\n >[],\n ): ISet<K> {\n const mut_result = new Set<K>(this.#set);\n\n const updateFn = (\n action: Readonly<{ type: 'add'; key: K } | { type: 'delete'; key: K }>,\n ): void => {\n switch (action.type) {\n case 'delete':\n mut_result.delete(action.key);\n\n break;\n\n case 'add':\n mut_result.add(action.key);\n\n break;\n }\n };\n\n for (const action of actions) {\n updateFn(action);\n }\n\n return ISet.create(mut_result);\n }\n\n /** @inheritdoc */\n map<K2 extends MapSetKeyType>(mapFn: (key: K) => K2): ISet<K2> {\n return ISet.create(this.toArray().map(mapFn));\n }\n\n /** @inheritdoc */\n filter<K2 extends K>(predicate: (key: K) => key is K2): ISet<K2>;\n\n /** @inheritdoc */\n filter(predicate: (key: K) => boolean): ISet<K>;\n\n /** @inheritdoc */\n filter(predicate: (key: K) => boolean): ISet<K> {\n return ISet.create(this.toArray().filter(predicate));\n }\n\n /** @inheritdoc */\n filterNot(predicate: (key: K) => boolean): ISet<K> {\n return ISet.create(this.toArray().filter((e) => !predicate(e)));\n }\n\n /** @inheritdoc */\n forEach(callbackfn: (key: K) => void): void {\n for (const v of this.#set) {\n callbackfn(v);\n }\n }\n\n /** @inheritdoc */\n isSubsetOf(set: ISet<WidenLiteral<K>>): boolean {\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n return this.every((k) => set.has(k as WidenLiteral<K>));\n }\n\n /** @inheritdoc */\n isSupersetOf(set: ISet<WidenLiteral<K>>): boolean {\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n return set.every((k) => this.has(k as K));\n }\n\n /** @inheritdoc */\n subtract(set: ISet<K>): ISet<K> {\n return ISet.create(this.toArray().filter((k) => !set.has(k)));\n }\n\n /** @inheritdoc */\n intersect(set: ISet<K>): ISet<K> {\n return ISet.create(this.toArray().filter((k) => set.has(k)));\n }\n\n /** @inheritdoc */\n union<K2 extends MapSetKeyType>(set: ISet<K2>): ISet<K | K2> {\n return ISet.create([...this, ...set]);\n }\n\n /**\n * @example\n *\n * ```ts\n * const set = ISet.create(['first', 'second']);\n *\n * const collected = Array.from(set);\n *\n * assert.deepStrictEqual(collected, ['first', 'second']);\n * ```\n *\n * @inheritdoc\n */\n [Symbol.iterator](): Iterator<K> {\n return this.#set[Symbol.iterator]();\n }\n\n /** @inheritdoc */\n keys(): IterableIterator<K> {\n return this.#set.keys();\n }\n\n /** @inheritdoc */\n values(): IterableIterator<K> {\n return this.#set.values();\n }\n\n /** @inheritdoc */\n entries(): IterableIterator<readonly [K, K]> {\n return this.#set.entries();\n }\n\n /** @inheritdoc */\n toArray(): readonly K[] {\n return Array.from(this.values());\n }\n\n /** @inheritdoc */\n toRawSet(): ReadonlySet<K> {\n return this.#set;\n }\n}\n"],"names":["ISet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmhBO,IAAU;AAAA,CAAV,CAAUA,KAAAA,KAAV;AAwBE,EAAMA,MAAA,MAAA,GAAS,CACpB,QAAA,KACY,IAAI,UAAa,QAAQ,CAAA;AAgChC,EAAMA,MAAA,KAAA,GAAQ,CACnB,CAAA,EACA,CAAA,KACY,EAAE,IAAA,KAAS,CAAA,CAAE,IAAA,IAAQ,CAAA,CAAE,MAAM,CAAC,CAAA,KAAM,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,CAAA;AAkCnD,EAAMA,KAAAA,CAAA,IAAA,GAAO,CAClB,MAAA,EACA,MAAA,MAEC;AAAA,IACC,OAAA,EAAS,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA;AAAA,IAC/B,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,MAAM;AAAA,GAC/B,CAAA;AA6BK,EAAMA,MAAA,YAAA,GAAe,CAC1B,GACA,CAAA,KACY,CAAA,CAAE,UAAU,CAAC,CAAA;AA8BpB,EAAMA,MAAA,KAAA,GAAQ,CACnB,GACA,CAAA,KACkB,CAAA,CAAE,MAAM,CAAC,CAAA;AAAA,CAAA,EAvKd,IAAA,KAAA,IAAA,GAAA,EAAA,CAAA,CAAA;AA6LjB,MAAM,SAAA,CAAmE;AAAA,EAC9D,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