ts-data-forge 1.0.0 → 1.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 (292) hide show
  1. package/README.md +1 -1
  2. package/dist/array/array-utils.d.mts +2617 -0
  3. package/dist/array/array-utils.d.mts.map +1 -0
  4. package/dist/array/array-utils.mjs +2915 -0
  5. package/dist/array/array-utils.mjs.map +1 -0
  6. package/dist/array/index.d.mts +3 -0
  7. package/dist/array/index.d.mts.map +1 -0
  8. package/dist/array/index.mjs +3 -0
  9. package/dist/array/index.mjs.map +1 -0
  10. package/dist/array/tuple-utils.d.mts +421 -0
  11. package/dist/array/tuple-utils.d.mts.map +1 -0
  12. package/dist/array/tuple-utils.mjs +391 -0
  13. package/dist/array/tuple-utils.mjs.map +1 -0
  14. package/dist/collections/imap-mapped.d.mts +445 -0
  15. package/dist/collections/imap-mapped.d.mts.map +1 -0
  16. package/dist/collections/imap-mapped.mjs +424 -0
  17. package/dist/collections/imap-mapped.mjs.map +1 -0
  18. package/dist/collections/imap.d.mts +359 -0
  19. package/dist/collections/imap.d.mts.map +1 -0
  20. package/dist/collections/imap.mjs +338 -0
  21. package/dist/collections/imap.mjs.map +1 -0
  22. package/dist/collections/index.d.mts +7 -0
  23. package/dist/collections/index.d.mts.map +1 -0
  24. package/dist/collections/index.mjs +7 -0
  25. package/dist/collections/index.mjs.map +1 -0
  26. package/dist/collections/iset-mapped.d.mts +576 -0
  27. package/dist/collections/iset-mapped.d.mts.map +1 -0
  28. package/dist/collections/iset-mapped.mjs +522 -0
  29. package/dist/collections/iset-mapped.mjs.map +1 -0
  30. package/dist/collections/iset.d.mts +426 -0
  31. package/dist/collections/iset.d.mts.map +1 -0
  32. package/dist/collections/iset.mjs +437 -0
  33. package/dist/collections/iset.mjs.map +1 -0
  34. package/dist/collections/queue.d.mts +190 -0
  35. package/dist/collections/queue.d.mts.map +1 -0
  36. package/dist/collections/queue.mjs +317 -0
  37. package/dist/collections/queue.mjs.map +1 -0
  38. package/dist/collections/stack.d.mts +210 -0
  39. package/dist/collections/stack.d.mts.map +1 -0
  40. package/dist/collections/stack.mjs +353 -0
  41. package/dist/collections/stack.mjs.map +1 -0
  42. package/dist/expect-type.d.mts +199 -0
  43. package/dist/expect-type.d.mts.map +1 -0
  44. package/dist/expect-type.mjs +201 -0
  45. package/dist/expect-type.mjs.map +1 -0
  46. package/dist/functional/index.d.mts +5 -0
  47. package/dist/functional/index.d.mts.map +1 -0
  48. package/dist/functional/index.mjs +5 -0
  49. package/dist/functional/index.mjs.map +1 -0
  50. package/dist/functional/match.d.mts +215 -0
  51. package/dist/functional/match.d.mts.map +1 -0
  52. package/dist/functional/match.mjs +139 -0
  53. package/dist/functional/match.mjs.map +1 -0
  54. package/dist/functional/optional.d.mts +517 -0
  55. package/dist/functional/optional.d.mts.map +1 -0
  56. package/dist/functional/optional.mjs +532 -0
  57. package/dist/functional/optional.mjs.map +1 -0
  58. package/dist/functional/pipe.d.mts +185 -0
  59. package/dist/functional/pipe.d.mts.map +1 -0
  60. package/dist/functional/pipe.mjs +129 -0
  61. package/dist/functional/pipe.mjs.map +1 -0
  62. package/dist/functional/result.d.mts +796 -0
  63. package/dist/functional/result.d.mts.map +1 -0
  64. package/dist/functional/result.mjs +844 -0
  65. package/dist/functional/result.mjs.map +1 -0
  66. package/dist/globals.d.mts +38 -0
  67. package/dist/guard/has-key.d.mts +100 -0
  68. package/dist/guard/has-key.d.mts.map +1 -0
  69. package/dist/guard/has-key.mjs +94 -0
  70. package/dist/guard/has-key.mjs.map +1 -0
  71. package/dist/guard/index.d.mts +8 -0
  72. package/dist/guard/index.d.mts.map +1 -0
  73. package/dist/guard/index.mjs +8 -0
  74. package/dist/guard/index.mjs.map +1 -0
  75. package/dist/guard/is-non-empty-string.d.mts +106 -0
  76. package/dist/guard/is-non-empty-string.d.mts.map +1 -0
  77. package/dist/guard/is-non-empty-string.mjs +108 -0
  78. package/dist/guard/is-non-empty-string.mjs.map +1 -0
  79. package/dist/guard/is-non-null-object.d.mts +105 -0
  80. package/dist/guard/is-non-null-object.d.mts.map +1 -0
  81. package/dist/guard/is-non-null-object.mjs +108 -0
  82. package/dist/guard/is-non-null-object.mjs.map +1 -0
  83. package/dist/guard/is-primitive.d.mts +146 -0
  84. package/dist/guard/is-primitive.d.mts.map +1 -0
  85. package/dist/guard/is-primitive.mjs +161 -0
  86. package/dist/guard/is-primitive.mjs.map +1 -0
  87. package/dist/guard/is-record.d.mts +151 -0
  88. package/dist/guard/is-record.d.mts.map +1 -0
  89. package/dist/guard/is-record.mjs +155 -0
  90. package/dist/guard/is-record.mjs.map +1 -0
  91. package/dist/guard/is-type.d.mts +430 -0
  92. package/dist/guard/is-type.d.mts.map +1 -0
  93. package/dist/guard/is-type.mjs +432 -0
  94. package/dist/guard/is-type.mjs.map +1 -0
  95. package/dist/guard/key-is-in.d.mts +158 -0
  96. package/dist/guard/key-is-in.d.mts.map +1 -0
  97. package/dist/guard/key-is-in.mjs +160 -0
  98. package/dist/guard/key-is-in.mjs.map +1 -0
  99. package/dist/index.d.mts +11 -0
  100. package/dist/index.d.mts.map +1 -0
  101. package/dist/index.mjs +61 -0
  102. package/dist/index.mjs.map +1 -0
  103. package/dist/iterator/index.d.mts +2 -0
  104. package/dist/iterator/index.d.mts.map +1 -0
  105. package/dist/iterator/index.mjs +2 -0
  106. package/dist/iterator/index.mjs.map +1 -0
  107. package/dist/iterator/range.d.mts +97 -0
  108. package/dist/iterator/range.d.mts.map +1 -0
  109. package/dist/iterator/range.mjs +130 -0
  110. package/dist/iterator/range.mjs.map +1 -0
  111. package/dist/json/index.d.mts +2 -0
  112. package/dist/json/index.d.mts.map +1 -0
  113. package/dist/json/index.mjs +2 -0
  114. package/dist/json/index.mjs.map +1 -0
  115. package/dist/json/json.d.mts +597 -0
  116. package/dist/json/json.d.mts.map +1 -0
  117. package/dist/json/json.mjs +687 -0
  118. package/dist/json/json.mjs.map +1 -0
  119. package/dist/number/branded-types/finite-number.d.mts +291 -0
  120. package/dist/number/branded-types/finite-number.d.mts.map +1 -0
  121. package/dist/number/branded-types/finite-number.mjs +296 -0
  122. package/dist/number/branded-types/finite-number.mjs.map +1 -0
  123. package/dist/number/branded-types/index.d.mts +27 -0
  124. package/dist/number/branded-types/index.d.mts.map +1 -0
  125. package/dist/number/branded-types/index.mjs +27 -0
  126. package/dist/number/branded-types/index.mjs.map +1 -0
  127. package/dist/number/branded-types/int.d.mts +242 -0
  128. package/dist/number/branded-types/int.d.mts.map +1 -0
  129. package/dist/number/branded-types/int.mjs +239 -0
  130. package/dist/number/branded-types/int.mjs.map +1 -0
  131. package/dist/number/branded-types/int16.d.mts +162 -0
  132. package/dist/number/branded-types/int16.d.mts.map +1 -0
  133. package/dist/number/branded-types/int16.mjs +141 -0
  134. package/dist/number/branded-types/int16.mjs.map +1 -0
  135. package/dist/number/branded-types/int32.d.mts +155 -0
  136. package/dist/number/branded-types/int32.d.mts.map +1 -0
  137. package/dist/number/branded-types/int32.mjs +142 -0
  138. package/dist/number/branded-types/int32.mjs.map +1 -0
  139. package/dist/number/branded-types/non-negative-finite-number.d.mts +165 -0
  140. package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -0
  141. package/dist/number/branded-types/non-negative-finite-number.mjs +160 -0
  142. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -0
  143. package/dist/number/branded-types/non-negative-int16.d.mts +160 -0
  144. package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -0
  145. package/dist/number/branded-types/non-negative-int16.mjs +138 -0
  146. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -0
  147. package/dist/number/branded-types/non-negative-int32.d.mts +156 -0
  148. package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -0
  149. package/dist/number/branded-types/non-negative-int32.mjs +138 -0
  150. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -0
  151. package/dist/number/branded-types/non-zero-finite-number.d.mts +154 -0
  152. package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -0
  153. package/dist/number/branded-types/non-zero-finite-number.mjs +160 -0
  154. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -0
  155. package/dist/number/branded-types/non-zero-int.d.mts +131 -0
  156. package/dist/number/branded-types/non-zero-int.d.mts.map +1 -0
  157. package/dist/number/branded-types/non-zero-int.mjs +128 -0
  158. package/dist/number/branded-types/non-zero-int.mjs.map +1 -0
  159. package/dist/number/branded-types/non-zero-int16.d.mts +166 -0
  160. package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -0
  161. package/dist/number/branded-types/non-zero-int16.mjs +145 -0
  162. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -0
  163. package/dist/number/branded-types/non-zero-int32.d.mts +158 -0
  164. package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -0
  165. package/dist/number/branded-types/non-zero-int32.mjs +145 -0
  166. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -0
  167. package/dist/number/branded-types/non-zero-safe-int.d.mts +148 -0
  168. package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -0
  169. package/dist/number/branded-types/non-zero-safe-int.mjs +145 -0
  170. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -0
  171. package/dist/number/branded-types/non-zero-uint16.d.mts +160 -0
  172. package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -0
  173. package/dist/number/branded-types/non-zero-uint16.mjs +140 -0
  174. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -0
  175. package/dist/number/branded-types/non-zero-uint32.d.mts +156 -0
  176. package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -0
  177. package/dist/number/branded-types/non-zero-uint32.mjs +140 -0
  178. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -0
  179. package/dist/number/branded-types/positive-finite-number.d.mts +171 -0
  180. package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -0
  181. package/dist/number/branded-types/positive-finite-number.mjs +165 -0
  182. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -0
  183. package/dist/number/branded-types/positive-int.d.mts +270 -0
  184. package/dist/number/branded-types/positive-int.d.mts.map +1 -0
  185. package/dist/number/branded-types/positive-int.mjs +257 -0
  186. package/dist/number/branded-types/positive-int.mjs.map +1 -0
  187. package/dist/number/branded-types/positive-int16.d.mts +162 -0
  188. package/dist/number/branded-types/positive-int16.d.mts.map +1 -0
  189. package/dist/number/branded-types/positive-int16.mjs +139 -0
  190. package/dist/number/branded-types/positive-int16.mjs.map +1 -0
  191. package/dist/number/branded-types/positive-int32.d.mts +158 -0
  192. package/dist/number/branded-types/positive-int32.d.mts.map +1 -0
  193. package/dist/number/branded-types/positive-int32.mjs +139 -0
  194. package/dist/number/branded-types/positive-int32.mjs.map +1 -0
  195. package/dist/number/branded-types/positive-safe-int.d.mts +152 -0
  196. package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -0
  197. package/dist/number/branded-types/positive-safe-int.mjs +138 -0
  198. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -0
  199. package/dist/number/branded-types/positive-uint16.d.mts +160 -0
  200. package/dist/number/branded-types/positive-uint16.d.mts.map +1 -0
  201. package/dist/number/branded-types/positive-uint16.mjs +139 -0
  202. package/dist/number/branded-types/positive-uint16.mjs.map +1 -0
  203. package/dist/number/branded-types/positive-uint32.d.mts +156 -0
  204. package/dist/number/branded-types/positive-uint32.d.mts.map +1 -0
  205. package/dist/number/branded-types/positive-uint32.mjs +139 -0
  206. package/dist/number/branded-types/positive-uint32.mjs.map +1 -0
  207. package/dist/number/branded-types/safe-int.d.mts +243 -0
  208. package/dist/number/branded-types/safe-int.d.mts.map +1 -0
  209. package/dist/number/branded-types/safe-int.mjs +240 -0
  210. package/dist/number/branded-types/safe-int.mjs.map +1 -0
  211. package/dist/number/branded-types/safe-uint.d.mts +151 -0
  212. package/dist/number/branded-types/safe-uint.d.mts.map +1 -0
  213. package/dist/number/branded-types/safe-uint.mjs +138 -0
  214. package/dist/number/branded-types/safe-uint.mjs.map +1 -0
  215. package/dist/number/branded-types/uint.d.mts +144 -0
  216. package/dist/number/branded-types/uint.d.mts.map +1 -0
  217. package/dist/number/branded-types/uint.mjs +132 -0
  218. package/dist/number/branded-types/uint.mjs.map +1 -0
  219. package/dist/number/branded-types/uint16.d.mts +157 -0
  220. package/dist/number/branded-types/uint16.d.mts.map +1 -0
  221. package/dist/number/branded-types/uint16.mjs +137 -0
  222. package/dist/number/branded-types/uint16.mjs.map +1 -0
  223. package/dist/number/branded-types/uint32.d.mts +185 -0
  224. package/dist/number/branded-types/uint32.d.mts.map +1 -0
  225. package/dist/number/branded-types/uint32.mjs +169 -0
  226. package/dist/number/branded-types/uint32.mjs.map +1 -0
  227. package/dist/number/enum/index.d.mts +3 -0
  228. package/dist/number/enum/index.d.mts.map +1 -0
  229. package/dist/number/enum/index.mjs +3 -0
  230. package/dist/number/enum/index.mjs.map +1 -0
  231. package/dist/number/enum/int8.d.mts +202 -0
  232. package/dist/number/enum/int8.d.mts.map +1 -0
  233. package/dist/number/enum/int8.mjs +296 -0
  234. package/dist/number/enum/int8.mjs.map +1 -0
  235. package/dist/number/enum/uint8.d.mts +128 -0
  236. package/dist/number/enum/uint8.d.mts.map +1 -0
  237. package/dist/number/enum/uint8.mjs +251 -0
  238. package/dist/number/enum/uint8.mjs.map +1 -0
  239. package/dist/number/index.d.mts +5 -0
  240. package/dist/number/index.d.mts.map +1 -0
  241. package/dist/number/index.mjs +31 -0
  242. package/dist/number/index.mjs.map +1 -0
  243. package/dist/number/num.d.mts +515 -0
  244. package/dist/number/num.d.mts.map +1 -0
  245. package/dist/number/num.mjs +513 -0
  246. package/dist/number/num.mjs.map +1 -0
  247. package/dist/number/refined-number-utils.d.mts +191 -0
  248. package/dist/number/refined-number-utils.d.mts.map +1 -0
  249. package/dist/number/refined-number-utils.mjs +179 -0
  250. package/dist/number/refined-number-utils.mjs.map +1 -0
  251. package/dist/object/index.d.mts +2 -0
  252. package/dist/object/index.d.mts.map +1 -0
  253. package/dist/object/index.mjs +2 -0
  254. package/dist/object/index.mjs.map +1 -0
  255. package/dist/object/object.d.mts +296 -0
  256. package/dist/object/object.d.mts.map +1 -0
  257. package/dist/object/object.mjs +295 -0
  258. package/dist/object/object.mjs.map +1 -0
  259. package/dist/others/cast-mutable.d.mts +110 -0
  260. package/dist/others/cast-mutable.d.mts.map +1 -0
  261. package/dist/others/cast-mutable.mjs +114 -0
  262. package/dist/others/cast-mutable.mjs.map +1 -0
  263. package/dist/others/cast-readonly.d.mts +189 -0
  264. package/dist/others/cast-readonly.d.mts.map +1 -0
  265. package/dist/others/cast-readonly.mjs +193 -0
  266. package/dist/others/cast-readonly.mjs.map +1 -0
  267. package/dist/others/if-then.d.mts +98 -0
  268. package/dist/others/if-then.d.mts.map +1 -0
  269. package/dist/others/if-then.mjs +100 -0
  270. package/dist/others/if-then.mjs.map +1 -0
  271. package/dist/others/index.d.mts +8 -0
  272. package/dist/others/index.d.mts.map +1 -0
  273. package/dist/others/index.mjs +8 -0
  274. package/dist/others/index.mjs.map +1 -0
  275. package/dist/others/map-nullable.d.mts +151 -0
  276. package/dist/others/map-nullable.d.mts.map +1 -0
  277. package/dist/others/map-nullable.mjs +159 -0
  278. package/dist/others/map-nullable.mjs.map +1 -0
  279. package/dist/others/memoize-function.d.mts +173 -0
  280. package/dist/others/memoize-function.d.mts.map +1 -0
  281. package/dist/others/memoize-function.mjs +189 -0
  282. package/dist/others/memoize-function.mjs.map +1 -0
  283. package/dist/others/tuple.d.mts +159 -0
  284. package/dist/others/tuple.d.mts.map +1 -0
  285. package/dist/others/tuple.mjs +161 -0
  286. package/dist/others/tuple.mjs.map +1 -0
  287. package/dist/others/unknown-to-string.d.mts +180 -0
  288. package/dist/others/unknown-to-string.d.mts.map +1 -0
  289. package/dist/others/unknown-to-string.mjs +211 -0
  290. package/dist/others/unknown-to-string.mjs.map +1 -0
  291. package/dist/tsconfig.json +1 -0
  292. package/package.json +16 -14
