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,201 @@
1
+ /**
2
+ * Compile-time type assertion utility for TypeScript type testing.
3
+ *
4
+ * This function performs static type relationship checking at compile-time and has no runtime effect.
5
+ * It is primarily used in test files to verify that TypeScript's type inference and type relationships
6
+ * work as expected. The function will cause TypeScript compilation errors if the specified type
7
+ * relationship does not hold.
8
+ *
9
+ * ## Supported Type Relations
10
+ *
11
+ * ### Equality Relations
12
+ * - **`"="` (strict equality)**: Asserts that types `A` and `B` are exactly the same type.
13
+ * Uses TypeScript's internal type equality checking.
14
+ * - **`"!="` (strict inequality)**: Asserts that types `A` and `B` are not exactly the same type.
15
+ *
16
+ * ### Assignability Relations
17
+ * - **`"~="` (mutual assignability)**: Asserts that `A` extends `B` AND `B` extends `A`.
18
+ * Types are structurally equivalent and mutually assignable.
19
+ * - **`"<="` (subtype relation)**: Asserts that type `A` extends (is assignable to) type `B`.
20
+ * Type `A` is a subtype of `B`.
21
+ * - **`">="` (supertype relation)**: Asserts that type `B` extends (is assignable to) type `A`.
22
+ * Type `A` is a supertype of `B`.
23
+ *
24
+ * ### Negative Assignability Relations
25
+ * - **`"!<="` (not subtype)**: Asserts that type `A` does NOT extend type `B`.
26
+ * - **`"!>="` (not supertype)**: Asserts that type `B` does NOT extend type `A`.
27
+ *
28
+ * ## Type Parameter Constraints
29
+ *
30
+ * @template A - The first type for comparison. Can be any TypeScript type including:
31
+ * - Primitive types (string, number, boolean, etc.)
32
+ * - Object types and interfaces
33
+ * - Union and intersection types
34
+ * - Generic types and type parameters
35
+ * - Literal types and branded types
36
+ * - Function types and return types
37
+ * @template B - The second type for comparison. Same constraints as type `A`.
38
+ *
39
+ * @param _relation - A string literal representing the expected type relationship.
40
+ * TypeScript's type system automatically infers and restricts the available operators
41
+ * based on the actual relationship between types `A` and `B`. If an invalid relationship
42
+ * is specified, TypeScript will show a compilation error.
43
+ *
44
+ * ## Usage Patterns
45
+ *
46
+ * ### Basic Type Testing
47
+ * @example
48
+ * ```typescript
49
+ * import { expectType } from './expect-type.mjs';
50
+ *
51
+ * // Primitive type equality
52
+ * expectType<string, string>("="); // ✓ exact match
53
+ * expectType<number, string>("!="); // ✓ different types
54
+ * expectType<42, number>("<="); // ✓ literal extends primitive
55
+ * expectType<number, 42>(">="); // ✓ primitive is supertype
56
+ *
57
+ * // Type assertions will cause compilation errors for wrong relationships:
58
+ * // expectType<string, number>("="); // ❌ TypeScript error
59
+ * // expectType<number, string>("<="); // ❌ TypeScript error
60
+ * ```
61
+ *
62
+ * ### Array and Tuple Type Validation
63
+ * @example
64
+ * ```typescript
65
+ * // Testing array utility function return types
66
+ * const zeros = Arr.zeros(3);
67
+ * expectType<typeof zeros, readonly [0, 0, 0]>("=");
68
+ *
69
+ * const sequence = Arr.seq(5);
70
+ * expectType<typeof sequence, readonly [0, 1, 2, 3, 4]>("=");
71
+ *
72
+ * // Dynamic length arrays
73
+ * const dynamicArray = Arr.zeros(someLength);
74
+ * expectType<typeof dynamicArray, readonly 0[]>("=");
75
+ * ```
76
+ *
77
+ * ### Function Return Type Testing
78
+ * @example
79
+ * ```typescript
80
+ * // Testing function return types
81
+ * const createUser = () => ({ id: 1, name: 'John' });
82
+ * expectType<ReturnType<typeof createUser>, { id: number; name: string }>("~=");
83
+ *
84
+ * // Generic function type inference
85
+ * const identity = <T>(x: T): T => x;
86
+ * const result = identity('hello');
87
+ * expectType<typeof result, string>("=");
88
+ * ```
89
+ *
90
+ * ### Union and Intersection Types
91
+ * @example
92
+ * ```typescript
93
+ * // Union type relationships
94
+ * expectType<string, string | number>("<="); // string extends union
95
+ * expectType<string | number, string>(">="); // union contains string
96
+ * expectType<string | number, number>(">="); // union contains number
97
+ *
98
+ * // Intersection type relationships
99
+ * type A = { a: number };
100
+ * type B = { b: string };
101
+ * expectType<A & B, A>(">="); // intersection extends component
102
+ * expectType<A, A & B>("<="); // component extends intersection
103
+ * ```
104
+ *
105
+ * ### Branded Type Validation
106
+ * @example
107
+ * ```typescript
108
+ * // Testing branded number types
109
+ * expectType<PositiveInt, number>("<="); // branded type extends base
110
+ * expectType<number, PositiveInt>(">="); // base type is supertype
111
+ * expectType<PositiveInt, NegativeInt>("!="); // different branded types
112
+ *
113
+ * // Type guard function validation
114
+ * if (isPositiveInt(value)) {
115
+ * expectType<typeof value, PositiveInt>("<=");
116
+ * }
117
+ * ```
118
+ *
119
+ * ### Optional and Result Type Testing
120
+ * @example
121
+ * ```typescript
122
+ * // Optional type narrowing
123
+ * const optional: Optional<number> = Optional.some(42);
124
+ * if (Optional.isSome(optional)) {
125
+ * expectType<typeof optional, Optional.Some<number>>("<=");
126
+ * }
127
+ * if (Optional.isNone(optional)) {
128
+ * expectType<typeof optional, Optional.None>("<=");
129
+ * }
130
+ *
131
+ * // Result type validation
132
+ * const result: Result<string, Error> = Result.ok('success');
133
+ * expectType<typeof result, Result<string, Error>>("<=");
134
+ * ```
135
+ *
136
+ * ### Type Guard and Validation Testing
137
+ * @example
138
+ * ```typescript
139
+ * // Testing type guard functions
140
+ * if (isRecord(value)) {
141
+ * expectType<typeof value, UnknownRecord>("<=");
142
+ * }
143
+ *
144
+ * // Testing compile-time type predicates
145
+ * const obj = { key: 'value' };
146
+ * if (hasKey(obj, 'key')) {
147
+ * expectType<typeof obj.key, unknown>("<=");
148
+ * }
149
+ * ```
150
+ *
151
+ * ## Common Testing Patterns
152
+ *
153
+ * ### Dual Testing Strategy
154
+ * Combine `expectType` with runtime assertions for comprehensive testing:
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * describe('Arr.zeros', () => {
159
+ * test('should create array of zeros with correct type', () => {
160
+ * const result = Arr.zeros(3);
161
+ *
162
+ * // Compile-time type assertion
163
+ * expectType<typeof result, readonly [0, 0, 0]>("=");
164
+ *
165
+ * // Runtime behavior assertion
166
+ * expect(result).toStrictEqual([0, 0, 0]);
167
+ * });
168
+ * });
169
+ * ```
170
+ *
171
+ * ### Type Relationship Validation
172
+ * Test complex type hierarchies and relationships:
173
+ *
174
+ * @example
175
+ * ```typescript
176
+ * // Ensure proper type hierarchy
177
+ * expectType<PositiveInt, Int>("<="); // positive is subset of int
178
+ * expectType<Int, FiniteNumber>("<="); // int is subset of finite
179
+ * expectType<FiniteNumber, number>("<="); // finite is subset of number
180
+ *
181
+ * // Verify mutual exclusion
182
+ * expectType<PositiveInt, NegativeInt>("!="); // different int types
183
+ * expectType<PositiveInt, NegativeInt>("!<="); // neither extends the other
184
+ * expectType<NegativeInt, PositiveInt>("!<=");
185
+ * ```
186
+ *
187
+ * ## Important Notes
188
+ *
189
+ * - **Compile-time only**: This function has no runtime behavior and will be optimized away.
190
+ * - **Type inference**: The available relation operators are automatically inferred by TypeScript
191
+ * based on the actual type relationship between `A` and `B`.
192
+ * - **Error feedback**: Invalid type relationships will cause clear TypeScript compilation errors.
193
+ * - **Test organization**: Typically used in `.test.mts` files alongside runtime assertions.
194
+ * - **Performance**: Has zero runtime overhead as it's purely a compile-time construct.
195
+ *
196
+ * @since 1.0.0
197
+ */
198
+ const expectType = (_relation) => undefined;
199
+
200
+ export { expectType };
201
+ //# sourceMappingURL=expect-type.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expect-type.mjs","sources":["../src/expect-type.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoMG;AACI,MAAM,UAAU,GAAG,CACxB,SAMoE,KAC3D;;;;"}
@@ -0,0 +1,5 @@
1
+ export * from './match.mjs';
2
+ export * from './optional.mjs';
3
+ export * from './pipe.mjs';
4
+ export * from './result.mjs';
5
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/functional/index.mts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { match } from './match.mjs';
2
+ export { Optional } from './optional.mjs';
3
+ export { pipe } from './pipe.mjs';
4
+ export { Result } from './result.mjs';
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,215 @@
1
+ /**
2
+ * @internal
3
+ * Utility type to extract the union of all values from a record type.
4
+ * @template T The record type to extract values from.
5
+ */
6
+ type ValueOf<T> = T[keyof T];
7
+ /**
8
+ * @internal
9
+ * Represents a record with unknown value types.
10
+ */
11
+ type UnknownRecord = Record<PropertyKey, unknown>;
12
+ /**
13
+ * @internal
14
+ * Represents a readonly record mapping keys of type K to values of type V.
15
+ * @template K The type of keys.
16
+ * @template V The type of values.
17
+ */
18
+ type ReadonlyRecord<K extends PropertyKey, V> = Readonly<Record<K, V>>;
19
+ /**
20
+ * @internal
21
+ * A relaxed version of Exclude that handles edge cases with property keys.
22
+ * @template T The type to exclude from.
23
+ * @template U The type to exclude.
24
+ */
25
+ type RelaxedExclude<T, U> = T extends U ? never : T;
26
+ /**
27
+ * @internal
28
+ * Checks if two types are exactly equal.
29
+ * @template T First type to compare.
30
+ * @template U Second type to compare.
31
+ */
32
+ type TypeEq<T, U> = [T] extends [U] ? ([U] extends [T] ? true : false) : false;
33
+ /**
34
+ * Type-safe pattern matching function for string-based discriminated unions.
35
+ *
36
+ * Provides compile-time guarantees for exhaustive case handling when working with
37
+ * literal string unions. Automatically enforces completeness checking when all
38
+ * cases are covered, and requires a default value when cases are incomplete.
39
+ *
40
+ * ## Key Features:
41
+ * - **Exhaustive Matching**: When all cases of a literal union are handled, no default value is needed
42
+ * - **Partial Matching**: When cases are incomplete or working with general string types, a default value is required
43
+ * - **Type Safety**: Prevents extra cases and ensures only valid keys are used
44
+ * - **Strict Property Checking**: Rejects objects with unexpected properties
45
+ *
46
+ * @param target - The value to match against
47
+ * @param cases - Object mapping possible values to their corresponding results
48
+ * @param defaultValue - Fallback value (required when not all cases are covered)
49
+ * @returns The matched result or default value
50
+ *
51
+ * @example
52
+ * Exhaustive matching (no default needed):
53
+ * ```typescript
54
+ * type Status = 'loading' | 'success' | 'error';
55
+ * const status: Status = 'loading';
56
+ *
57
+ * const message = match(status, {
58
+ * loading: 'Please wait...',
59
+ * success: 'Operation completed!',
60
+ * error: 'Something went wrong'
61
+ * });
62
+ * // Type: string
63
+ * // Result: 'Please wait...'
64
+ * ```
65
+ *
66
+ * @example
67
+ * Partial matching (default required):
68
+ * ```typescript
69
+ * type Priority = 'low' | 'medium' | 'high' | 'critical';
70
+ * const priority: Priority = 'medium';
71
+ *
72
+ * const color = match(priority, {
73
+ * high: 'red',
74
+ * critical: 'darkred'
75
+ * }, 'gray'); // Default required for uncovered cases
76
+ * // Type: 'red' | 'darkred' | 'gray'
77
+ * // Result: 'gray'
78
+ * ```
79
+ *
80
+ * @example
81
+ * Working with general string types:
82
+ * ```typescript
83
+ * const userInput: string = getUserInput();
84
+ *
85
+ * const route = match(userInput, {
86
+ * 'home': '/',
87
+ * 'about': '/about',
88
+ * 'contact': '/contact'
89
+ * }, '/404'); // Default required for string type
90
+ * // Type: '/' | '/about' | '/contact' | '/404'
91
+ * ```
92
+ *
93
+ * @example
94
+ * HTTP status code handling:
95
+ * ```typescript
96
+ * type HttpStatus = 200 | 404 | 500;
97
+ * const status: HttpStatus = 404;
98
+ *
99
+ * const response = match(String(status), {
100
+ * '200': { ok: true, message: 'Success' },
101
+ * '404': { ok: false, message: 'Not Found' },
102
+ * '500': { ok: false, message: 'Server Error' }
103
+ * });
104
+ * // All cases covered, no default needed
105
+ * // Result: { ok: false, message: 'Not Found' }
106
+ * ```
107
+ *
108
+ * @example
109
+ * Complex discriminated union handling:
110
+ * ```typescript
111
+ * type ApiResponse =
112
+ * | { status: 'loading' }
113
+ * | { status: 'success'; data: string }
114
+ * | { status: 'error'; error: string };
115
+ *
116
+ * const handleResponse = (response: ApiResponse) =>
117
+ * match(response.status, {
118
+ * loading: 'Please wait...',
119
+ * success: 'Data loaded successfully!',
120
+ * error: 'Failed to load data'
121
+ * });
122
+ * ```
123
+ *
124
+ * @example
125
+ * Advanced usage with functional composition:
126
+ * ```typescript
127
+ * // Creating reusable matchers
128
+ * const logLevelToColor = (level: string) => match(level, {
129
+ * 'debug': 'gray',
130
+ * 'info': 'blue',
131
+ * 'warn': 'yellow',
132
+ * 'error': 'red'
133
+ * }, 'black'); // Default for unknown levels
134
+ *
135
+ * const logLevelToIcon = (level: string) => match(level, {
136
+ * 'debug': '🐛',
137
+ * 'info': 'â„šī¸',
138
+ * 'warn': 'âš ī¸',
139
+ * 'error': '❌'
140
+ * }, '📝');
141
+ *
142
+ * // Combining matchers
143
+ * const formatLogEntry = (level: string, message: string) => ({
144
+ * color: logLevelToColor(level),
145
+ * icon: logLevelToIcon(level),
146
+ * text: `${logLevelToIcon(level)} ${message}`
147
+ * });
148
+ * ```
149
+ */
150
+ export declare const match: MatchFnOverload;
151
+ /**
152
+ * @internal
153
+ * Overloaded function type for the match function.
154
+ * Provides different signatures based on whether exhaustive matching is possible.
155
+ * @template Case The string literal union type to match against.
156
+ * @template R The record type containing the case mappings.
157
+ * @template D The type of the default value.
158
+ */
159
+ type MatchFnOverload = {
160
+ /**
161
+ * Exhaustive matching signature - used when all cases in a literal union are covered.
162
+ * No default value is required or allowed.
163
+ * @template Case The string literal union type.
164
+ * @template R The record type with mappings for all cases.
165
+ * @param target The value to match.
166
+ * @param cases Object mapping all possible case values to results.
167
+ * @returns The matched result value.
168
+ */
169
+ <const Case extends string, const R extends ReadonlyRecord<Case, unknown>>(target: Case, cases: StrictPropertyCheck<R, Case>): R[Case];
170
+ /**
171
+ * Partial matching signature - used when not all cases are covered or when dealing with general string types.
172
+ * A default value is required.
173
+ * @template Case The string type (may be literal union or general string).
174
+ * @template R The record type with partial case mappings.
175
+ * @template D The type of the default value.
176
+ * @param target The value to match.
177
+ * @param cases Object mapping some case values to results.
178
+ * @param defaultValue Required fallback value for unmatched cases.
179
+ * @returns The matched result value or the default value.
180
+ */
181
+ <const Case extends string, const R extends UnknownRecord, const D>(target: Case, cases: StrictPropertyCheck<R, Case>, defaultValue: IsLiteralUnionFullyCovered<Case, R> extends true ? never : D): ValueOf<R> | D;
182
+ };
183
+ /**
184
+ * @internal
185
+ * Helper type to ensure that an object `T` only contains keys specified in `ExpectedKeys`.
186
+ * If `T` has any keys not in `ExpectedKeys`, this type resolves to `never`.
187
+ * @template T The object type to check.
188
+ * @template ExpectedKeys The union of string literal types representing the allowed keys.
189
+ */
190
+ type StrictPropertyCheck<T, ExpectedKeys extends PropertyKey> = RelaxedExclude<keyof T, ExpectedKeys> extends never ? T : never;
191
+ /**
192
+ * @internal
193
+ * Helper type to check if all cases in `Case` union are fully covered by keys in `R`.
194
+ * This checks bidirectional coverage: all Case members are in R, and no extra keys.
195
+ * @template Case A union of string literal types representing the possible cases.
196
+ * @template R A record type.
197
+ */
198
+ type AllCasesCovered<Case extends PropertyKey, R> = TypeEq<Case, keyof R> extends true ? true : false;
199
+ /**
200
+ * @internal
201
+ * Helper type to check if Case is a literal union type and all cases are covered.
202
+ * @template Case A union of string literal types.
203
+ * @template R A record type.
204
+ */
205
+ type IsLiteralUnionFullyCovered<Case extends PropertyKey, R extends UnknownRecord> = TypeEq<IsLiteralType<Case>, true> extends true ? AllCasesCovered<Case, R> : false;
206
+ /**
207
+ * @internal
208
+ * Helper type to determine if a given PropertyKey `T` is a literal type (e.g., 'a', 1)
209
+ * or a general type (e.g., string, number).
210
+ * @template T The PropertyKey type to check.
211
+ * @returns `true` if `T` is a literal type, `false` otherwise.
212
+ */
213
+ type IsLiteralType<T extends PropertyKey> = string extends T ? false : number extends T ? false : symbol extends T ? false : true;
214
+ export {};
215
+ //# sourceMappingURL=match.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match.d.mts","sourceRoot":"","sources":["../../src/functional/match.mts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7B;;;GAGG;AACH,KAAK,aAAa,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAElD;;;;;GAKG;AACH,KAAK,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvE;;;;;GAKG;AACH,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoHG;AACH,eAAO,MAAM,KAAK,EAAE,eAuBC,CAAC;AAEtB;;;;;;;GAOG;AACH,KAAK,eAAe,GAAG;IACrB;;;;;;;;OAQG;IACH,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,CAAC,CAAC,SAAS,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,EACvE,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,GAClC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEX;;;;;;;;;;OAUG;IACH,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,CAAC,CAAC,EAChE,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,EACnC,YAAY,EAAE,0BAA0B,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,CAAC,GACzE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,KAAK,mBAAmB,CAAC,CAAC,EAAE,YAAY,SAAS,WAAW,IAC1D,cAAc,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,SAAS,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC;AAElE;;;;;;GAMG;AACH,KAAK,eAAe,CAAC,IAAI,SAAS,WAAW,EAAE,CAAC,IAC9C,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAOpD;;;;;GAKG;AACH,KAAK,0BAA0B,CAC7B,IAAI,SAAS,WAAW,EACxB,CAAC,SAAS,aAAa,IAEvB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,IAAI,GAC1C,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,GACxB,KAAK,CAAC;AAkBZ;;;;;;GAMG;AACH,KAAK,aAAa,CAAC,CAAC,SAAS,WAAW,IAAI,MAAM,SAAS,CAAC,GACxD,KAAK,GACL,MAAM,SAAS,CAAC,GACd,KAAK,GACL,MAAM,SAAS,CAAC,GACd,KAAK,GACL,IAAI,CAAC"}
@@ -0,0 +1,139 @@
1
+ import { keyIsIn } from '../guard/key-is-in.mjs';
2
+
3
+ /**
4
+ * Type-safe pattern matching function for string-based discriminated unions.
5
+ *
6
+ * Provides compile-time guarantees for exhaustive case handling when working with
7
+ * literal string unions. Automatically enforces completeness checking when all
8
+ * cases are covered, and requires a default value when cases are incomplete.
9
+ *
10
+ * ## Key Features:
11
+ * - **Exhaustive Matching**: When all cases of a literal union are handled, no default value is needed
12
+ * - **Partial Matching**: When cases are incomplete or working with general string types, a default value is required
13
+ * - **Type Safety**: Prevents extra cases and ensures only valid keys are used
14
+ * - **Strict Property Checking**: Rejects objects with unexpected properties
15
+ *
16
+ * @param target - The value to match against
17
+ * @param cases - Object mapping possible values to their corresponding results
18
+ * @param defaultValue - Fallback value (required when not all cases are covered)
19
+ * @returns The matched result or default value
20
+ *
21
+ * @example
22
+ * Exhaustive matching (no default needed):
23
+ * ```typescript
24
+ * type Status = 'loading' | 'success' | 'error';
25
+ * const status: Status = 'loading';
26
+ *
27
+ * const message = match(status, {
28
+ * loading: 'Please wait...',
29
+ * success: 'Operation completed!',
30
+ * error: 'Something went wrong'
31
+ * });
32
+ * // Type: string
33
+ * // Result: 'Please wait...'
34
+ * ```
35
+ *
36
+ * @example
37
+ * Partial matching (default required):
38
+ * ```typescript
39
+ * type Priority = 'low' | 'medium' | 'high' | 'critical';
40
+ * const priority: Priority = 'medium';
41
+ *
42
+ * const color = match(priority, {
43
+ * high: 'red',
44
+ * critical: 'darkred'
45
+ * }, 'gray'); // Default required for uncovered cases
46
+ * // Type: 'red' | 'darkred' | 'gray'
47
+ * // Result: 'gray'
48
+ * ```
49
+ *
50
+ * @example
51
+ * Working with general string types:
52
+ * ```typescript
53
+ * const userInput: string = getUserInput();
54
+ *
55
+ * const route = match(userInput, {
56
+ * 'home': '/',
57
+ * 'about': '/about',
58
+ * 'contact': '/contact'
59
+ * }, '/404'); // Default required for string type
60
+ * // Type: '/' | '/about' | '/contact' | '/404'
61
+ * ```
62
+ *
63
+ * @example
64
+ * HTTP status code handling:
65
+ * ```typescript
66
+ * type HttpStatus = 200 | 404 | 500;
67
+ * const status: HttpStatus = 404;
68
+ *
69
+ * const response = match(String(status), {
70
+ * '200': { ok: true, message: 'Success' },
71
+ * '404': { ok: false, message: 'Not Found' },
72
+ * '500': { ok: false, message: 'Server Error' }
73
+ * });
74
+ * // All cases covered, no default needed
75
+ * // Result: { ok: false, message: 'Not Found' }
76
+ * ```
77
+ *
78
+ * @example
79
+ * Complex discriminated union handling:
80
+ * ```typescript
81
+ * type ApiResponse =
82
+ * | { status: 'loading' }
83
+ * | { status: 'success'; data: string }
84
+ * | { status: 'error'; error: string };
85
+ *
86
+ * const handleResponse = (response: ApiResponse) =>
87
+ * match(response.status, {
88
+ * loading: 'Please wait...',
89
+ * success: 'Data loaded successfully!',
90
+ * error: 'Failed to load data'
91
+ * });
92
+ * ```
93
+ *
94
+ * @example
95
+ * Advanced usage with functional composition:
96
+ * ```typescript
97
+ * // Creating reusable matchers
98
+ * const logLevelToColor = (level: string) => match(level, {
99
+ * 'debug': 'gray',
100
+ * 'info': 'blue',
101
+ * 'warn': 'yellow',
102
+ * 'error': 'red'
103
+ * }, 'black'); // Default for unknown levels
104
+ *
105
+ * const logLevelToIcon = (level: string) => match(level, {
106
+ * 'debug': '🐛',
107
+ * 'info': 'â„šī¸',
108
+ * 'warn': 'âš ī¸',
109
+ * 'error': '❌'
110
+ * }, '📝');
111
+ *
112
+ * // Combining matchers
113
+ * const formatLogEntry = (level: string, message: string) => ({
114
+ * color: logLevelToColor(level),
115
+ * icon: logLevelToIcon(level),
116
+ * text: `${logLevelToIcon(level)} ${message}`
117
+ * });
118
+ * ```
119
+ */
120
+ const match = ((...args) => {
121
+ switch (args.length) {
122
+ case 2: {
123
+ const [target, cases] = args;
124
+ return cases[target];
125
+ }
126
+ case 3: {
127
+ const [target, cases, defaultValue] = args;
128
+ if (keyIsIn(target, cases)) {
129
+ return cases[target];
130
+ }
131
+ else {
132
+ return defaultValue;
133
+ }
134
+ }
135
+ }
136
+ });
137
+
138
+ export { match };
139
+ //# sourceMappingURL=match.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match.mjs","sources":["../../src/functional/match.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAwCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHG;MACU,KAAK,IAAqB,CAKrC,GAAG,IAEmD,KACpC;AAClB,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI;AAC5B,YAAA,OAAO,KAAK,CAAC,MAAM,CAAC;;QAEtB,KAAK,CAAC,EAAE;YACN,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,GAAG,IAAI;AAC1C,YAAA,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;AAC1B,gBAAA,OAAO,KAAK,CAAC,MAAM,CAAC;;iBACf;AACL,gBAAA,OAAO,YAAY;;;;AAI3B,CAAC;;;;"}