ts-data-forge 9.0.0 → 10.0.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 (447) hide show
  1. package/README.md +1 -1
  2. package/dist/array/impl/array-utils-creation.d.mts +4 -4
  3. package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
  4. package/dist/array/impl/array-utils-creation.mjs +17 -112
  5. package/dist/array/impl/array-utils-creation.mjs.map +1 -1
  6. package/dist/array/impl/array-utils-element-access.d.mts.map +1 -1
  7. package/dist/array/impl/array-utils-element-access.mjs +22 -61
  8. package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
  9. package/dist/array/impl/array-utils-iterators.d.mts.map +1 -1
  10. package/dist/array/impl/array-utils-iterators.mjs +9 -63
  11. package/dist/array/impl/array-utils-iterators.mjs.map +1 -1
  12. package/dist/array/impl/array-utils-modification.d.mts +7 -7
  13. package/dist/array/impl/array-utils-modification.d.mts.map +1 -1
  14. package/dist/array/impl/array-utils-modification.mjs +78 -78
  15. package/dist/array/impl/array-utils-modification.mjs.map +1 -1
  16. package/dist/array/impl/array-utils-reducing-value.mjs +95 -89
  17. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  18. package/dist/array/impl/array-utils-search.mjs +100 -92
  19. package/dist/array/impl/array-utils-search.mjs.map +1 -1
  20. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  21. package/dist/array/impl/array-utils-set-op.mjs +31 -141
  22. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  23. package/dist/array/impl/array-utils-size.d.mts.map +1 -1
  24. package/dist/array/impl/array-utils-size.mjs +4 -8
  25. package/dist/array/impl/array-utils-size.mjs.map +1 -1
  26. package/dist/array/impl/array-utils-slice-clamped.mjs +11 -12
  27. package/dist/array/impl/array-utils-slice-clamped.mjs.map +1 -1
  28. package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
  29. package/dist/array/impl/array-utils-slicing.mjs +44 -96
  30. package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
  31. package/dist/array/impl/array-utils-transformation.d.mts +4 -4
  32. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  33. package/dist/array/impl/array-utils-transformation.mjs +150 -292
  34. package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
  35. package/dist/array/impl/array-utils-validation.d.mts +17 -17
  36. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  37. package/dist/array/impl/array-utils-validation.mjs +23 -174
  38. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  39. package/dist/array/impl/index.mjs +1 -1
  40. package/dist/collections/imap-mapped.d.mts.map +1 -1
  41. package/dist/collections/imap-mapped.mjs +243 -330
  42. package/dist/collections/imap-mapped.mjs.map +1 -1
  43. package/dist/collections/imap.d.mts.map +1 -1
  44. package/dist/collections/imap.mjs +190 -275
  45. package/dist/collections/imap.mjs.map +1 -1
  46. package/dist/collections/iset-mapped.d.mts +1 -1
  47. package/dist/collections/iset-mapped.d.mts.map +1 -1
  48. package/dist/collections/iset-mapped.mjs +222 -444
  49. package/dist/collections/iset-mapped.mjs.map +1 -1
  50. package/dist/collections/iset.d.mts +1 -1
  51. package/dist/collections/iset.d.mts.map +1 -1
  52. package/dist/collections/iset.mjs +158 -324
  53. package/dist/collections/iset.mjs.map +1 -1
  54. package/dist/collections/queue.d.mts.map +1 -1
  55. package/dist/collections/queue.mjs +106 -178
  56. package/dist/collections/queue.mjs.map +1 -1
  57. package/dist/collections/stack.d.mts.map +1 -1
  58. package/dist/collections/stack.mjs +95 -165
  59. package/dist/collections/stack.mjs.map +1 -1
  60. package/dist/entry-point.mjs +2 -0
  61. package/dist/entry-point.mjs.map +1 -1
  62. package/dist/expect-type.d.mts +1 -1
  63. package/dist/expect-type.d.mts.map +1 -1
  64. package/dist/expect-type.mjs +1 -69
  65. package/dist/expect-type.mjs.map +1 -1
  66. package/dist/functional/match.mjs +9 -9
  67. package/dist/functional/match.mjs.map +1 -1
  68. package/dist/functional/optional/impl/optional-expect-to-be.mjs +13 -14
  69. package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
  70. package/dist/functional/optional/impl/optional-filter.mjs +14 -15
  71. package/dist/functional/optional/impl/optional-filter.mjs.map +1 -1
  72. package/dist/functional/optional/impl/optional-flat-map.mjs +10 -11
  73. package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
  74. package/dist/functional/optional/impl/optional-from-nullable.d.mts.map +1 -1
  75. package/dist/functional/optional/impl/optional-from-nullable.mjs +1 -25
  76. package/dist/functional/optional/impl/optional-from-nullable.mjs.map +1 -1
  77. package/dist/functional/optional/impl/optional-is-none.d.mts.map +1 -1
  78. package/dist/functional/optional/impl/optional-is-none.mjs +0 -19
  79. package/dist/functional/optional/impl/optional-is-none.mjs.map +1 -1
  80. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  81. package/dist/functional/optional/impl/optional-is-optional.mjs +1 -23
  82. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  83. package/dist/functional/optional/impl/optional-is-some.d.mts.map +1 -1
  84. package/dist/functional/optional/impl/optional-is-some.mjs +0 -20
  85. package/dist/functional/optional/impl/optional-is-some.mjs.map +1 -1
  86. package/dist/functional/optional/impl/optional-map.mjs +13 -14
  87. package/dist/functional/optional/impl/optional-map.mjs.map +1 -1
  88. package/dist/functional/optional/impl/optional-none.mjs +0 -16
  89. package/dist/functional/optional/impl/optional-none.mjs.map +1 -1
  90. package/dist/functional/optional/impl/optional-or-else.mjs +10 -11
  91. package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
  92. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  93. package/dist/functional/optional/impl/optional-some.mjs +2 -21
  94. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  95. package/dist/functional/optional/impl/optional-to-nullable.d.mts.map +1 -1
  96. package/dist/functional/optional/impl/optional-to-nullable.mjs +1 -27
  97. package/dist/functional/optional/impl/optional-to-nullable.mjs.map +1 -1
  98. package/dist/functional/optional/impl/optional-unwrap-or.mjs +9 -10
  99. package/dist/functional/optional/impl/optional-unwrap-or.mjs.map +1 -1
  100. package/dist/functional/optional/impl/optional-unwrap-throw.d.mts.map +1 -1
  101. package/dist/functional/optional/impl/optional-unwrap-throw.mjs +4 -32
  102. package/dist/functional/optional/impl/optional-unwrap-throw.mjs.map +1 -1
  103. package/dist/functional/optional/impl/optional-unwrap.mjs +4 -4
  104. package/dist/functional/optional/impl/optional-unwrap.mjs.map +1 -1
  105. package/dist/functional/optional/impl/optional-zip.d.mts.map +1 -1
  106. package/dist/functional/optional/impl/optional-zip.mjs +1 -35
  107. package/dist/functional/optional/impl/optional-zip.mjs.map +1 -1
  108. package/dist/functional/optional/impl/tag.mjs +2 -3
  109. package/dist/functional/optional/impl/tag.mjs.map +1 -1
  110. package/dist/functional/pipe.d.mts.map +1 -1
  111. package/dist/functional/pipe.mjs +9 -34
  112. package/dist/functional/pipe.mjs.map +1 -1
  113. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  114. package/dist/functional/result/impl/result-err.mjs +2 -27
  115. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  116. package/dist/functional/result/impl/result-expect-to-be.mjs +13 -15
  117. package/dist/functional/result/impl/result-expect-to-be.mjs.map +1 -1
  118. package/dist/functional/result/impl/result-flat-map.mjs +16 -16
  119. package/dist/functional/result/impl/result-flat-map.mjs.map +1 -1
  120. package/dist/functional/result/impl/result-fold.mjs +16 -16
  121. package/dist/functional/result/impl/result-fold.mjs.map +1 -1
  122. package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
  123. package/dist/functional/result/impl/result-from-promise.mjs +4 -31
  124. package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
  125. package/dist/functional/result/impl/result-from-throwable.d.mts.map +1 -1
  126. package/dist/functional/result/impl/result-from-throwable.mjs +8 -38
  127. package/dist/functional/result/impl/result-from-throwable.mjs.map +1 -1
  128. package/dist/functional/result/impl/result-is-err.d.mts.map +1 -1
  129. package/dist/functional/result/impl/result-is-err.mjs +0 -19
  130. package/dist/functional/result/impl/result-is-err.mjs.map +1 -1
  131. package/dist/functional/result/impl/result-is-ok.d.mts.map +1 -1
  132. package/dist/functional/result/impl/result-is-ok.mjs +0 -19
  133. package/dist/functional/result/impl/result-is-ok.mjs.map +1 -1
  134. package/dist/functional/result/impl/result-is-result.d.mts.map +1 -1
  135. package/dist/functional/result/impl/result-is-result.mjs +1 -23
  136. package/dist/functional/result/impl/result-is-result.mjs.map +1 -1
  137. package/dist/functional/result/impl/result-map-err.mjs +16 -16
  138. package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
  139. package/dist/functional/result/impl/result-map.mjs +16 -16
  140. package/dist/functional/result/impl/result-map.mjs.map +1 -1
  141. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  142. package/dist/functional/result/impl/result-ok.mjs +2 -27
  143. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  144. package/dist/functional/result/impl/result-or-else.mjs +10 -12
  145. package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
  146. package/dist/functional/result/impl/result-swap.d.mts.map +1 -1
  147. package/dist/functional/result/impl/result-swap.mjs +4 -22
  148. package/dist/functional/result/impl/result-swap.mjs.map +1 -1
  149. package/dist/functional/result/impl/result-to-optional.d.mts.map +1 -1
  150. package/dist/functional/result/impl/result-to-optional.mjs +0 -27
  151. package/dist/functional/result/impl/result-to-optional.mjs.map +1 -1
  152. package/dist/functional/result/impl/result-unwrap-err-or.mjs +9 -11
  153. package/dist/functional/result/impl/result-unwrap-err-or.mjs.map +1 -1
  154. package/dist/functional/result/impl/result-unwrap-err-throw.d.mts.map +1 -1
  155. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +13 -40
  156. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  157. package/dist/functional/result/impl/result-unwrap-err.d.mts.map +1 -1
  158. package/dist/functional/result/impl/result-unwrap-err.mjs +4 -32
  159. package/dist/functional/result/impl/result-unwrap-err.mjs.map +1 -1
  160. package/dist/functional/result/impl/result-unwrap-ok-or.mjs +9 -11
  161. package/dist/functional/result/impl/result-unwrap-ok-or.mjs.map +1 -1
  162. package/dist/functional/result/impl/result-unwrap-ok.mjs +4 -4
  163. package/dist/functional/result/impl/result-unwrap-ok.mjs.map +1 -1
  164. package/dist/functional/result/impl/result-unwrap-throw.d.mts.map +1 -1
  165. package/dist/functional/result/impl/result-unwrap-throw.mjs +4 -35
  166. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  167. package/dist/functional/result/impl/result-zip.d.mts.map +1 -1
  168. package/dist/functional/result/impl/result-zip.mjs +1 -34
  169. package/dist/functional/result/impl/result-zip.mjs.map +1 -1
  170. package/dist/functional/result/impl/tag.mjs +2 -3
  171. package/dist/functional/result/impl/tag.mjs.map +1 -1
  172. package/dist/functional/ternary-result/impl/tag.mjs +3 -5
  173. package/dist/functional/ternary-result/impl/tag.mjs.map +1 -1
  174. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  175. package/dist/functional/ternary-result/impl/ternary-result-err.mjs +2 -15
  176. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  177. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs +13 -13
  178. package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
  179. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs +27 -26
  180. package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
  181. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs +21 -22
  182. package/dist/functional/ternary-result/impl/ternary-result-fold.mjs.map +1 -1
  183. package/dist/functional/ternary-result/impl/ternary-result-from-promise.d.mts.map +1 -1
  184. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs +4 -20
  185. package/dist/functional/ternary-result/impl/ternary-result-from-promise.mjs.map +1 -1
  186. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.d.mts.map +1 -1
  187. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs +7 -25
  188. package/dist/functional/ternary-result/impl/ternary-result-from-throwable.mjs.map +1 -1
  189. package/dist/functional/ternary-result/impl/ternary-result-is-err.d.mts.map +1 -1
  190. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs +0 -17
  191. package/dist/functional/ternary-result/impl/ternary-result-is-err.mjs.map +1 -1
  192. package/dist/functional/ternary-result/impl/ternary-result-is-ok.d.mts.map +1 -1
  193. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs +0 -19
  194. package/dist/functional/ternary-result/impl/ternary-result-is-ok.mjs.map +1 -1
  195. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts.map +1 -1
  196. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +1 -25
  197. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs.map +1 -1
  198. package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
  199. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +0 -18
  200. package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
  201. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs +13 -15
  202. package/dist/functional/ternary-result/impl/ternary-result-map-err.mjs.map +1 -1
  203. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs +18 -18
  204. package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
  205. package/dist/functional/ternary-result/impl/ternary-result-map.mjs +21 -22
  206. package/dist/functional/ternary-result/impl/ternary-result-map.mjs.map +1 -1
  207. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  208. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs +2 -16
  209. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  210. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs +9 -9
  211. package/dist/functional/ternary-result/impl/ternary-result-or-else.mjs.map +1 -1
  212. package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
  213. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +4 -22
  214. package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
  215. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs +9 -9
  216. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
  217. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.d.mts.map +1 -1
  218. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +12 -27
  219. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  220. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.d.mts.map +1 -1
  221. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs +4 -19
  222. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err.mjs.map +1 -1
  223. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs +9 -9
  224. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok-or.mjs.map +1 -1
  225. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs +4 -5
  226. package/dist/functional/ternary-result/impl/ternary-result-unwrap-ok.mjs.map +1 -1
  227. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.d.mts.map +1 -1
  228. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +15 -27
  229. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  230. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs +9 -9
  231. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-or.mjs.map +1 -1
  232. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.d.mts.map +1 -1
  233. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +10 -24
  234. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  235. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.d.mts.map +1 -1
  236. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs +4 -19
  237. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn.mjs.map +1 -1
  238. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  239. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs +3 -19
  240. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  241. package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
  242. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +14 -45
  243. package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
  244. package/dist/functional/ternary-result/impl/variant-name.d.mts +1 -1
  245. package/dist/functional/ternary-result/impl/variant-name.d.mts.map +1 -1
  246. package/dist/functional/ternary-result/impl/variant-name.mjs +8 -9
  247. package/dist/functional/ternary-result/impl/variant-name.mjs.map +1 -1
  248. package/dist/guard/as-length-bounded-array.d.mts +117 -0
  249. package/dist/guard/as-length-bounded-array.d.mts.map +1 -0
  250. package/dist/guard/as-length-bounded-array.mjs +37 -0
  251. package/dist/guard/as-length-bounded-array.mjs.map +1 -0
  252. package/dist/guard/has-key.d.mts.map +1 -1
  253. package/dist/guard/has-key.mjs +0 -41
  254. package/dist/guard/has-key.mjs.map +1 -1
  255. package/dist/guard/index.d.mts +2 -0
  256. package/dist/guard/index.d.mts.map +1 -1
  257. package/dist/guard/index.mjs +2 -0
  258. package/dist/guard/index.mjs.map +1 -1
  259. package/dist/guard/is-length-bounded-array.d.mts +159 -0
  260. package/dist/guard/is-length-bounded-array.d.mts.map +1 -0
  261. package/dist/guard/is-length-bounded-array.mjs +7 -0
  262. package/dist/guard/is-length-bounded-array.mjs.map +1 -0
  263. package/dist/guard/is-length-bounded-string.d.mts +5 -6
  264. package/dist/guard/is-length-bounded-string.d.mts.map +1 -1
  265. package/dist/guard/is-length-bounded-string.mjs +0 -157
  266. package/dist/guard/is-length-bounded-string.mjs.map +1 -1
  267. package/dist/guard/is-non-empty-string.d.mts +1 -1
  268. package/dist/guard/is-non-empty-string.d.mts.map +1 -1
  269. package/dist/guard/is-non-empty-string.mjs +1 -38
  270. package/dist/guard/is-non-empty-string.mjs.map +1 -1
  271. package/dist/guard/is-non-null-object.d.mts.map +1 -1
  272. package/dist/guard/is-non-null-object.mjs +1 -35
  273. package/dist/guard/is-non-null-object.mjs.map +1 -1
  274. package/dist/guard/is-primitive.d.mts.map +1 -1
  275. package/dist/guard/is-primitive.mjs +12 -43
  276. package/dist/guard/is-primitive.mjs.map +1 -1
  277. package/dist/guard/is-record.d.mts.map +1 -1
  278. package/dist/guard/is-record.mjs +0 -86
  279. package/dist/guard/is-record.mjs.map +1 -1
  280. package/dist/guard/is-type.d.mts.map +1 -1
  281. package/dist/guard/is-type.mjs +12 -399
  282. package/dist/guard/is-type.mjs.map +1 -1
  283. package/dist/guard/key-is-in.d.mts.map +1 -1
  284. package/dist/guard/key-is-in.mjs +0 -40
  285. package/dist/guard/key-is-in.mjs.map +1 -1
  286. package/dist/index.mjs +2 -0
  287. package/dist/index.mjs.map +1 -1
  288. package/dist/iterator/range.mjs +16 -16
  289. package/dist/iterator/range.mjs.map +1 -1
  290. package/dist/json/json.d.mts.map +1 -1
  291. package/dist/json/json.mjs +52 -340
  292. package/dist/json/json.mjs.map +1 -1
  293. package/dist/number/branded-types/finite-number.d.mts +3 -3
  294. package/dist/number/branded-types/finite-number.mjs +135 -154
  295. package/dist/number/branded-types/finite-number.mjs.map +1 -1
  296. package/dist/number/branded-types/int.d.mts +4 -4
  297. package/dist/number/branded-types/int.mjs +205 -245
  298. package/dist/number/branded-types/int.mjs.map +1 -1
  299. package/dist/number/branded-types/int16.d.mts +15 -15
  300. package/dist/number/branded-types/int16.mjs +116 -123
  301. package/dist/number/branded-types/int16.mjs.map +1 -1
  302. package/dist/number/branded-types/int32.d.mts +11 -11
  303. package/dist/number/branded-types/int32.mjs +116 -123
  304. package/dist/number/branded-types/int32.mjs.map +1 -1
  305. package/dist/number/branded-types/negative-finite-number.d.mts +4 -4
  306. package/dist/number/branded-types/negative-finite-number.mjs +129 -144
  307. package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
  308. package/dist/number/branded-types/negative-int.d.mts +5 -5
  309. package/dist/number/branded-types/negative-int.mjs +94 -113
  310. package/dist/number/branded-types/negative-int.mjs.map +1 -1
  311. package/dist/number/branded-types/negative-safe-int.d.mts +5 -5
  312. package/dist/number/branded-types/negative-safe-int.mjs +103 -124
  313. package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
  314. package/dist/number/branded-types/non-negative-finite-number.d.mts +5 -5
  315. package/dist/number/branded-types/non-negative-finite-number.mjs +136 -142
  316. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
  317. package/dist/number/branded-types/non-negative-int16.d.mts +16 -16
  318. package/dist/number/branded-types/non-negative-int16.mjs +109 -118
  319. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
  320. package/dist/number/branded-types/non-negative-int32.d.mts +12 -12
  321. package/dist/number/branded-types/non-negative-int32.mjs +110 -119
  322. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
  323. package/dist/number/branded-types/non-positive-finite-number.d.mts +3 -3
  324. package/dist/number/branded-types/non-positive-finite-number.mjs +120 -124
  325. package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
  326. package/dist/number/branded-types/non-positive-int.d.mts +4 -4
  327. package/dist/number/branded-types/non-positive-int.mjs +167 -212
  328. package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
  329. package/dist/number/branded-types/non-positive-safe-int.d.mts +4 -4
  330. package/dist/number/branded-types/non-positive-safe-int.mjs +95 -106
  331. package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
  332. package/dist/number/branded-types/non-zero-finite-number.d.mts +4 -4
  333. package/dist/number/branded-types/non-zero-finite-number.mjs +114 -123
  334. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
  335. package/dist/number/branded-types/non-zero-int.d.mts +2 -2
  336. package/dist/number/branded-types/non-zero-int.mjs +72 -83
  337. package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
  338. package/dist/number/branded-types/non-zero-int16.d.mts +7 -7
  339. package/dist/number/branded-types/non-zero-int16.mjs +96 -107
  340. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
  341. package/dist/number/branded-types/non-zero-int32.d.mts +5 -5
  342. package/dist/number/branded-types/non-zero-int32.mjs +97 -108
  343. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
  344. package/dist/number/branded-types/non-zero-safe-int.d.mts +2 -2
  345. package/dist/number/branded-types/non-zero-safe-int.mjs +100 -111
  346. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
  347. package/dist/number/branded-types/non-zero-uint16.d.mts +8 -8
  348. package/dist/number/branded-types/non-zero-uint16.mjs +96 -107
  349. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
  350. package/dist/number/branded-types/non-zero-uint32.d.mts +6 -6
  351. package/dist/number/branded-types/non-zero-uint32.mjs +96 -107
  352. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
  353. package/dist/number/branded-types/positive-finite-number.d.mts +8 -8
  354. package/dist/number/branded-types/positive-finite-number.mjs +139 -141
  355. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
  356. package/dist/number/branded-types/positive-int.d.mts +11 -11
  357. package/dist/number/branded-types/positive-int.mjs +228 -271
  358. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  359. package/dist/number/branded-types/positive-int16.d.mts +19 -19
  360. package/dist/number/branded-types/positive-int16.mjs +109 -118
  361. package/dist/number/branded-types/positive-int16.mjs.map +1 -1
  362. package/dist/number/branded-types/positive-int32.d.mts +15 -15
  363. package/dist/number/branded-types/positive-int32.mjs +109 -118
  364. package/dist/number/branded-types/positive-int32.mjs.map +1 -1
  365. package/dist/number/branded-types/positive-safe-int.d.mts +11 -11
  366. package/dist/number/branded-types/positive-safe-int.mjs +244 -275
  367. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  368. package/dist/number/branded-types/positive-uint16.d.mts +17 -17
  369. package/dist/number/branded-types/positive-uint16.mjs +109 -118
  370. package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
  371. package/dist/number/branded-types/positive-uint32.d.mts +13 -13
  372. package/dist/number/branded-types/positive-uint32.mjs +110 -119
  373. package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
  374. package/dist/number/branded-types/safe-int.d.mts +4 -4
  375. package/dist/number/branded-types/safe-int.mjs +251 -292
  376. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  377. package/dist/number/branded-types/safe-uint.d.mts +8 -8
  378. package/dist/number/branded-types/safe-uint.mjs +111 -119
  379. package/dist/number/branded-types/safe-uint.mjs.map +1 -1
  380. package/dist/number/branded-types/uint.d.mts +8 -8
  381. package/dist/number/branded-types/uint.mjs +198 -225
  382. package/dist/number/branded-types/uint.mjs.map +1 -1
  383. package/dist/number/branded-types/uint16.d.mts +14 -14
  384. package/dist/number/branded-types/uint16.mjs +109 -119
  385. package/dist/number/branded-types/uint16.mjs.map +1 -1
  386. package/dist/number/branded-types/uint32.d.mts +10 -10
  387. package/dist/number/branded-types/uint32.mjs +110 -117
  388. package/dist/number/branded-types/uint32.mjs.map +1 -1
  389. package/dist/number/enum/int8.mjs +119 -145
  390. package/dist/number/enum/int8.mjs.map +1 -1
  391. package/dist/number/enum/uint8.mjs +107 -121
  392. package/dist/number/enum/uint8.mjs.map +1 -1
  393. package/dist/number/num.d.mts +2 -2
  394. package/dist/number/num.d.mts.map +1 -1
  395. package/dist/number/num.mjs +76 -537
  396. package/dist/number/num.mjs.map +1 -1
  397. package/dist/number/refined-number-utils.d.mts +1 -1
  398. package/dist/number/refined-number-utils.d.mts.map +1 -1
  399. package/dist/number/refined-number-utils.mjs +127 -263
  400. package/dist/number/refined-number-utils.mjs.map +1 -1
  401. package/dist/object/object.d.mts.map +1 -1
  402. package/dist/object/object.mjs +107 -222
  403. package/dist/object/object.mjs.map +1 -1
  404. package/dist/others/cast-mutable.d.mts.map +1 -1
  405. package/dist/others/cast-mutable.mjs +8 -37
  406. package/dist/others/cast-mutable.mjs.map +1 -1
  407. package/dist/others/cast-readonly.d.mts.map +1 -1
  408. package/dist/others/cast-readonly.mjs +8 -36
  409. package/dist/others/cast-readonly.mjs.map +1 -1
  410. package/dist/others/debounce-function.d.mts.map +1 -1
  411. package/dist/others/debounce-function.mjs +7 -16
  412. package/dist/others/debounce-function.mjs.map +1 -1
  413. package/dist/others/fast-deep-equal.d.mts.map +1 -1
  414. package/dist/others/fast-deep-equal.mjs +43 -59
  415. package/dist/others/fast-deep-equal.mjs.map +1 -1
  416. package/dist/others/if-then.d.mts.map +1 -1
  417. package/dist/others/if-then.mjs +0 -29
  418. package/dist/others/if-then.mjs.map +1 -1
  419. package/dist/others/map-nullable.mjs +9 -9
  420. package/dist/others/map-nullable.mjs.map +1 -1
  421. package/dist/others/memoize-function.mjs +12 -12
  422. package/dist/others/memoize-function.mjs.map +1 -1
  423. package/dist/others/tuple.d.mts.map +1 -1
  424. package/dist/others/tuple.mjs +0 -50
  425. package/dist/others/tuple.mjs.map +1 -1
  426. package/dist/others/unknown-to-string.d.mts.map +1 -1
  427. package/dist/others/unknown-to-string.mjs +41 -88
  428. package/dist/others/unknown-to-string.mjs.map +1 -1
  429. package/dist/promise/promise.d.mts.map +1 -1
  430. package/dist/promise/promise.mjs +4 -49
  431. package/dist/promise/promise.mjs.map +1 -1
  432. package/package.json +14 -13
  433. package/src/array/impl/array-utils-creation.mts +3 -3
  434. package/src/array/impl/array-utils-modification.mts +7 -7
  435. package/src/array/impl/array-utils-modification.test.mts +4 -4
  436. package/src/array/impl/array-utils-transformation.mts +4 -4
  437. package/src/array/impl/array-utils-transformation.test.mts +7 -7
  438. package/src/array/impl/array-utils-validation.mts +24 -24
  439. package/src/array/impl/array-utils-validation.test.mts +94 -92
  440. package/src/collections/queue.test.mts +1 -1
  441. package/src/guard/as-length-bounded-array.mts +190 -0
  442. package/src/guard/as-length-bounded-array.test.mts +118 -0
  443. package/src/guard/index.mts +2 -0
  444. package/src/guard/is-length-bounded-array.mts +195 -0
  445. package/src/guard/is-length-bounded-array.test.mts +169 -0
  446. package/src/guard/is-length-bounded-string.mts +6 -6
  447. package/src/object/object.test.mts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"imap-mapped.mjs","sources":["../../src/collections/imap-mapped.mts"],"sourcesContent":[null],"names":["Optional.isSome","Optional.none","Optional.some","Optional.isNone"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmzBA;AACM,IAAW;AAAjB,CAAA,UAAiB,UAAU,EAAA;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CG;AACU,IAAA,UAAA,CAAA,MAAM,GAAG,CACpB,QAAmC,EACnC,KAAmB,EACnB,OAAqB,KAErB,IAAI,eAAe,CAAW,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDG;AACU,IAAA,UAAA,CAAA,KAAK,GAAG,CACnB,CAAuB,EACvB,CAAuB,KAEvB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;AACjB,QAAA,CAAC,CAAC,KAAK,CACL,CAAC,CAAC,EAAE,CAAC,KACH,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAKA,MAAe,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAC1E;AACL,CAAC,EA1HgB,UAAU,KAAV,UAAU,GAAA,EAAA,CAAA,CAAA;AA4H3B;;;;;;;;;;;;;;;;;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-at-end */\nimport { type WidenLiteral } from 'ts-type-forge';\nimport { Optional, pipe } from '../functional/index.mjs';\nimport { asUint32 } from '../number/index.mjs';\nimport { tp } from '../others/index.mjs';\nimport { type MapSetKeyType, type SizeType } from '../types.mjs';\n\n/**\n * Interface for an immutable map with custom key mapping and lookup operations.\n *\n * IMapMapped allows you to use complex objects as keys by providing\n * transformation functions that convert between your custom key type `K` and a\n * primitive `MapSetKeyType` `KM` that can be efficiently stored in JavaScript's\n * native Map. This enables operations on maps with complex keys while\n * maintaining type safety and immutability.\n *\n * **Key Features:**\n *\n * - **Custom Key Types**: Use any type as keys by providing `toKey`/`fromKey`\n * functions\n * - **Immutable**: All operations return new instances, preserving immutability\n * - **Type Safe**: Full TypeScript support with generic key/value types\n *\n * **Performance Characteristics:**\n *\n * - get/has: O(1) average case (plus key transformation overhead)\n * - set/delete: O(n) due to copying for immutability (plus key transformation\n * overhead)\n * - map/filter operations: O(n)\n * - iteration: O(n) (plus key transformation overhead)\n *\n * @template K The type of the custom keys in the map.\n * @template V The type of the values in the map.\n * @template KM The type of the mapped primitive keys (string, number, etc.).\n */\ntype IMapMappedInterface<K, V, KM extends MapSetKeyType> = Readonly<{\n // Getting information\n\n /**\n * The number of elements in the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * assert.isTrue(map.size === 2);\n * ```\n */\n size: SizeType.Arr;\n\n /**\n * Checks if a key exists in the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [[{ x: 1, y: 2 }, 'A']],\n * toKey,\n * fromKey,\n * );\n *\n * assert.isTrue(map.has({ x: 1, y: 2 }));\n *\n * assert.isFalse(map.has({ x: 3, y: 4 }));\n * ```\n *\n * @param key The key to check.\n * @returns `true` if the key exists, `false` otherwise.\n */\n has: (key: K | (WidenLiteral<K> & {})) => boolean;\n\n /**\n * Retrieves the value associated with a key.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [[{ x: 1, y: 2 }, 'A']],\n * toKey,\n * fromKey,\n * );\n *\n * assert.deepStrictEqual(map.get({ x: 1, y: 2 }), Optional.some('A'));\n *\n * assert.deepStrictEqual(map.get({ x: 0, y: 0 }), Optional.none);\n * ```\n *\n * @param key The key to retrieve.\n * @returns The value associated with the key wrapped with `Optional.some`, or\n * `Optional.none` if the key does not exist.\n */\n get: (key: K | (WidenLiteral<K> & {})) => Optional<V>;\n\n // Reducing a value\n\n /**\n * Checks if all elements in the map satisfy a predicate. Also supports a\n * type predicate overload that narrows the type of values in the map if the\n * predicate returns true for all elements.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, number, string>(\n * [\n * [{ x: 0, y: 0 }, 2],\n * [{ x: 1, y: 0 }, 4],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const allEven = map.every((value) => value % 2 === 0);\n *\n * const isNarrowed = map.every((value): value is 2 | 4 => value % 2 === 0);\n *\n * assert.isTrue(allEven);\n *\n * assert.isTrue(isNarrowed);\n * ```\n *\n * @template W The narrowed type of the values.\n * @param predicate A function to test each key-value pair.\n * @returns `true` if all elements satisfy the predicate, `false` otherwise.\n */\n every: ((predicate: (value: V, key: K) => boolean) => boolean) &\n (<W extends V>(\n predicate: (value: V, key: K) => value is W,\n ) => this is IMapMapped<K, W, KM>);\n\n /**\n * Checks if at least one element in the map satisfies a predicate.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, number, string>(\n * [\n * [{ x: 0, y: 0 }, 3],\n * [{ x: 1, y: 0 }, 7],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * assert.isTrue(map.some((value) => value > 5));\n *\n * assert.isFalse(map.some((value) => value > 10));\n * ```\n *\n * @param predicate A function to test each key-value pair.\n * @returns `true` if at least one element satisfies the predicate, `false`\n * otherwise.\n */\n some: (predicate: (value: V, key: K) => boolean) => boolean;\n\n // Mutation\n\n /**\n * Deletes a key-value pair from the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const original = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const withoutRight = original.delete({ x: 1, y: 0 });\n *\n * assert.deepStrictEqual(\n * original.get({ x: 1, y: 0 }),\n * Optional.some('right'),\n * );\n *\n * assert.deepStrictEqual(withoutRight.get({ x: 1, y: 0 }), Optional.none);\n *\n * assert.isTrue(original.size === 2);\n *\n * assert.isTrue(withoutRight.size === 1);\n * ```\n *\n * @param key The key to delete.\n * @returns A new IMapMapped instance without the specified key.\n */\n delete: (key: K) => IMapMapped<K, V, KM>;\n\n /**\n * Sets a key-value pair in the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const base = IMapMapped.create<Point, string, string>(\n * [[{ x: 0, y: 0 }, 'origin']],\n * toKey,\n * fromKey,\n * );\n *\n * const updated = base.set({ x: 0, y: 0 }, 'home');\n *\n * const extended = base.set({ x: 1, y: 0 }, 'right');\n *\n * assert.deepStrictEqual(base.get({ x: 0, y: 0 }), Optional.some('origin'));\n *\n * assert.deepStrictEqual(updated.get({ x: 0, y: 0 }), Optional.some('home'));\n *\n * assert.deepStrictEqual(\n * extended.get({ x: 1, y: 0 }),\n * Optional.some('right'),\n * );\n * ```\n *\n * @param key The key to set.\n * @param value The value to associate with the key.\n * @returns A new IMapMapped instance with the specified key-value pair.\n */\n set: (key: K, value: V) => IMapMapped<K, V, KM>;\n\n /**\n * Updates the value associated with a key using an updater function.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const scores = IMapMapped.create<Point, number, string>(\n * [\n * [{ x: 0, y: 0 }, 10],\n * [{ x: 1, y: 0 }, 8],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const boosted = scores.update({ x: 0, y: 0 }, (value) => value + 5);\n *\n * const unchanged = scores.update({ x: 9, y: 9 }, (value) => value + 1);\n *\n * assert.deepStrictEqual(boosted.get({ x: 0, y: 0 }), Optional.some(15));\n *\n * assert.deepStrictEqual(scores.get({ x: 0, y: 0 }), Optional.some(10));\n *\n * assert.isTrue(unchanged === scores);\n * ```\n *\n * @param key The key whose value to update.\n * @param updater A function that takes the current value and returns the new\n * value.\n * @returns A new IMapMapped instance with the updated value.\n */\n update: (key: K, updater: (value: V) => V) => IMapMapped<K, V, KM>;\n\n /**\n * Applies a series of mutations to the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const base = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const mutated = base.withMutations([\n * { type: 'set', key: { x: 2, y: 0 }, value: 'far' },\n * { type: 'update', key: { x: 1, y: 0 }, updater: (v) => v.toUpperCase() },\n * { type: 'delete', key: { x: 0, y: 0 } },\n * ]);\n *\n * assert.deepStrictEqual(mutated.get({ x: 2, y: 0 }), Optional.some('far'));\n *\n * assert.deepStrictEqual(mutated.get({ x: 1, y: 0 }), Optional.some('RIGHT'));\n *\n * assert.deepStrictEqual(mutated.get({ x: 0, y: 0 }), Optional.none);\n *\n * assert.deepStrictEqual(base.get({ x: 1, y: 0 }), Optional.some('right'));\n * ```\n *\n * @param actions An array of mutation actions (delete, set, or update).\n * @returns A new IMapMapped instance with all mutations applied.\n */\n withMutations: (\n actions: readonly Readonly<\n | { type: 'delete'; key: K }\n | { type: 'set'; key: K; value: V }\n | { type: 'update'; key: K; updater: (value: V) => V }\n >[],\n ) => IMapMapped<K, V, KM>;\n\n // Sequence algorithms\n\n /**\n * Maps the values of the map to new values.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, number, string>(\n * [\n * [{ x: 0, y: 0 }, 1],\n * [{ x: 1, y: 0 }, 2],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const doubled = map.map((value) => value * 2);\n *\n * assert.deepStrictEqual(Array.from(doubled), [\n * [{ x: 0, y: 0 }, 2],\n * [{ x: 1, y: 0 }, 4],\n * ]);\n * ```\n *\n * @template V2 The type of the new values.\n * @param mapFn A function that maps a value and key to a new value.\n * @returns A new IMapMapped instance with mapped values.\n */\n map: <V2>(mapFn: (value: V, key: K) => V2) => IMapMapped<K, V2, KM>;\n\n /**\n * Maps the keys of the map to new keys. Note: The key type cannot be changed\n * because `toKey` and `fromKey` would become unusable.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const shifted = map.mapKeys((p) => ({ x: p.x + 10, y: p.y + 10 }));\n *\n * assert.deepStrictEqual(Array.from(shifted), [\n * [{ x: 10, y: 10 }, 'origin'],\n * [{ x: 11, y: 10 }, 'right'],\n * ]);\n * ```\n *\n * @param mapFn A function that maps a key to a new key of the same type.\n * @returns A new IMapMapped instance with mapped keys.\n */\n mapKeys: (mapFn: (key: K) => K) => IMapMapped<K, V, KM>;\n\n /**\n * Maps the entries (key-value pairs) of the map to new entries.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, number, string>(\n * [\n * [{ x: 0, y: 0 }, 1],\n * [{ x: 1, y: 0 }, 2],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const labeled = map.mapEntries(([key, value]) => [key, `value=${value}`]);\n *\n * assert.deepStrictEqual(Array.from(labeled), [\n * [{ x: 0, y: 0 }, 'value=1'],\n * [{ x: 1, y: 0 }, 'value=2'],\n * ]);\n * ```\n *\n * @template V2 The type of the new values in the entries.\n * @param mapFn A function that maps an entry to a new entry (key must remain\n * the same type).\n * @returns A new IMapMapped instance with mapped entries.\n */\n mapEntries: <V2>(\n mapFn: (entry: readonly [K, V]) => readonly [K, V2],\n ) => IMapMapped<K, V2, KM>;\n\n // Side effects\n\n /**\n * Executes a callback function for each key-value pair in the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const mut_entries: (readonly [Point, string])[] = [];\n *\n * map.forEach((value, key) => {\n * mut_entries.push([key, value]);\n * });\n *\n * assert.deepStrictEqual(mut_entries, [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ]);\n * ```\n *\n * @param callbackfn A function to execute for each element.\n */\n forEach: (callbackfn: (value: V, key: K) => void) => void;\n\n // Iterators\n\n /**\n * Returns an iterator for the keys in the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const keys = Array.from(map.keys());\n *\n * assert.deepStrictEqual(keys, [\n * { x: 0, y: 0 },\n * { x: 1, y: 0 },\n * ]);\n * ```\n *\n * @returns An iterable iterator of keys.\n */\n keys: () => IterableIterator<K>;\n\n /**\n * Returns an iterator for the values in the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const values = Array.from(map.values());\n *\n * assert.deepStrictEqual(values, ['origin', 'right']);\n * ```\n *\n * @returns An iterable iterator of values.\n */\n values: () => IterableIterator<V>;\n\n /**\n * Returns an iterator for the entries (key-value pairs) in the map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const entries = Array.from(map.entries());\n *\n * assert.deepStrictEqual(entries, [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ]);\n * ```\n *\n * @returns An iterable iterator of entries.\n */\n entries: () => IterableIterator<readonly [K, V]>;\n\n // Conversion\n\n /**\n * Converts the keys of the map to an array.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * assert.deepStrictEqual(map.toKeysArray(), [\n * { x: 0, y: 0 },\n * { x: 1, y: 0 },\n * ]);\n * ```\n *\n * @returns A readonly array of keys.\n */\n toKeysArray: () => readonly K[];\n\n /**\n * Converts the values of the map to an array.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * assert.deepStrictEqual(map.toValuesArray(), ['origin', 'right']);\n * ```\n *\n * @returns A readonly array of values.\n */\n toValuesArray: () => readonly V[];\n\n /**\n * Converts the entries (key-value pairs) of the map to an array.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * assert.deepStrictEqual(map.toEntriesArray(), [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ]);\n * ```\n *\n * @returns A readonly array of entries.\n */\n toEntriesArray: () => readonly (readonly [K, V])[];\n\n /**\n * Converts the map to an array of entries (key-value pairs). Alias for\n * `toEntriesArray`.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * assert.deepStrictEqual(map.toArray(), [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ]);\n * ```\n *\n * @returns A readonly array of entries.\n */\n toArray: () => readonly (readonly [K, V])[];\n\n /**\n * Returns the underlying readonly JavaScript Map.\n *\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [[{ x: 1, y: 2 }, 'A']],\n * toKey,\n * fromKey,\n * );\n *\n * const raw = map.toRawMap();\n *\n * assert.isTrue(isMap(raw));\n *\n * assert.isTrue(raw.get(toKey({ x: 1, y: 2 })) === 'A');\n * ```\n *\n * @returns The raw ReadonlyMap instance.\n */\n toRawMap: () => ReadonlyMap<KM, V>;\n}>;\n\n/**\n * Represents an immutable map with custom key transformation and\n * high-performance operations.\n *\n * IMapMapped is a specialized persistent data structure that enables using\n * complex objects as map keys while maintaining the performance benefits of\n * JavaScript's native Map. It achieves this by requiring bidirectional\n * transformation functions that convert between your custom key type and a\n * primitive type that can be efficiently stored and compared.\n *\n * **Key Features:**\n *\n * - **Complex Keys**: Use objects, arrays, or any custom type as map keys\n * - **Immutable**: All mutation operations return new instances\n * - **Type Safe**: Full TypeScript support with compile-time key/value type\n * checking\n * - **Bidirectional**: Maintains ability to reconstruct original keys from mapped\n * keys\n *\n * **Use Cases:**\n *\n * - Maps with composite keys (e.g., coordinates, user IDs with metadata)\n * - Caching with complex cache keys\n * - State management where entities have multi-part identifiers\n * - Performance-critical maps with non-primitive keys\n *\n * @template K The type of the custom keys in the map.\n * @template V The type of the values in the map.\n * @template KM The type of the mapped primitive keys (string, number, etc.).\n */\nexport type IMapMapped<K, V, KM extends MapSetKeyType> = Iterable<\n readonly [K, V]\n> &\n IMapMappedInterface<K, V, KM>;\n\n/** Provides utility functions for IMapMapped. */\nexport namespace IMapMapped {\n /**\n * Creates a new IMapMapped instance with custom key transformation functions.\n *\n * This factory function creates an immutable map that can use complex objects\n * as keys by providing bidirectional transformation functions. The `toKey`\n * function converts your custom key type to a primitive type that can be\n * efficiently stored, while `fromKey` reconstructs the original key type for\n * iteration and access.\n *\n * **Performance:** O(n) where n is the number of entries in the iterable.\n *\n * @template K The type of the custom keys.\n * @template V The type of the values.\n * @template KM The type of the mapped primitive keys.\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * assert.isTrue(map.size === 2);\n *\n * assert.deepStrictEqual(map.get({ x: 0, y: 0 }), Optional.some('origin'));\n * ```\n *\n * @param iterable An iterable of key-value pairs using the custom key type.\n * @param toKey A function that converts a custom key `K` to a primitive key\n * `KM`. This function must be deterministic and produce unique values for\n * unique keys.\n * @param fromKey A function that converts a primitive key `KM` back to the\n * custom key `K`. This should be the inverse of `toKey`.\n * @returns A new IMapMapped instance containing all entries from the\n * iterable.\n */\n export const create = <K, V, KM extends MapSetKeyType>(\n iterable: Iterable<readonly [K, V]>,\n toKey: (a: K) => KM,\n fromKey: (k: KM) => K,\n ): IMapMapped<K, V, KM> =>\n new IMapMappedClass<K, V, KM>(iterable, toKey, fromKey);\n\n /**\n * Checks if two IMapMapped instances are structurally equal.\n *\n * Two IMapMapped instances are considered equal if they have the same size\n * and contain exactly the same key-value pairs. The comparison is performed\n * on the underlying mapped keys and values, so the transformation functions\n * themselves don't need to be identical. Values are compared using\n * JavaScript's `===` operator.\n *\n * **Performance:** O(n) where n is the size of the smaller map.\n *\n * @template K The type of the custom keys.\n * @template V The type of the values.\n * @template KM The type of the mapped primitive keys.\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const first = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const second = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 1, y: 0 }, 'right'],\n * [{ x: 0, y: 0 }, 'origin'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const third = IMapMapped.create<Point, string, string>(\n * [[{ x: 0, y: 0 }, 'different']],\n * toKey,\n * fromKey,\n * );\n *\n * assert.isTrue(IMapMapped.equal(first, second));\n *\n * assert.isFalse(IMapMapped.equal(first, third));\n * ```\n *\n * @param a The first IMapMapped instance to compare.\n * @param b The second IMapMapped instance to compare.\n * @returns `true` if the maps contain exactly the same key-value pairs,\n * `false` otherwise.\n */\n export const equal = <K, V, KM extends MapSetKeyType>(\n a: IMapMapped<K, V, KM>,\n b: IMapMapped<K, V, KM>,\n ): boolean =>\n a.size === b.size &&\n a.every(\n (v, k) =>\n pipe(b.get(k)).map((bv) => Optional.isSome(bv) && bv.value === v).value,\n );\n}\n\n/**\n * Internal class implementation for IMapMapped providing immutable map\n * operations with key transformation.\n *\n * This class implements the IMapMapped interface by maintaining a JavaScript\n * Map with primitive keys internally while exposing an API that works with\n * custom key types. The transformation between custom and primitive keys is\n * handled transparently through the provided `toKey` and `fromKey` functions.\n *\n * **Implementation Details:**\n *\n * - Uses ReadonlyMap<KM, V> internally where KM is the primitive key type\n * - Stores transformation functions for bidirectional key conversion\n * - Implements copy-on-write semantics for efficiency\n * - Provides optional debug messaging for development\n *\n * @template K The type of the custom keys.\n * @template V The type of the values.\n * @template KM The type of the mapped primitive keys.\n * @implements IMapMapped\n * @implements Iterable\n * @internal This class should not be used directly. Use IMapMapped.create() instead.\n */\nclass IMapMappedClass<K, V, KM extends MapSetKeyType>\n implements IMapMapped<K, V, KM>, Iterable<readonly [K, V]>\n{\n readonly #map: ReadonlyMap<KM, V>;\n readonly #toKey: (a: K) => KM;\n readonly #fromKey: (k: KM) => K;\n readonly #showNotFoundMessage: boolean;\n\n /**\n * Constructs an IMapMappedClass instance with custom key transformation.\n *\n * @param iterable An iterable of key-value pairs using the custom key type K.\n * @param toKey A function that converts a custom key K to a primitive key KM.\n * Must be deterministic and produce unique values for unique keys.\n * @param fromKey A function that converts a primitive key KM back to the\n * custom key K. Should be the inverse of the toKey function.\n * @param showNotFoundMessage Whether to log warning messages when operations\n * are performed on non-existent keys. Useful for debugging. Defaults to\n * false for production use.\n * @internal Use IMapMapped.create() instead of calling this constructor directly.\n */\n constructor(\n iterable: Iterable<readonly [K, V]>,\n toKey: (a: K) => KM,\n fromKey: (k: KM) => K,\n showNotFoundMessage: boolean = false,\n ) {\n this.#map = new Map(Array.from(iterable, ([k, v]) => [toKey(k), v]));\n\n this.#toKey = toKey;\n\n this.#fromKey = fromKey;\n\n this.#showNotFoundMessage = showNotFoundMessage;\n }\n\n /** @inheritdoc */\n get size(): SizeType.Arr {\n return asUint32(this.#map.size);\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.#map.has(this.#toKey(key as K));\n }\n\n /** @inheritdoc */\n get(key: K | (WidenLiteral<K> & {})): Optional<V> {\n if (!this.has(key)) return Optional.none;\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, total-functions/no-unsafe-type-assertion\n return Optional.some(this.#map.get(this.#toKey(key as K))!);\n }\n\n /** @inheritdoc */\n every<W extends V>(\n predicate: (value: V, key: K) => value is W,\n ): this is IMapMapped<K, W, KM>;\n\n /** @inheritdoc */\n every(predicate: (value: V, key: K) => boolean): boolean;\n\n /** @inheritdoc */\n every(predicate: (value: V, key: K) => boolean): boolean {\n for (const [k, v] of this.entries()) {\n if (!predicate(v, k)) return false;\n }\n\n return true;\n }\n\n /** @inheritdoc */\n some(predicate: (value: V, key: K) => boolean): boolean {\n for (const [k, v] of this.entries()) {\n if (predicate(v, k)) return true;\n }\n\n return false;\n }\n\n /** @inheritdoc */\n delete(key: K): IMapMapped<K, V, KM> {\n if (!this.has(key)) {\n if (this.#showNotFoundMessage) {\n console.warn(\n `IMapMapped.delete: key not found: ${String(this.#toKey(key))}`,\n );\n }\n\n return this;\n }\n\n const keyMapped = this.#toKey(key);\n\n return IMapMapped.create(\n Array.from(this.#map)\n .filter(([km]) => !Object.is(km, keyMapped))\n .map(([km, v]) => tp(this.#fromKey(km), v)),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n /** @inheritdoc */\n set(key: K, value: V): IMapMapped<K, V, KM> {\n const curr = this.get(key);\n\n if (Optional.isSome(curr) && value === curr.value) return this;\n\n const keyMapped = this.#toKey(key);\n\n if (!this.has(key)) {\n return IMapMapped.create(\n [...this.#map, tp(keyMapped, value)].map(([km, v]) =>\n tp(this.#fromKey(km), v),\n ),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n return IMapMapped.create(\n Array.from(this.#map, ([km, v]) =>\n tp(this.#fromKey(km), Object.is(km, keyMapped) ? value : v),\n ),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n /** @inheritdoc */\n update(key: K, updater: (value: V) => V): IMapMapped<K, V, KM> {\n const curr = this.get(key);\n\n if (Optional.isNone(curr)) {\n if (this.#showNotFoundMessage) {\n console.warn(\n `IMapMapped.update: key not found: ${String(this.#toKey(key))}`,\n );\n }\n\n return this;\n }\n\n const keyMapped = this.#toKey(key);\n\n return IMapMapped.create(\n Array.from(this.#map, ([km, v]) =>\n tp(\n this.#fromKey(km),\n Object.is(km, keyMapped) ? updater(curr.value) : v,\n ),\n ),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n /** @inheritdoc */\n withMutations(\n actions: readonly Readonly<\n | { type: 'delete'; key: K }\n | { type: 'set'; key: K; value: V }\n | { type: 'update'; key: K; updater: (value: V) => V }\n >[],\n ): IMapMapped<K, V, KM> {\n const mut_result = new Map<KM, V>(this.#map);\n\n const updateFn = (\n action: Readonly<\n | { type: 'delete'; key: K }\n | { type: 'set'; key: K; value: V }\n | { type: 'update'; key: K; updater: (value: V) => V }\n >,\n ): void => {\n const key = this.#toKey(action.key);\n\n switch (action.type) {\n case 'delete':\n mut_result.delete(key);\n\n break;\n\n case 'set':\n mut_result.set(key, action.value);\n\n break;\n\n case 'update': {\n const curr = mut_result.get(key);\n\n if (!mut_result.has(key) || curr === undefined) {\n if (this.#showNotFoundMessage) {\n console.warn(\n `IMapMapped.withMutations::update: key not found: ${String(key)}`,\n );\n }\n\n break;\n }\n\n mut_result.set(key, action.updater(curr));\n\n break;\n }\n }\n };\n\n for (const action of actions) {\n updateFn(action);\n }\n\n return IMapMapped.create<K, V, KM>(\n Array.from(mut_result, ([k, v]) => [this.#fromKey(k), v]),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n /** @inheritdoc */\n map<V2>(mapFn: (value: V, key: K) => V2): IMapMapped<K, V2, KM> {\n return IMapMapped.create(\n this.toArray().map(([k, v]) => tp(k, mapFn(v, k))),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n /** @inheritdoc */\n mapKeys(mapFn: (key: K) => K): IMapMapped<K, V, KM> {\n return IMapMapped.create(\n this.toArray().map(([k, v]) => tp(mapFn(k), v)),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n /** @inheritdoc */\n mapEntries<V2>(\n mapFn: (entry: readonly [K, V]) => readonly [K, V2],\n ): IMapMapped<K, V2, KM> {\n return IMapMapped.create(\n this.toArray().map(mapFn),\n this.#toKey,\n this.#fromKey,\n );\n }\n\n /** @inheritdoc */\n forEach(callbackfn: (value: V, key: K) => void): void {\n for (const [km, value] of this.#map) {\n callbackfn(value, this.#fromKey(km));\n }\n }\n\n /**\n * @example\n *\n * ```ts\n * type Point = Readonly<{ x: number; y: number }>;\n *\n * const toKey = (p: Point) => JSON.stringify(p);\n *\n * // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n * const fromKey = (key: string) => JSON.parse(key) as Point;\n *\n * const map = IMapMapped.create<Point, string, string>(\n * [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ],\n * toKey,\n * fromKey,\n * );\n *\n * const collected = Array.from(map);\n *\n * assert.deepStrictEqual(collected, [\n * [{ x: 0, y: 0 }, 'origin'],\n * [{ x: 1, y: 0 }, 'right'],\n * ]);\n * ```\n *\n * @inheritdoc\n */\n *[Symbol.iterator](): Iterator<readonly [K, V]> {\n for (const e of this.entries()) {\n yield e;\n }\n }\n\n /** @inheritdoc */\n *keys(): IterableIterator<K> {\n for (const km of this.#map.keys()) {\n yield this.#fromKey(km);\n }\n }\n\n /** @inheritdoc */\n values(): IterableIterator<V> {\n return this.#map.values();\n }\n\n /** @inheritdoc */\n *entries(): IterableIterator<readonly [K, V]> {\n for (const [km, v] of this.#map) {\n yield [this.#fromKey(km), v];\n }\n }\n\n /** @inheritdoc */\n toKeysArray(): readonly K[] {\n return Array.from(this.keys());\n }\n\n /** @inheritdoc */\n toValuesArray(): readonly V[] {\n return Array.from(this.values());\n }\n\n /** @inheritdoc */\n toEntriesArray(): readonly (readonly [K, V])[] {\n return Array.from(this.entries());\n }\n\n /** @inheritdoc */\n toArray(): readonly (readonly [K, V])[] {\n return Array.from(this.entries());\n }\n\n /** @inheritdoc */\n toRawMap(): ReadonlyMap<KM, V> {\n return this.#map;\n }\n}\n"],"names":["IMapMapped","Optional.isSome","Optional.none","Optional.some","Optional.isNone"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAozBO,IAAU;AAAA,CAAV,CAAUA,WAAAA,KAAV;AAgDE,EAAMA,WAAAA,CAAA,MAAA,GAAS,CACpB,QAAA,EACA,KAAA,EACA,YAEA,IAAI,eAAA,CAA0B,QAAA,EAAU,KAAA,EAAO,OAAO,CAAA;AA4DjD,EAAMA,WAAAA,CAAA,QAAQ,CACnB,CAAA,EACA,MAEA,CAAA,CAAE,IAAA,KAAS,CAAA,CAAE,IAAA,IACb,CAAA,CAAE,KAAA;AAAA,IACA,CAAC,CAAA,EAAG,CAAA,KACF,KAAK,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,CAAA,CAAE,IAAI,CAAC,EAAA,KAAOC,MAAS,CAAO,EAAE,KAAK,EAAA,CAAG,KAAA,KAAU,CAAC,CAAA,CAAE;AAAA,GACtE;AAAA,CAAA,EAzHa,UAAA,KAAA,UAAA,GAAA,EAAA,CAAA,CAAA;AAmJjB,MAAM,eAAA,CAEN;AAAA,EACW,IAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,oBAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeT,WAAA,CACE,QAAA,EACA,KAAA,EACA,OAAA,EACA,sBAA+B,KAAA,EAC/B;AACA,IAAA,IAAA,CAAK,OAAO,IAAI,GAAA,CAAI,KAAA,CAAM,IAAA,CAAK,UAAU,CAAC,CAAC,CAAA,EAAG,CAAC,MAAM,CAAC,KAAA,CAAM,CAAC,CAAA,EAAG,CAAC,CAAC,CAAC,CAAA;AAEnE,IAAA,IAAA,C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EAAE,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GACtE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEtB,2CAA2C;AAC3C,yBAAiB,IAAI,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACI,MAAM,MAAM,GAAI,CAAC,SAAS,aAAa,EAAE,CAAC,YACrC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAClC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAkC,CAAC;IAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACI,MAAM,KAAK,GAAI,CAAC,SAAS,aAAa,EAAE,CAAC,KAC3C,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KACV,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KACZ,OAKA,CAAC;CACL"}
@@ -43,287 +43,202 @@ import '../number/enum/uint8.mjs';
43
43
  import '../number/num.mjs';
44
44
  import '../number/refined-number-utils.mjs';
45
45
 
46
- /** Provides utility functions for IMap. */
47
46
  var IMap;
48
- (function (IMap) {
49
- /**
50
- * Creates a new IMap instance from an iterable of key-value pairs.
51
- *
52
- * This factory function accepts any iterable of [key, value] tuples,
53
- * including arrays, JavaScript Maps, other IMaps, or custom iterables. The
54
- * resulting IMap will contain all the entries from the input iterable.
55
- *
56
- * **Performance:** O(n) where n is the number of entries in the iterable.
57
- *
58
- * @example
59
- *
60
- * ```ts
61
- * const map = IMap.create<string, number | string>([
62
- * ['id', 1],
63
- * ['status', 'active'],
64
- * ]);
65
- *
66
- * assert.isTrue(map.size === 2);
67
- *
68
- * assert.deepStrictEqual(map.get('status'), Optional.some('active'));
69
- * ```
70
- *
71
- * @template K The type of the keys. Must extend MapSetKeyType.
72
- * @template V The type of the values.
73
- * @param iterable An iterable of key-value pairs (e.g., Array, Map, IMap,
74
- * etc.)
75
- * @returns A new IMap instance containing all entries from the iterable.
76
- */
77
- IMap.create = (iterable) => new IMapClass(iterable);
78
- /**
79
- * Checks if two IMap instances are structurally equal.
80
- *
81
- * Two IMaps are considered equal if they have the same size and contain
82
- * exactly the same key-value pairs. The order of entries does not matter for
83
- * equality comparison. Values are compared using JavaScript's `===`
84
- * operator.
85
- *
86
- * **Performance:** O(n) where n is the size of the smaller map.
87
- *
88
- * @example
89
- *
90
- * ```ts
91
- * const first = IMap.create<'a' | 'b', number>([
92
- * ['a', 1],
93
- * ['b', 2],
94
- * ]);
95
- *
96
- * const second = IMap.create<'a' | 'b', number>([
97
- * ['b', 2],
98
- * ['a', 1],
99
- * ]);
100
- *
101
- * const third = IMap.create<'a' | 'b', number>([
102
- * ['a', 1],
103
- * ['b', 3],
104
- * ]);
105
- *
106
- * assert.isTrue(IMap.equal(first, second));
107
- *
108
- * assert.isFalse(IMap.equal(first, third));
109
- * ```
110
- *
111
- * @template K The type of the keys.
112
- * @template V The type of the values.
113
- * @param a The first IMap instance to compare.
114
- * @param b The second IMap instance to compare.
115
- * @returns `true` if the maps contain exactly the same key-value pairs,
116
- * `false` otherwise.
117
- */
118
- IMap.equal = (a, b) => a.size === b.size &&
119
- a.every((v, k) => pipe(b.get(k)).map((v2) => isSome(v2) && v2.value === v).value);
47
+ ((IMap2) => {
48
+ IMap2.create = (iterable) => new IMapClass(iterable);
49
+ IMap2.equal = (a, b) => a.size === b.size && a.every(
50
+ (v, k) => pipe(b.get(k)).map((v2) => isSome(v2) && v2.value === v).value
51
+ );
120
52
  })(IMap || (IMap = {}));
121
- /**
122
- * Internal class implementation for IMap providing immutable map operations.
123
- *
124
- * This class implements the IMap interface using JavaScript's native Map as the
125
- * underlying storage mechanism for optimal performance. All mutation operations
126
- * create new instances rather than modifying the existing map, ensuring
127
- * immutability.
128
- *
129
- * **Implementation Details:**
130
- *
131
- * - Uses Map<K, V> internally for type safety and performance
132
- * - Implements copy-on-write semantics for efficiency
133
- * - Provides optional debug messaging for development
134
- *
135
- * @template K The type of the keys. Must extend MapSetKeyType.
136
- * @template V The type of the values.
137
- * @implements IMap
138
- * @implements Iterable
139
- * @internal This class should not be used directly. Use IMap.create() instead.
140
- */
141
53
  class IMapClass {
142
- #map;
143
- #showNotFoundMessage;
144
- /**
145
- * Constructs an IMapClass instance with the given entries.
146
- *
147
- * @param iterable An iterable of key-value pairs to populate the map.
148
- * @param showNotFoundMessage Whether to log warning messages when operations
149
- * are performed on non-existent keys. Useful for debugging. Defaults to
150
- * false for production use.
151
- * @internal Use IMap.create() instead of calling this constructor directly.
152
- */
153
- constructor(iterable, showNotFoundMessage = false) {
154
- this.#map = new Map(iterable);
155
- this.#showNotFoundMessage = showNotFoundMessage;
156
- }
157
- /** @inheritdoc */
158
- get size() {
159
- return asUint32(this.#map.size);
160
- }
161
- /** @inheritdoc */
162
- has(key) {
163
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion
164
- return this.#map.has(key);
165
- }
166
- /** @inheritdoc */
167
- get(key) {
168
- if (!this.has(key))
169
- return none;
170
- // eslint-disable-next-line total-functions/no-unsafe-type-assertion, @typescript-eslint/no-non-null-assertion
171
- return some(this.#map.get(key));
172
- }
173
- /** @inheritdoc */
174
- every(predicate) {
175
- for (const [k, v] of this.entries()) {
176
- if (!predicate(v, k))
177
- return false;
178
- }
179
- return true;
180
- }
181
- /** @inheritdoc */
182
- some(predicate) {
183
- for (const [k, v] of this.entries()) {
184
- if (predicate(v, k))
185
- return true;
186
- }
187
- return false;
188
- }
189
- /** @inheritdoc */
190
- delete(key) {
191
- if (!this.has(key)) {
54
+ #map;
55
+ #showNotFoundMessage;
56
+ /**
57
+ * Constructs an IMapClass instance with the given entries.
58
+ *
59
+ * @param iterable An iterable of key-value pairs to populate the map.
60
+ * @param showNotFoundMessage Whether to log warning messages when operations
61
+ * are performed on non-existent keys. Useful for debugging. Defaults to
62
+ * false for production use.
63
+ * @internal Use IMap.create() instead of calling this constructor directly.
64
+ */
65
+ constructor(iterable, showNotFoundMessage = false) {
66
+ this.#map = new Map(iterable);
67
+ this.#showNotFoundMessage = showNotFoundMessage;
68
+ }
69
+ /** @inheritdoc */
70
+ get size() {
71
+ return asUint32(this.#map.size);
72
+ }
73
+ /** @inheritdoc */
74
+ has(key) {
75
+ return this.#map.has(key);
76
+ }
77
+ /** @inheritdoc */
78
+ get(key) {
79
+ if (!this.has(key)) return none;
80
+ return some(this.#map.get(key));
81
+ }
82
+ /** @inheritdoc */
83
+ every(predicate) {
84
+ for (const [k, v] of this.entries()) {
85
+ if (!predicate(v, k)) return false;
86
+ }
87
+ return true;
88
+ }
89
+ /** @inheritdoc */
90
+ some(predicate) {
91
+ for (const [k, v] of this.entries()) {
92
+ if (predicate(v, k)) return true;
93
+ }
94
+ return false;
95
+ }
96
+ /** @inheritdoc */
97
+ delete(key) {
98
+ if (!this.has(key)) {
99
+ if (this.#showNotFoundMessage) {
100
+ const keyStr = unknownToString(key);
101
+ console.warn(`IMap.delete: key not found: ${keyStr}`);
102
+ }
103
+ return this;
104
+ }
105
+ return IMap.create(
106
+ Array.from(this.#map).filter(([k]) => !Object.is(k, key))
107
+ );
108
+ }
109
+ /** @inheritdoc */
110
+ set(key, value) {
111
+ const curr = this.get(key);
112
+ if (isSome(curr) && value === curr.value) return this;
113
+ if (!this.has(key)) {
114
+ return IMap.create([...this.#map, tp(key, value)]);
115
+ }
116
+ return IMap.create(
117
+ Array.from(this.#map, ([k, v]) => tp(k, Object.is(k, key) ? value : v))
118
+ );
119
+ }
120
+ /** @inheritdoc */
121
+ update(key, updater) {
122
+ const curr = this.get(key);
123
+ if (isNone(curr)) {
124
+ if (this.#showNotFoundMessage) {
125
+ const keyStr = unknownToString(key);
126
+ console.warn(`IMap.update: key not found: ${keyStr}`);
127
+ }
128
+ return this;
129
+ }
130
+ return IMap.create(
131
+ Array.from(
132
+ this.#map,
133
+ ([k, v]) => tp(k, Object.is(k, key) ? updater(curr.value) : v)
134
+ )
135
+ );
136
+ }
137
+ /** @inheritdoc */
138
+ withMutations(actions) {
139
+ const mut_result = new Map(this.#map);
140
+ const updateFn = (action) => {
141
+ switch (action.type) {
142
+ case "delete":
143
+ mut_result.delete(action.key);
144
+ break;
145
+ case "set":
146
+ mut_result.set(action.key, action.value);
147
+ break;
148
+ case "update": {
149
+ const { key } = action;
150
+ const curr = mut_result.get(key);
151
+ if (!mut_result.has(key) || curr === void 0) {
192
152
  if (this.#showNotFoundMessage) {
193
- const keyStr = unknownToString(key);
194
- console.warn(`IMap.delete: key not found: ${keyStr}`);
195
- }
196
- return this;
197
- }
198
- return IMap.create(Array.from(this.#map).filter(([k]) => !Object.is(k, key)));
199
- }
200
- /** @inheritdoc */
201
- set(key, value) {
202
- const curr = this.get(key);
203
- if (isSome(curr) && value === curr.value)
204
- return this; // has no changes
205
- if (!this.has(key)) {
206
- return IMap.create([...this.#map, tp(key, value)]);
207
- }
208
- return IMap.create(Array.from(this.#map, ([k, v]) => tp(k, Object.is(k, key) ? value : v)));
209
- }
210
- /** @inheritdoc */
211
- update(key, updater) {
212
- const curr = this.get(key);
213
- if (isNone(curr)) {
214
- if (this.#showNotFoundMessage) {
215
- const keyStr = unknownToString(key);
216
- console.warn(`IMap.update: key not found: ${keyStr}`);
217
- }
218
- return this;
219
- }
220
- return IMap.create(Array.from(this.#map, ([k, v]) => tp(k, Object.is(k, key) ? updater(curr.value) : v)));
221
- }
222
- /** @inheritdoc */
223
- withMutations(actions) {
224
- const mut_result = new Map(this.#map);
225
- const updateFn = (action) => {
226
- switch (action.type) {
227
- case 'delete':
228
- mut_result.delete(action.key);
229
- break;
230
- case 'set':
231
- mut_result.set(action.key, action.value);
232
- break;
233
- case 'update': {
234
- const { key } = action;
235
- const curr = mut_result.get(key);
236
- if (!mut_result.has(key) || curr === undefined) {
237
- if (this.#showNotFoundMessage) {
238
- const keyStr = unknownToString(key);
239
- console.warn(`IMap.withMutations: key not found: ${keyStr}`);
240
- }
241
- break;
242
- }
243
- mut_result.set(key, action.updater(curr));
244
- break;
245
- }
153
+ const keyStr = unknownToString(key);
154
+ console.warn(`IMap.withMutations: key not found: ${keyStr}`);
246
155
  }
247
- };
248
- for (const action of actions) {
249
- updateFn(action);
250
- }
251
- return IMap.create(mut_result);
252
- }
253
- /** @inheritdoc */
254
- map(mapFn) {
255
- return IMap.create(this.toArray().map(([k, v]) => tp(k, mapFn(v, k))));
256
- }
257
- /** @inheritdoc */
258
- mapKeys(mapFn) {
259
- return IMap.create(this.toArray().map(([k, v]) => tp(mapFn(k), v)));
260
- }
261
- /** @inheritdoc */
262
- mapEntries(mapFn) {
263
- return IMap.create(this.toArray().map(mapFn));
264
- }
265
- /** @inheritdoc */
266
- forEach(callbackfn) {
267
- for (const [key, value] of this.#map) {
268
- callbackfn(value, key);
156
+ break;
157
+ }
158
+ mut_result.set(key, action.updater(curr));
159
+ break;
269
160
  }
270
- }
271
- /**
272
- * @example
273
- *
274
- * ```ts
275
- * const entries = [
276
- * ['first', 1],
277
- * ['second', 2],
278
- * ] as const satisfies readonly (readonly [string, number])[];
279
- *
280
- * const map = IMap.create(entries);
281
- *
282
- * const collected = Array.from(map);
283
- *
284
- * assert.deepStrictEqual(collected, [
285
- * ['first', 1],
286
- * ['second', 2],
287
- * ]);
288
- * ```
289
- *
290
- * @inheritdoc
291
- */
292
- [Symbol.iterator]() {
293
- return this.#map[Symbol.iterator]();
294
- }
295
- /** @inheritdoc */
296
- keys() {
297
- return this.#map.keys();
298
- }
299
- /** @inheritdoc */
300
- values() {
301
- return this.#map.values();
302
- }
303
- /** @inheritdoc */
304
- entries() {
305
- return this.#map.entries();
306
- }
307
- /** @inheritdoc */
308
- toKeysArray() {
309
- return Array.from(this.keys());
310
- }
311
- /** @inheritdoc */
312
- toValuesArray() {
313
- return Array.from(this.values());
314
- }
315
- /** @inheritdoc */
316
- toEntriesArray() {
317
- return Array.from(this.entries());
318
- }
319
- /** @inheritdoc */
320
- toArray() {
321
- return Array.from(this.entries());
322
- }
323
- /** @inheritdoc */
324
- toRawMap() {
325
- return this.#map;
326
- }
161
+ }
162
+ };
163
+ for (const action of actions) {
164
+ updateFn(action);
165
+ }
166
+ return IMap.create(mut_result);
167
+ }
168
+ /** @inheritdoc */
169
+ map(mapFn) {
170
+ return IMap.create(this.toArray().map(([k, v]) => tp(k, mapFn(v, k))));
171
+ }
172
+ /** @inheritdoc */
173
+ mapKeys(mapFn) {
174
+ return IMap.create(this.toArray().map(([k, v]) => tp(mapFn(k), v)));
175
+ }
176
+ /** @inheritdoc */
177
+ mapEntries(mapFn) {
178
+ return IMap.create(this.toArray().map(mapFn));
179
+ }
180
+ /** @inheritdoc */
181
+ forEach(callbackfn) {
182
+ for (const [key, value] of this.#map) {
183
+ callbackfn(value, key);
184
+ }
185
+ }
186
+ /**
187
+ * @example
188
+ *
189
+ * ```ts
190
+ * const entries = [
191
+ * ['first', 1],
192
+ * ['second', 2],
193
+ * ] as const satisfies readonly (readonly [string, number])[];
194
+ *
195
+ * const map = IMap.create(entries);
196
+ *
197
+ * const collected = Array.from(map);
198
+ *
199
+ * assert.deepStrictEqual(collected, [
200
+ * ['first', 1],
201
+ * ['second', 2],
202
+ * ]);
203
+ * ```
204
+ *
205
+ * @inheritdoc
206
+ */
207
+ [Symbol.iterator]() {
208
+ return this.#map[Symbol.iterator]();
209
+ }
210
+ /** @inheritdoc */
211
+ keys() {
212
+ return this.#map.keys();
213
+ }
214
+ /** @inheritdoc */
215
+ values() {
216
+ return this.#map.values();
217
+ }
218
+ /** @inheritdoc */
219
+ entries() {
220
+ return this.#map.entries();
221
+ }
222
+ /** @inheritdoc */
223
+ toKeysArray() {
224
+ return Array.from(this.keys());
225
+ }
226
+ /** @inheritdoc */
227
+ toValuesArray() {
228
+ return Array.from(this.values());
229
+ }
230
+ /** @inheritdoc */
231
+ toEntriesArray() {
232
+ return Array.from(this.entries());
233
+ }
234
+ /** @inheritdoc */
235
+ toArray() {
236
+ return Array.from(this.entries());
237
+ }
238
+ /** @inheritdoc */
239
+ toRawMap() {
240
+ return this.#map;
241
+ }
327
242
  }
328
243
 
329
244
  export { IMap };