@@ -0,0 +1,522 @@
1
+ import '../number/branded-types/finite-number.mjs';
2
+ import '../number/branded-types/int.mjs';
3
+ import '../number/branded-types/int16.mjs';
4
+ import '../number/branded-types/int32.mjs';
5
+ import '../number/branded-types/non-negative-finite-number.mjs';
6
+ import '../number/branded-types/non-negative-int16.mjs';
7
+ import '../number/branded-types/non-negative-int32.mjs';
8
+ import '../number/branded-types/non-zero-finite-number.mjs';
9
+ import '../number/branded-types/non-zero-int.mjs';
10
+ import '../number/branded-types/non-zero-int16.mjs';
11
+ import '../number/branded-types/non-zero-int32.mjs';
12
+ import '../number/branded-types/non-zero-safe-int.mjs';
13
+ import '../number/branded-types/non-zero-uint16.mjs';
14
+ import '../number/branded-types/non-zero-uint32.mjs';
15
+ import '../number/branded-types/positive-finite-number.mjs';
16
+ import '../number/branded-types/positive-int.mjs';
17
+ import '../number/branded-types/positive-int16.mjs';
18
+ import '../number/branded-types/positive-int32.mjs';
19
+ import '../number/branded-types/positive-safe-int.mjs';
20
+ import '../number/branded-types/positive-uint16.mjs';
21
+ import '../number/branded-types/positive-uint32.mjs';
22
+ import '../number/branded-types/safe-int.mjs';
23
+ import '../number/branded-types/safe-uint.mjs';
24
+ import '../number/branded-types/uint.mjs';
25
+ import '../number/branded-types/uint16.mjs';
26
+ import { asUint32 } from '../number/branded-types/uint32.mjs';
27
+ import '../number/enum/int8.mjs';
28
+ import '../number/enum/uint8.mjs';
29
+ import '../number/num.mjs';
30
+ import '../number/refined-number-utils.mjs';
31
+
32
+ /**
33
+ * Provides utility functions for ISetMapped.
34
+ */
35
+ var ISetMapped;
36
+ (function (ISetMapped) {
37
+ /**
38
+ * Creates a new ISetMapped instance with custom element transformation functions.
39
+ *
40
+ * This factory function creates an immutable set that can use complex objects as elements
41
+ * by providing bidirectional transformation functions. The `toKey` function converts
42
+ * your custom element type to a primitive type that can be efficiently stored, while
43
+ * `fromKey` reconstructs the original element type for iteration and access.
44
+ *
45
+ * **Performance:** O(n) where n is the number of elements in the iterable.
46
+ *
47
+ * @template K The type of the custom elements.
48
+ * @template KM The type of the mapped primitive keys.
49
+ * @param iterable An iterable of elements using the custom element type.
50
+ * @param toKey A function that converts a custom element `K` to a primitive key `KM`.
51
+ * This function must be deterministic and produce unique values for unique elements.
52
+ * @param fromKey A function that converts a primitive key `KM` back to the custom element `K`.
53
+ * This should be the inverse of `toKey`.
54
+ * @returns A new ISetMapped instance containing all unique elements from the iterable.
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * // Example 1: Product catalog with SKU-based identity
59
+ * type Product = { sku: string; name: string; price: number; category: string };
60
+ *
61
+ * const productToKey = (product: Product): string => product.sku;
62
+ * const keyToProduct = (sku: string): Product => {
63
+ * // In practice, this might fetch from a product service or cache
64
+ * return {
65
+ * sku,
66
+ * name: `Product ${sku}`,
67
+ * price: 0,
68
+ * category: "unknown"
69
+ * };
70
+ * };
71
+ *
72
+ * const productSet = ISetMapped.create<Product, string>(
73
+ * [
74
+ * { sku: "LAPTOP-001", name: "Gaming Laptop", price: 1299, category: "electronics" },
75
+ * { sku: "MOUSE-002", name: "Wireless Mouse", price: 49, category: "accessories" },
76
+ * { sku: "LAPTOP-001", name: "Gaming Laptop", price: 1299, category: "electronics" } // Duplicate SKU
77
+ * ],
78
+ * productToKey,
79
+ * keyToProduct
80
+ * );
81
+ *
82
+ * console.log(productSet.size); // Output: 2 (duplicate removed)
83
+ * console.log(productSet.has({ sku: "LAPTOP-001", name: "Gaming Laptop", price: 1299, category: "electronics" })); // true
84
+ *
85
+ * // Example 2: Geographic locations with coordinate-based identity
86
+ * type Location = { name: string; lat: number; lng: number; type: string };
87
+ *
88
+ * const locationToKey = (loc: Location): string => `${loc.lat.toFixed(6)},${loc.lng.toFixed(6)}`;
89
+ * const keyToLocation = (key: string): Location => {
90
+ * const [latStr, lngStr] = key.split(',');
91
+ * return {
92
+ * name: "Unknown Location",
93
+ * lat: parseFloat(latStr),
94
+ * lng: parseFloat(lngStr),
95
+ * type: "point"
96
+ * };
97
+ * };
98
+ *
99
+ * const locationSet = ISetMapped.create<Location, string>(
100
+ * [
101
+ * { name: "Statue of Liberty", lat: 40.689247, lng: -74.044502, type: "monument" },
102
+ * { name: "Empire State Building", lat: 40.748817, lng: -73.985428, type: "building" }
103
+ * ],
104
+ * locationToKey,
105
+ * keyToLocation
106
+ * );
107
+ *
108
+ * // Example 3: User entities with multi-part identity
109
+ * type User = { id: number; tenant: string; email: string; active: boolean };
110
+ *
111
+ * const userToKey = (user: User): string => `${user.tenant}:${user.id}`;
112
+ * const keyToUser = (key: string): User => {
113
+ * const [tenant, idStr] = key.split(':');
114
+ * return {
115
+ * id: Number(idStr),
116
+ * tenant,
117
+ * email: `user${idStr}@${tenant}.com`,
118
+ * active: true
119
+ * };
120
+ * };
121
+ *
122
+ * const userSet = ISetMapped.create<User, string>(
123
+ * [],
124
+ * userToKey,
125
+ * keyToUser
126
+ * )
127
+ * .add({ id: 1, tenant: "acme", email: "alice@acme.com", active: true })
128
+ * .add({ id: 2, tenant: "acme", email: "bob@acme.com", active: false });
129
+ *
130
+ * console.log(userSet.size); // Output: 2
131
+ *
132
+ * // Example 4: Empty set with type specification
133
+ * const emptyProductSet = ISetMapped.create<Product, string>(
134
+ * [],
135
+ * productToKey,
136
+ * keyToProduct
137
+ * );
138
+ * console.log(emptyProductSet.isEmpty); // Output: true
139
+ * ```
140
+ */
141
+ ISetMapped.create = (iterable, toKey, fromKey) => new ISetMappedClass(iterable, toKey, fromKey);
142
+ /**
143
+ * Checks if two ISetMapped instances are structurally equal.
144
+ *
145
+ * Two ISetMapped instances are considered equal if they have the same size and contain
146
+ * exactly the same elements. The comparison is performed on the underlying mapped keys,
147
+ * so the transformation functions themselves don't need to be identical. Elements are
148
+ * compared based on their mapped key representations.
149
+ *
150
+ * **Performance:** O(n) where n is the size of the smaller set.
151
+ *
152
+ * @template K The type of the custom elements.
153
+ * @template KM The type of the mapped primitive keys.
154
+ * @param a The first ISetMapped instance to compare.
155
+ * @param b The second ISetMapped instance to compare.
156
+ * @returns `true` if the sets contain exactly the same elements, `false` otherwise.
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * // Example with coordinate-based elements
161
+ * type Point = { x: number; y: number; label?: string };
162
+ * const pointToKey = (p: Point): string => `${p.x},${p.y}`;
163
+ * const keyToPoint = (s: string): Point => {
164
+ * const [x, y] = s.split(',').map(Number);
165
+ * return { x, y };
166
+ * };
167
+ *
168
+ * const set1 = ISetMapped.create<Point, string>(
169
+ * [{ x: 1, y: 2, label: "A" }, { x: 3, y: 4, label: "B" }],
170
+ * pointToKey,
171
+ * keyToPoint
172
+ * );
173
+ *
174
+ * const set2 = ISetMapped.create<Point, string>(
175
+ * [{ x: 3, y: 4, label: "Different" }, { x: 1, y: 2, label: "Labels" }], // Order doesn't matter
176
+ * pointToKey,
177
+ * keyToPoint
178
+ * );
179
+ *
180
+ * const set3 = ISetMapped.create<Point, string>(
181
+ * [{ x: 1, y: 2 }, { x: 5, y: 6 }], // Different point
182
+ * pointToKey,
183
+ * keyToPoint
184
+ * );
185
+ *
186
+ * console.log(ISetMapped.equal(set1, set2)); // true (same coordinates, labels don't affect equality)
187
+ * console.log(ISetMapped.equal(set1, set3)); // false (different coordinates)
188
+ *
189
+ * // Example with user entities
190
+ * type User = { id: number; department: string; name: string };
191
+ * const userToKey = (u: User): string => `${u.department}:${u.id}`;
192
+ * const keyToUser = (k: string): User => {
193
+ * const [department, idStr] = k.split(':');
194
+ * return { id: Number(idStr), department, name: "" };
195
+ * };
196
+ *
197
+ * const users1 = ISetMapped.create<User, string>(
198
+ * [
199
+ * { id: 1, department: "eng", name: "Alice" },
200
+ * { id: 2, department: "sales", name: "Bob" }
201
+ * ],
202
+ * userToKey,
203
+ * keyToUser
204
+ * );
205
+ *
206
+ * const users2 = ISetMapped.create<User, string>(
207
+ * [
208
+ * { id: 2, department: "sales", name: "Robert" }, // Different name, same identity
209
+ * { id: 1, department: "eng", name: "Alicia" } // Different name, same identity
210
+ * ],
211
+ * userToKey,
212
+ * keyToUser
213
+ * );
214
+ *
215
+ * console.log(ISetMapped.equal(users1, users2)); // true (same department:id combinations)
216
+ *
217
+ * // Empty sets
218
+ * const empty1 = ISetMapped.create<Point, string>([], pointToKey, keyToPoint);
219
+ * const empty2 = ISetMapped.create<Point, string>([], pointToKey, keyToPoint);
220
+ * console.log(ISetMapped.equal(empty1, empty2)); // true
221
+ *
222
+ * // Sets with different transformation functions but same logical content
223
+ * const alternativePointToKey = (p: Point): string => `(${p.x},${p.y})`; // Different format
224
+ * const alternativeKeyToPoint = (s: string): Point => {
225
+ * const match = s.match(/\((\d+),(\d+)\)/)!;
226
+ * return { x: Number(match[1]), y: Number(match[2]) };
227
+ * };
228
+ *
229
+ * const set4 = ISetMapped.create<Point, string>(
230
+ * [{ x: 1, y: 2 }, { x: 3, y: 4 }],
231
+ * alternativePointToKey,
232
+ * alternativeKeyToPoint
233
+ * );
234
+ *
235
+ * // This would be false because the underlying mapped keys are different
236
+ * console.log(ISetMapped.equal(set1, set4)); // false
237
+ * ```
238
+ */
239
+ ISetMapped.equal = (a, b) => a.size === b.size && a.every((e) => b.has(e));
240
+ /**
241
+ * Computes the difference between two ISetMapped instances.
242
+ * @template K The type of the elements.
243
+ * @template KM The type of the mapped keys.
244
+ * @param oldSet The original set.
245
+ * @param newSet The new set.
246
+ * @returns An object containing sets of added and deleted elements.
247
+ * @example
248
+ * ```typescript
249
+ * type Tag = { name: string };
250
+ * const tagToKey = (t: Tag): string => t.name;
251
+ * const keyToTag = (name: string): Tag => ({ name });
252
+ *
253
+ * const oldTags = ISetMapped.create<Tag, string>(
254
+ * [{ name: "typescript" }, { name: "javascript" }],
255
+ * tagToKey,
256
+ * keyToTag
257
+ * );
258
+ * const newTags = ISetMapped.create<Tag, string>(
259
+ * [{ name: "javascript" }, { name: "react" }, { name: "nextjs" }],
260
+ * tagToKey,
261
+ * keyToTag
262
+ * );
263
+ *
264
+ * const diffResult = ISetMapped.diff(oldTags, newTags);
265
+ *
266
+ * console.log("Deleted tags:", diffResult.deleted.toArray().map(t => t.name));
267
+ * // Output: Deleted tags: ["typescript"]
268
+ *
269
+ * console.log("Added tags:", diffResult.added.toArray().map(t => t.name));
270
+ * // Output: Added tags: ["react", "nextjs"]
271
+ * ```
272
+ */
273
+ ISetMapped.diff = (oldSet, newSet) => ({
274
+ deleted: oldSet.subtract(newSet),
275
+ added: newSet.subtract(oldSet),
276
+ });
277
+ /**
278
+ * Computes the intersection of two ISetMapped instances.
279
+ * @template K The type of the elements.
280
+ * @template KM The type of the mapped keys.
281
+ * @param a The first set.
282
+ * @param b The second set.
283
+ * @returns A new ISetMapped instance representing the intersection.
284
+ * @example
285
+ * ```typescript
286
+ * type Permission = { id: string };
287
+ * const permToKey = (p: Permission): string => p.id;
288
+ * const keyToPerm = (id: string): Permission => ({ id });
289
+ *
290
+ * const userPermissions = ISetMapped.create<Permission, string>(
291
+ * [{ id: "read" }, { id: "write" }, { id: "delete" }],
292
+ * permToKey,
293
+ * keyToPerm
294
+ * );
295
+ * const rolePermissions = ISetMapped.create<Permission, string>(
296
+ * [{ id: "read" }, { id: "comment" }, { id: "write" }],
297
+ * permToKey,
298
+ * keyToPerm
299
+ * );
300
+ *
301
+ * const commonPermissions = ISetMapped.intersection(userPermissions, rolePermissions);
302
+ * console.log(commonPermissions.toArray().map(p => p.id)); // Output: ["read", "write"]
303
+ * ```
304
+ */
305
+ ISetMapped.intersection = (a, b) => a.intersect(b);
306
+ /**
307
+ * Computes the union of two ISetMapped instances.
308
+ * @template K The type of the elements.
309
+ * @template KM The type of the mapped keys.
310
+ * @param a The first set.
311
+ * @param b The second set.
312
+ * @returns A new ISetMapped instance representing the union.
313
+ * @example
314
+ * ```typescript
315
+ * type FeatureFlag = { flagName: string };
316
+ * const flagToKey = (f: FeatureFlag): string => f.flagName;
317
+ * const keyToFlag = (name: string): FeatureFlag => ({ flagName: name });
318
+ *
319
+ * const setA = ISetMapped.create<FeatureFlag, string>(
320
+ * [{ flagName: "newUI" }, { flagName: "betaFeature" }],
321
+ * flagToKey,
322
+ * keyToFlag
323
+ * );
324
+ * const setB = ISetMapped.create<FeatureFlag, string>(
325
+ * [{ flagName: "betaFeature" }, { flagName: "darkMode" }],
326
+ * flagToKey,
327
+ * keyToFlag
328
+ * );
329
+ *
330
+ * const combinedFlags = ISetMapped.union(setA, setB);
331
+ * // The order might vary as sets are unordered internally.
332
+ * console.log(combinedFlags.toArray().map(f => f.flagName).sort());
333
+ * // Output: ["betaFeature", "darkMode", "newUI"]
334
+ * ```
335
+ */
336
+ ISetMapped.union = (a, b) => a.union(b);
337
+ })(ISetMapped || (ISetMapped = {}));
338
+ /**
339
+ * Internal class implementation for ISetMapped providing immutable set operations with element transformation.
340
+ *
341
+ * This class implements the ISetMapped interface by maintaining a JavaScript Set with primitive keys
342
+ * internally while exposing an API that works with custom element types. The transformation between
343
+ * custom and primitive elements is handled transparently through the provided `toKey` and `fromKey` functions.
344
+ *
345
+ * **Implementation Details:**
346
+ * - Uses ReadonlySet<KM> internally where KM is the primitive key type
347
+ * - Stores transformation functions for bidirectional element conversion
348
+ * - Implements copy-on-write semantics for efficiency
349
+ * - Provides optional debug messaging for development
350
+ *
351
+ * @template K The type of the custom elements.
352
+ * @template KM The type of the mapped primitive keys.
353
+ * @implements ISetMapped
354
+ * @implements Iterable
355
+ * @internal This class should not be used directly. Use ISetMapped.create() instead.
356
+ */
357
+ class ISetMappedClass {
358
+ #set;
359
+ #toKey;
360
+ #fromKey;
361
+ #showNotFoundMessage;
362
+ /**
363
+ * Constructs an ISetMappedClass instance with custom element transformation.
364
+ *
365
+ * @param iterable An iterable of elements using the custom element type K.
366
+ * @param toKey A function that converts a custom element K to a primitive key KM.
367
+ * Must be deterministic and produce unique values for unique elements.
368
+ * @param fromKey A function that converts a primitive key KM back to the custom element K.
369
+ * Should be the inverse of the toKey function.
370
+ * @param showNotFoundMessage Whether to log warning messages when operations
371
+ * are performed on non-existent elements. Useful for debugging.
372
+ * Defaults to false for production use.
373
+ * @internal Use ISetMapped.create() instead of calling this constructor directly.
374
+ */
375
+ constructor(iterable, toKey, fromKey, showNotFoundMessage = false) {
376
+ this.#set = new Set(Array.from(iterable, toKey));
377
+ this.#toKey = toKey;
378
+ this.#fromKey = fromKey;
379
+ this.#showNotFoundMessage = showNotFoundMessage;
380
+ }
381
+ /** @inheritdoc */
382
+ get size() {
383
+ return asUint32(this.#set.size);
384
+ }
385
+ /** @inheritdoc */
386
+ get isEmpty() {
387
+ return this.size === 0;
388
+ }
389
+ /** @inheritdoc */
390
+ has(key) {
391
+ return this.#set.has(this.#toKey(key));
392
+ }
393
+ /** @inheritdoc */
394
+ every(predicate) {
395
+ for (const key of this.values()) {
396
+ if (!predicate(key))
397
+ return false;
398
+ }
399
+ return true;
400
+ }
401
+ /** @inheritdoc */
402
+ some(predicate) {
403
+ for (const key of this.values()) {
404
+ if (predicate(key))
405
+ return true;
406
+ }
407
+ return false;
408
+ }
409
+ /** @inheritdoc */
410
+ add(key) {
411
+ if (this.has(key))
412
+ return this;
413
+ return ISetMapped.create([...this.#set, this.#toKey(key)].map(this.#fromKey), this.#toKey, this.#fromKey);
414
+ }
415
+ /** @inheritdoc */
416
+ delete(key) {
417
+ if (!this.has(key)) {
418
+ if (this.#showNotFoundMessage) {
419
+ console.warn(`ISetMapped.delete: key not found: ${String(this.#toKey(key))}`);
420
+ }
421
+ return this;
422
+ }
423
+ const keyMapped = this.#toKey(key);
424
+ return ISetMapped.create(Array.from(this.#set)
425
+ .filter((k) => !Object.is(k, keyMapped))
426
+ .map(this.#fromKey), this.#toKey, this.#fromKey);
427
+ }
428
+ /** @inheritdoc */
429
+ withMutations(actions) {
430
+ const mut_result = new Set(this.#set);
431
+ for (const action of actions) {
432
+ const key = this.#toKey(action.key);
433
+ switch (action.type) {
434
+ case 'delete':
435
+ mut_result.delete(key);
436
+ break;
437
+ case 'add':
438
+ mut_result.add(key);
439
+ break;
440
+ }
441
+ }
442
+ return ISetMapped.create(Array.from(mut_result, this.#fromKey), this.#toKey, this.#fromKey);
443
+ }
444
+ /** @inheritdoc */
445
+ map(mapFn) {
446
+ return ISetMapped.create(this.toArray().map(mapFn), this.#toKey, this.#fromKey);
447
+ }
448
+ /** @inheritdoc */
449
+ filter(predicate) {
450
+ return ISetMapped.create(this.toArray().filter(predicate), this.#toKey, this.#fromKey);
451
+ }
452
+ /** @inheritdoc */
453
+ filterNot(predicate) {
454
+ return ISetMapped.create(this.toArray().filter((k) => !predicate(k)), this.#toKey, this.#fromKey);
455
+ }
456
+ /** @inheritdoc */
457
+ forEach(callbackfn) {
458
+ for (const km of this.#set) {
459
+ callbackfn(this.#fromKey(km));
460
+ }
461
+ }
462
+ /** @inheritdoc */
463
+ isSubsetOf(set) {
464
+ return this.every((k) => set.has(k));
465
+ }
466
+ /** @inheritdoc */
467
+ isSupersetOf(set) {
468
+ return set.every((k) => this.has(k));
469
+ }
470
+ /** @inheritdoc */
471
+ subtract(set) {
472
+ return ISetMapped.create(this.toArray().filter((k) => !set.has(k)), this.#toKey, this.#fromKey);
473
+ }
474
+ /** @inheritdoc */
475
+ intersect(set) {
476
+ return ISetMapped.create(this.toArray().filter((k) => set.has(k)), this.#toKey, this.#fromKey);
477
+ }
478
+ /** @inheritdoc */
479
+ union(set) {
480
+ return ISetMapped.create([...this.values(), ...set.values()], this.#toKey, this.#fromKey);
481
+ }
482
+ /**
483
+ * @inheritdoc
484
+ */
485
+ *[Symbol.iterator]() {
486
+ for (const k of this.keys()) {
487
+ yield k;
488
+ }
489
+ }
490
+ /** @inheritdoc */
491
+ *keys() {
492
+ for (const km of this.#set.keys()) {
493
+ yield this.#fromKey(km);
494
+ }
495
+ }
496
+ /** @inheritdoc */
497
+ *values() {
498
+ for (const km of this.#set.keys()) {
499
+ // JavaScript Set's values() is an alias for keys()
500
+ yield this.#fromKey(km);
501
+ }
502
+ }
503
+ /** @inheritdoc */
504
+ *entries() {
505
+ for (const km of this.#set.keys()) {
506
+ // JavaScript Set's entries() yields [value, value]
507
+ const a = this.#fromKey(km);
508
+ yield [a, a];
509
+ }
510
+ }
511
+ /** @inheritdoc */
512
+ toArray() {
513
+ return Array.from(this.values());
514
+ }
515
+ /** @inheritdoc */
516
+ toRawSet() {
517
+ return this.#set;
518
+ }
519
+ }
520
+
521
+ export { ISetMapped };
522
+ //# sourceMappingURL=iset-mapped.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iset-mapped.mjs","sources":["../../src/collections/iset-mapped.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAySA;;AAEG;AACG,IAAW;AAAjB,CAAA,UAAiB,UAAU,EAAA;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGG;AACU,IAAA,UAAA,CAAA,MAAM,GAAG,CACpB,QAAqB,EACrB,KAAmB,EACnB,OAAqB,KACC,IAAI,eAAe,CAAQ,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGG;AACU,IAAA,UAAA,CAAA,KAAK,GAAG,CACnB,CAAoB,EACpB,CAAoB,KACR,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;IACU,UAAA,CAAA,IAAI,GAAG,CAClB,MAAyB,EACzB,MAAyB,MACmC;AAC5D,QAAA,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChC,QAAA,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AAC/B,KAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AAC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