lay-sing 0.2.1 → 0.4.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 (340) hide show
  1. package/README.md +31 -35
  2. package/esm/main/expect/index.d.ts +31 -0
  3. package/esm/main/expect/index.d.ts.map +1 -0
  4. package/esm/main/expect/index.js +2 -0
  5. package/esm/main/expect/index.js.map +1 -0
  6. package/esm/main/expect/to/be.d.ts +23 -0
  7. package/esm/main/expect/to/be.d.ts.map +1 -0
  8. package/esm/main/expect/to/be.js +2 -0
  9. package/esm/main/expect/to/be.js.map +1 -0
  10. package/esm/main/expect/to/equal.d.ts +26 -0
  11. package/esm/main/expect/to/equal.d.ts.map +1 -0
  12. package/esm/main/expect/to/equal.js +2 -0
  13. package/esm/main/expect/to/equal.js.map +1 -0
  14. package/esm/main/expect/to/extend.d.ts +31 -0
  15. package/esm/main/expect/to/extend.d.ts.map +1 -0
  16. package/esm/main/expect/to/extend.js +2 -0
  17. package/esm/main/expect/to/extend.js.map +1 -0
  18. package/esm/main/expect/to/have-key.d.ts +38 -0
  19. package/esm/main/expect/to/have-key.d.ts.map +1 -0
  20. package/esm/main/expect/to/have-key.js +2 -0
  21. package/esm/main/expect/to/have-key.js.map +1 -0
  22. package/esm/main/expect/to/index.d.ts +13 -0
  23. package/esm/main/expect/to/index.d.ts.map +1 -0
  24. package/esm/main/expect/to/index.js +2 -0
  25. package/esm/main/expect/to/index.js.map +1 -0
  26. package/esm/main/expect/to/proper-extends.d.ts +21 -0
  27. package/esm/main/expect/to/proper-extends.d.ts.map +1 -0
  28. package/esm/main/expect/to/proper-extends.js +2 -0
  29. package/esm/main/expect/to/proper-extends.js.map +1 -0
  30. package/esm/main/index.d.ts +26 -11
  31. package/esm/main/index.d.ts.map +1 -1
  32. package/esm/main/index.js +22 -13
  33. package/esm/main/index.js.map +1 -1
  34. package/esm/main/noop.d.ts +27 -0
  35. package/esm/main/noop.d.ts.map +1 -0
  36. package/esm/{test-utils/index.js → main/noop.js} +1 -12
  37. package/esm/main/noop.js.map +1 -0
  38. package/esm/utils/compare/assignable.d.ts +30 -0
  39. package/esm/utils/compare/assignable.d.ts.map +1 -0
  40. package/esm/utils/compare/assignable.js +2 -0
  41. package/esm/utils/compare/assignable.js.map +1 -0
  42. package/esm/utils/compare/exact.d.ts +50 -0
  43. package/esm/utils/compare/exact.d.ts.map +1 -0
  44. package/esm/utils/compare/exact.js +2 -0
  45. package/esm/utils/compare/exact.js.map +1 -0
  46. package/esm/utils/compare/extends.d.ts +46 -0
  47. package/esm/utils/compare/extends.d.ts.map +1 -0
  48. package/esm/utils/compare/extends.js +2 -0
  49. package/esm/utils/compare/extends.js.map +1 -0
  50. package/esm/utils/compare/index.d.ts +5 -0
  51. package/esm/utils/compare/index.d.ts.map +1 -0
  52. package/esm/utils/compare/index.js +7 -0
  53. package/esm/utils/compare/index.js.map +1 -0
  54. package/esm/utils/compare/overlap.d.ts +47 -0
  55. package/esm/utils/compare/overlap.d.ts.map +1 -0
  56. package/esm/utils/compare/overlap.js +2 -0
  57. package/esm/utils/compare/overlap.js.map +1 -0
  58. package/esm/utils/index.d.ts +11 -0
  59. package/esm/utils/index.d.ts.map +1 -0
  60. package/esm/utils/index.js +13 -0
  61. package/esm/utils/index.js.map +1 -0
  62. package/esm/utils/logic/assert.d.ts +18 -0
  63. package/esm/utils/logic/assert.d.ts.map +1 -0
  64. package/esm/utils/logic/assert.js +2 -0
  65. package/esm/utils/logic/assert.js.map +1 -0
  66. package/esm/utils/logic/if.d.ts +37 -0
  67. package/esm/utils/logic/if.d.ts.map +1 -0
  68. package/esm/utils/logic/if.js +2 -0
  69. package/esm/utils/logic/if.js.map +1 -0
  70. package/esm/utils/logic/index.d.ts +4 -0
  71. package/esm/utils/logic/index.d.ts.map +1 -0
  72. package/esm/utils/logic/index.js +6 -0
  73. package/esm/utils/logic/index.js.map +1 -0
  74. package/{script/main/control.d.ts → esm/utils/logic/switch.d.ts} +15 -40
  75. package/esm/utils/logic/switch.d.ts.map +1 -0
  76. package/esm/utils/logic/switch.js +2 -0
  77. package/esm/utils/logic/switch.js.map +1 -0
  78. package/esm/utils/misc.d.ts +34 -0
  79. package/esm/utils/misc.d.ts.map +1 -0
  80. package/esm/utils/misc.js +2 -0
  81. package/esm/utils/misc.js.map +1 -0
  82. package/esm/utils/object/index.d.ts +4 -0
  83. package/esm/utils/object/index.d.ts.map +1 -0
  84. package/esm/utils/object/index.js +6 -0
  85. package/esm/utils/object/index.js.map +1 -0
  86. package/{script/main/key.d.ts → esm/utils/object/keys.d.ts} +34 -34
  87. package/esm/utils/object/keys.d.ts.map +1 -0
  88. package/esm/utils/object/keys.js +2 -0
  89. package/esm/utils/object/keys.js.map +1 -0
  90. package/esm/utils/object/pick.d.ts +16 -0
  91. package/esm/utils/object/pick.d.ts.map +1 -0
  92. package/esm/utils/object/pick.js +2 -0
  93. package/esm/utils/object/pick.js.map +1 -0
  94. package/esm/utils/object/props.d.ts +17 -0
  95. package/esm/utils/object/props.d.ts.map +1 -0
  96. package/esm/utils/object/props.js +2 -0
  97. package/esm/utils/object/props.js.map +1 -0
  98. package/esm/utils/tuple/append.d.ts +17 -0
  99. package/esm/utils/tuple/append.d.ts.map +1 -0
  100. package/esm/utils/tuple/append.js +2 -0
  101. package/esm/utils/tuple/append.js.map +1 -0
  102. package/esm/utils/tuple/concat.d.ts +31 -0
  103. package/esm/utils/tuple/concat.d.ts.map +1 -0
  104. package/esm/utils/tuple/concat.js +2 -0
  105. package/esm/utils/tuple/concat.js.map +1 -0
  106. package/esm/utils/tuple/includes.d.ts +20 -0
  107. package/esm/utils/tuple/includes.d.ts.map +1 -0
  108. package/esm/utils/tuple/includes.js +2 -0
  109. package/esm/utils/tuple/includes.js.map +1 -0
  110. package/esm/utils/tuple/index.d.ts +4 -0
  111. package/esm/utils/tuple/index.d.ts.map +1 -0
  112. package/esm/utils/tuple/index.js +6 -0
  113. package/esm/utils/tuple/index.js.map +1 -0
  114. package/package.json +5 -5
  115. package/script/main/expect/index.d.ts +31 -0
  116. package/script/main/expect/index.d.ts.map +1 -0
  117. package/script/main/{async.js → expect/index.js} +1 -1
  118. package/script/main/expect/index.js.map +1 -0
  119. package/script/main/expect/to/be.d.ts +23 -0
  120. package/script/main/expect/to/be.d.ts.map +1 -0
  121. package/script/main/{type/set.js → expect/to/be.js} +1 -1
  122. package/script/main/expect/to/be.js.map +1 -0
  123. package/script/main/expect/to/equal.d.ts +26 -0
  124. package/script/main/expect/to/equal.d.ts.map +1 -0
  125. package/script/main/expect/to/equal.js +3 -0
  126. package/script/main/expect/to/equal.js.map +1 -0
  127. package/script/main/expect/to/extend.d.ts +31 -0
  128. package/script/main/expect/to/extend.d.ts.map +1 -0
  129. package/script/main/expect/to/extend.js +3 -0
  130. package/script/main/expect/to/extend.js.map +1 -0
  131. package/script/main/expect/to/have-key.d.ts +38 -0
  132. package/script/main/expect/to/have-key.d.ts.map +1 -0
  133. package/script/main/expect/to/have-key.js +3 -0
  134. package/script/main/expect/to/have-key.js.map +1 -0
  135. package/script/main/expect/to/index.d.ts +13 -0
  136. package/script/main/expect/to/index.d.ts.map +1 -0
  137. package/script/main/expect/to/index.js +3 -0
  138. package/script/main/expect/to/index.js.map +1 -0
  139. package/script/main/expect/to/proper-extends.d.ts +21 -0
  140. package/script/main/expect/to/proper-extends.d.ts.map +1 -0
  141. package/script/main/expect/to/proper-extends.js +3 -0
  142. package/script/main/expect/to/proper-extends.js.map +1 -0
  143. package/script/main/index.d.ts +26 -11
  144. package/script/main/index.d.ts.map +1 -1
  145. package/script/main/index.js +24 -27
  146. package/script/main/index.js.map +1 -1
  147. package/script/main/noop.d.ts +27 -0
  148. package/script/main/noop.d.ts.map +1 -0
  149. package/script/{test-utils/index.js → main/noop.js} +1 -14
  150. package/script/main/noop.js.map +1 -0
  151. package/script/utils/compare/assignable.d.ts +30 -0
  152. package/script/utils/compare/assignable.d.ts.map +1 -0
  153. package/script/utils/compare/assignable.js +3 -0
  154. package/script/utils/compare/assignable.js.map +1 -0
  155. package/script/utils/compare/exact.d.ts +50 -0
  156. package/script/utils/compare/exact.d.ts.map +1 -0
  157. package/script/utils/compare/exact.js +3 -0
  158. package/script/utils/compare/exact.js.map +1 -0
  159. package/script/utils/compare/extends.d.ts +46 -0
  160. package/script/utils/compare/extends.d.ts.map +1 -0
  161. package/script/{main/boolean.js → utils/compare/extends.js} +1 -1
  162. package/script/utils/compare/extends.js.map +1 -0
  163. package/script/utils/compare/index.d.ts +5 -0
  164. package/script/utils/compare/index.d.ts.map +1 -0
  165. package/script/utils/compare/index.js +23 -0
  166. package/script/utils/compare/index.js.map +1 -0
  167. package/script/utils/compare/overlap.d.ts +47 -0
  168. package/script/utils/compare/overlap.d.ts.map +1 -0
  169. package/script/{main/control.js → utils/compare/overlap.js} +1 -1
  170. package/script/utils/compare/overlap.js.map +1 -0
  171. package/script/utils/index.d.ts +11 -0
  172. package/script/utils/index.d.ts.map +1 -0
  173. package/script/utils/index.js +29 -0
  174. package/script/utils/index.js.map +1 -0
  175. package/script/utils/logic/assert.d.ts +18 -0
  176. package/script/utils/logic/assert.d.ts.map +1 -0
  177. package/script/utils/logic/assert.js +3 -0
  178. package/script/utils/logic/assert.js.map +1 -0
  179. package/script/utils/logic/if.d.ts +37 -0
  180. package/script/utils/logic/if.d.ts.map +1 -0
  181. package/script/{main/key.js → utils/logic/if.js} +1 -1
  182. package/script/utils/logic/if.js.map +1 -0
  183. package/script/utils/logic/index.d.ts +4 -0
  184. package/script/utils/logic/index.d.ts.map +1 -0
  185. package/script/utils/logic/index.js +22 -0
  186. package/script/utils/logic/index.js.map +1 -0
  187. package/{esm/main/control.d.ts → script/utils/logic/switch.d.ts} +15 -40
  188. package/script/utils/logic/switch.d.ts.map +1 -0
  189. package/script/utils/logic/switch.js +3 -0
  190. package/script/utils/logic/switch.js.map +1 -0
  191. package/script/utils/misc.d.ts +34 -0
  192. package/script/utils/misc.d.ts.map +1 -0
  193. package/script/{main/json.js → utils/misc.js} +1 -1
  194. package/script/utils/misc.js.map +1 -0
  195. package/script/utils/object/index.d.ts +4 -0
  196. package/script/utils/object/index.d.ts.map +1 -0
  197. package/script/{main/type → utils/object}/index.js +3 -2
  198. package/script/utils/object/index.js.map +1 -0
  199. package/{esm/main/key.d.ts → script/utils/object/keys.d.ts} +34 -34
  200. package/script/utils/object/keys.d.ts.map +1 -0
  201. package/script/{main/doc.js → utils/object/keys.js} +1 -1
  202. package/script/utils/object/keys.js.map +1 -0
  203. package/script/utils/object/pick.d.ts +16 -0
  204. package/script/utils/object/pick.d.ts.map +1 -0
  205. package/script/utils/object/pick.js +3 -0
  206. package/script/utils/object/pick.js.map +1 -0
  207. package/script/utils/object/props.d.ts +17 -0
  208. package/script/utils/object/props.d.ts.map +1 -0
  209. package/script/utils/object/props.js +3 -0
  210. package/script/utils/object/props.js.map +1 -0
  211. package/script/utils/tuple/append.d.ts +17 -0
  212. package/script/utils/tuple/append.d.ts.map +1 -0
  213. package/script/utils/tuple/append.js +3 -0
  214. package/script/utils/tuple/append.js.map +1 -0
  215. package/script/utils/tuple/concat.d.ts +31 -0
  216. package/script/utils/tuple/concat.d.ts.map +1 -0
  217. package/script/utils/tuple/concat.js +3 -0
  218. package/script/utils/tuple/concat.js.map +1 -0
  219. package/script/utils/tuple/includes.d.ts +20 -0
  220. package/script/utils/tuple/includes.d.ts.map +1 -0
  221. package/script/utils/tuple/includes.js +3 -0
  222. package/script/utils/tuple/includes.js.map +1 -0
  223. package/script/utils/tuple/index.d.ts +4 -0
  224. package/script/utils/tuple/index.d.ts.map +1 -0
  225. package/script/utils/tuple/index.js +22 -0
  226. package/script/utils/tuple/index.js.map +1 -0
  227. package/esm/main/async.d.ts +0 -13
  228. package/esm/main/async.d.ts.map +0 -1
  229. package/esm/main/async.js +0 -2
  230. package/esm/main/async.js.map +0 -1
  231. package/esm/main/boolean.d.ts +0 -59
  232. package/esm/main/boolean.d.ts.map +0 -1
  233. package/esm/main/boolean.js +0 -2
  234. package/esm/main/boolean.js.map +0 -1
  235. package/esm/main/control.d.ts.map +0 -1
  236. package/esm/main/control.js +0 -2
  237. package/esm/main/control.js.map +0 -1
  238. package/esm/main/doc.d.ts +0 -56
  239. package/esm/main/doc.d.ts.map +0 -1
  240. package/esm/main/doc.js +0 -2
  241. package/esm/main/doc.js.map +0 -1
  242. package/esm/main/function.d.ts +0 -27
  243. package/esm/main/function.d.ts.map +0 -1
  244. package/esm/main/function.js +0 -2
  245. package/esm/main/function.js.map +0 -1
  246. package/esm/main/json.d.ts +0 -44
  247. package/esm/main/json.d.ts.map +0 -1
  248. package/esm/main/json.js +0 -2
  249. package/esm/main/json.js.map +0 -1
  250. package/esm/main/key.d.ts.map +0 -1
  251. package/esm/main/key.js +0 -2
  252. package/esm/main/key.js.map +0 -1
  253. package/esm/main/object.d.ts +0 -120
  254. package/esm/main/object.d.ts.map +0 -1
  255. package/esm/main/object.js +0 -2
  256. package/esm/main/object.js.map +0 -1
  257. package/esm/main/tuple.d.ts +0 -64
  258. package/esm/main/tuple.d.ts.map +0 -1
  259. package/esm/main/tuple.js +0 -2
  260. package/esm/main/tuple.js.map +0 -1
  261. package/esm/main/type/compare.d.ts +0 -169
  262. package/esm/main/type/compare.d.ts.map +0 -1
  263. package/esm/main/type/compare.js +0 -2
  264. package/esm/main/type/compare.js.map +0 -1
  265. package/esm/main/type/index.d.ts +0 -3
  266. package/esm/main/type/index.d.ts.map +0 -1
  267. package/esm/main/type/index.js +0 -5
  268. package/esm/main/type/index.js.map +0 -1
  269. package/esm/main/type/set.d.ts +0 -34
  270. package/esm/main/type/set.d.ts.map +0 -1
  271. package/esm/main/type/set.js +0 -2
  272. package/esm/main/type/set.js.map +0 -1
  273. package/esm/main/typed-array.d.ts +0 -5
  274. package/esm/main/typed-array.d.ts.map +0 -1
  275. package/esm/main/typed-array.js +0 -2
  276. package/esm/main/typed-array.js.map +0 -1
  277. package/esm/test-utils/compare.d.ts +0 -81
  278. package/esm/test-utils/compare.d.ts.map +0 -1
  279. package/esm/test-utils/compare.js +0 -2
  280. package/esm/test-utils/compare.js.map +0 -1
  281. package/esm/test-utils/expect.d.ts +0 -278
  282. package/esm/test-utils/expect.d.ts.map +0 -1
  283. package/esm/test-utils/expect.js +0 -2
  284. package/esm/test-utils/expect.js.map +0 -1
  285. package/esm/test-utils/index.d.ts +0 -77
  286. package/esm/test-utils/index.d.ts.map +0 -1
  287. package/esm/test-utils/index.js.map +0 -1
  288. package/script/main/async.d.ts +0 -13
  289. package/script/main/async.d.ts.map +0 -1
  290. package/script/main/async.js.map +0 -1
  291. package/script/main/boolean.d.ts +0 -59
  292. package/script/main/boolean.d.ts.map +0 -1
  293. package/script/main/boolean.js.map +0 -1
  294. package/script/main/control.d.ts.map +0 -1
  295. package/script/main/control.js.map +0 -1
  296. package/script/main/doc.d.ts +0 -56
  297. package/script/main/doc.d.ts.map +0 -1
  298. package/script/main/doc.js.map +0 -1
  299. package/script/main/function.d.ts +0 -27
  300. package/script/main/function.d.ts.map +0 -1
  301. package/script/main/function.js +0 -3
  302. package/script/main/function.js.map +0 -1
  303. package/script/main/json.d.ts +0 -44
  304. package/script/main/json.d.ts.map +0 -1
  305. package/script/main/json.js.map +0 -1
  306. package/script/main/key.d.ts.map +0 -1
  307. package/script/main/key.js.map +0 -1
  308. package/script/main/object.d.ts +0 -120
  309. package/script/main/object.d.ts.map +0 -1
  310. package/script/main/object.js +0 -3
  311. package/script/main/object.js.map +0 -1
  312. package/script/main/tuple.d.ts +0 -64
  313. package/script/main/tuple.d.ts.map +0 -1
  314. package/script/main/tuple.js +0 -3
  315. package/script/main/tuple.js.map +0 -1
  316. package/script/main/type/compare.d.ts +0 -169
  317. package/script/main/type/compare.d.ts.map +0 -1
  318. package/script/main/type/compare.js +0 -3
  319. package/script/main/type/compare.js.map +0 -1
  320. package/script/main/type/index.d.ts +0 -3
  321. package/script/main/type/index.d.ts.map +0 -1
  322. package/script/main/type/index.js.map +0 -1
  323. package/script/main/type/set.d.ts +0 -34
  324. package/script/main/type/set.d.ts.map +0 -1
  325. package/script/main/type/set.js.map +0 -1
  326. package/script/main/typed-array.d.ts +0 -5
  327. package/script/main/typed-array.d.ts.map +0 -1
  328. package/script/main/typed-array.js +0 -3
  329. package/script/main/typed-array.js.map +0 -1
  330. package/script/test-utils/compare.d.ts +0 -81
  331. package/script/test-utils/compare.d.ts.map +0 -1
  332. package/script/test-utils/compare.js +0 -3
  333. package/script/test-utils/compare.js.map +0 -1
  334. package/script/test-utils/expect.d.ts +0 -278
  335. package/script/test-utils/expect.d.ts.map +0 -1
  336. package/script/test-utils/expect.js +0 -3
  337. package/script/test-utils/expect.js.map +0 -1
  338. package/script/test-utils/index.d.ts +0 -77
  339. package/script/test-utils/index.d.ts.map +0 -1
  340. package/script/test-utils/index.js.map +0 -1
@@ -1,64 +0,0 @@
1
- import type { Exact } from './type/compare.js';
2
- /**
3
- * Concatenates two tuples into a single tuple type
4
- *
5
- * @template Left - The first tuple type to concatenate
6
- * @template Right - The second tuple type to concatenate
7
- *
8
- * @example
9
- * ```ts
10
- * import { expect } from '@leawind/lay-sing/test-utils'
11
- *
12
- * expect<ConcatTuple<[1, 2], [3, 4]>>().toBe<[1, 2, 3, 4]>().success
13
- * ```
14
- */
15
- export type ConcatTuple<Left extends readonly unknown[], Right extends readonly unknown[]> = Left extends readonly unknown[] ? (Right extends readonly unknown[] ? [...Left, ...Right] : never) : never;
16
- /**
17
- * Checks whether a tuple includes a specific element type
18
- *
19
- * @template Tuple - The tuple type to check
20
- * @template Element - The element type to look for
21
- * @template Yes - The result if the element is found (defaults to `true`)
22
- * @template No - The result if the element is not found (defaults to `false`)
23
- *
24
- * @example
25
- * ```ts
26
- * import { expect } from '@leawind/lay-sing/test-utils'
27
- *
28
- * expect<IfTupleIncludes<[1, 2, 3], 2>>().toBeTrue
29
- * expect<IfTupleIncludes<[1, 2, 3], 4>>().toBeFalse
30
- * expect<IfTupleIncludes<[1, 2, 1], 1>>().toBeTrue
31
- * ```
32
- */
33
- export type IfTupleIncludes<Tuple extends readonly unknown[], Element, Yes = true, No = false> = Exact<Tuple, any> extends true ? never : Tuple extends readonly [infer First, ...infer Rest] ? (Exact<Element, First> extends true ? Yes : IfTupleIncludes<Rest, Element, Yes, No>) : No;
34
- /**
35
- * Appends an element to a tuple only if it doesn't already exist in the tuple
36
- *
37
- * @template Tuple - The tuple type to append to
38
- * @template Element - The element type to append
39
- *
40
- * @example
41
- * ```ts
42
- * import { expect } from '@leawind/lay-sing/test-utils'
43
- *
44
- * expect<AppendUnique<[1, 2, 3], 4>>().toBe<[1, 2, 3, 4]>().success
45
- * expect<AppendUnique<[1, 2, 3], 2>>().toBe<[1, 2, 3]>().success
46
- * ```
47
- */
48
- export type AppendUnique<Tuple extends readonly unknown[], Element> = IfTupleIncludes<Tuple, Element> extends true ? Tuple : [...Tuple, Element];
49
- /**
50
- * Concatenates two tuples while ensuring uniqueness of elements
51
- *
52
- * @template Left - The first tuple type to concatenate
53
- * @template Right - The second tuple type to concatenate
54
- * @template R - The intermediate result tuple type (defaults to `Left`)
55
- *
56
- * @example
57
- * ```ts
58
- * import { expect } from '@leawind/lay-sing/test-utils'
59
- *
60
- * expect<ConcatUniqueTuple<[1, 2, 3], [2, 3, 4]>>().toBe<[1, 2, 3, 4]>().success
61
- * ```
62
- */
63
- export type ConcatUniqueTuple<Left extends readonly unknown[], Right extends readonly unknown[], R extends readonly unknown[] = Left> = Right extends readonly [infer First, ...infer Rest] ? ConcatUniqueTuple<Left, Rest, AppendUnique<R, First>> : R;
64
- //# sourceMappingURL=tuple.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../src/main/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,CACrB,IAAI,SAAS,SAAS,OAAO,EAAE,EAC/B,KAAK,SAAS,SAAS,OAAO,EAAE,IAC9B,IAAI,SAAS,SAAS,OAAO,EAAE,GAAG,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAA;AAE9G;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,eAAe,CACzB,KAAK,SAAS,SAAS,OAAO,EAAE,EAChC,OAAO,EACP,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,IAAI,GAAG,KAAK,GACtC,KAAK,SAAS,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GACjD,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,IAAI,GAAG,GAAG,GAAG,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GACtF,EAAE,CAAA;AAEN;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,YAAY,CACtB,KAAK,SAAS,SAAS,OAAO,EAAE,EAChC,OAAO,IACL,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,EAAE,OAAO,CAAC,CAAA;AAE9E;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,iBAAiB,CAC3B,IAAI,SAAS,SAAS,OAAO,EAAE,EAC/B,KAAK,SAAS,SAAS,OAAO,EAAE,EAChC,CAAC,SAAS,SAAS,OAAO,EAAE,GAAG,IAAI,IACjC,KAAK,SAAS,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GAAG,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=tuple.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../src/main/tuple.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact } from './type/compare.js'\n\n/**\n * Concatenates two tuples into a single tuple type\n *\n * @template Left - The first tuple type to concatenate\n * @template Right - The second tuple type to concatenate\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<ConcatTuple<[1, 2], [3, 4]>>().toBe<[1, 2, 3, 4]>().success\n * ```\n */\nexport type ConcatTuple<\n Left extends readonly unknown[],\n Right extends readonly unknown[],\n> = Left extends readonly unknown[] ? (Right extends readonly unknown[] ? [...Left, ...Right] : never) : never\n\n/**\n * Checks whether a tuple includes a specific element type\n *\n * @template Tuple - The tuple type to check\n * @template Element - The element type to look for\n * @template Yes - The result if the element is found (defaults to `true`)\n * @template No - The result if the element is not found (defaults to `false`)\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<IfTupleIncludes<[1, 2, 3], 2>>().toBeTrue\n * expect<IfTupleIncludes<[1, 2, 3], 4>>().toBeFalse\n * expect<IfTupleIncludes<[1, 2, 1], 1>>().toBeTrue\n * ```\n */\nexport type IfTupleIncludes<\n Tuple extends readonly unknown[],\n Element,\n Yes = true,\n No = false,\n> = Exact<Tuple, any> extends true ? never\n : Tuple extends readonly [infer First, ...infer Rest]\n ? (Exact<Element, First> extends true ? Yes : IfTupleIncludes<Rest, Element, Yes, No>)\n : No\n\n/**\n * Appends an element to a tuple only if it doesn't already exist in the tuple\n *\n * @template Tuple - The tuple type to append to\n * @template Element - The element type to append\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<AppendUnique<[1, 2, 3], 4>>().toBe<[1, 2, 3, 4]>().success\n * expect<AppendUnique<[1, 2, 3], 2>>().toBe<[1, 2, 3]>().success\n * ```\n */\nexport type AppendUnique<\n Tuple extends readonly unknown[],\n Element,\n> = IfTupleIncludes<Tuple, Element> extends true ? Tuple : [...Tuple, Element]\n\n/**\n * Concatenates two tuples while ensuring uniqueness of elements\n *\n * @template Left - The first tuple type to concatenate\n * @template Right - The second tuple type to concatenate\n * @template R - The intermediate result tuple type (defaults to `Left`)\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<ConcatUniqueTuple<[1, 2, 3], [2, 3, 4]>>().toBe<[1, 2, 3, 4]>().success\n * ```\n */\nexport type ConcatUniqueTuple<\n Left extends readonly unknown[],\n Right extends readonly unknown[],\n R extends readonly unknown[] = Left,\n> = Right extends readonly [infer First, ...infer Rest] ? ConcatUniqueTuple<Left, Rest, AppendUnique<R, First>> : R\n"]}
@@ -1,169 +0,0 @@
1
- /**
2
- * Checks whether two types are exactly the same.
3
- *
4
- * **⚠️Important:** parameter `A` and `B` are not distributive. When they are union type, it does not check each member separately.
5
- *
6
- * @template A - The first type to compare
7
- * @template B - The second type to compare
8
- * @template Yes - The result if types are exactly the same (defaults to `true`)
9
- * @template No - The result if types are not exactly the same (defaults to `false`)
10
- *
11
- * ### Result
12
- *
13
- * - `Yes`: `A` and `B` are exactly the same
14
- * - `No`: Otherwise
15
- *
16
- * @example
17
- * ```ts
18
- * import { expect } from '@leawind/lay-sing/test-utils'
19
- *
20
- * expect<Exact<string, string>>().toBeTrue
21
- * expect<Exact<never, never>>().toBeTrue
22
- * expect<Exact<any, any>>().toBeTrue
23
- *
24
- * expect<Exact<{ a: 3 }, { a?: 3 }>>().toBeFalse
25
- * expect<Exact<1 | 2, 1>>().toBeFalse
26
- * expect<Exact<1, number>>().toBeFalse
27
- * expect<Exact<() => void, () => undefined>>().toBeFalse
28
- * ```
29
- */
30
- export type Exact<A, B, Yes = true, No = false> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? Yes : No;
31
- /**
32
- * Checks whether two types are not exactly the same.
33
- *
34
- * This is the logical negation of `Exact<A, B>`.
35
- *
36
- * @template A - The first type to compare
37
- * @template B - The second type to compare
38
- * @template Yes - The result if types are not exactly the same (defaults to `true`)
39
- * @template No - The result if types are exactly the same (defaults to `false`)
40
- *
41
- * @example
42
- * ```ts
43
- * type T1 = NotExact<number, string> // true
44
- * type T2 = NotExact<1, number> // true
45
- * type F1 = NotExact<number, number> // false
46
- * type F2 = NotExact<1, 1> // false
47
- * ```
48
- */
49
- export type NotExact<A, B, Yes = true, No = false> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? No : Yes;
50
- /**
51
- * Checks whether type `A` extends type `B`.
52
- *
53
- * **⚠️Important:** parameter `A` and `B` are not distributive. When they are union type, it treats them as a single entity.
54
- *
55
- * @template A - The type to check if it extends another type
56
- * @template B - The type to check if `A` extends
57
- * @template Yes - The result if `A` extends `B` (defaults to `true`)
58
- * @template No - The result if `A` does not extend `B` (defaults to `false`)
59
- *
60
- * ### Result
61
- *
62
- * - `Yes`: `A` is assignable to `B`
63
- * - `No`: Otherwise
64
- */
65
- export type Extends<A, B, Yes = true, No = false> = [A] extends [B] ? Yes : No;
66
- /**
67
- * Checks whether type `A` is a *proper* subtype of type `B`.
68
- *
69
- * A proper extension means:
70
- * - `A` extends `B`
71
- * - `A` is not exactly the same type as `B`
72
- *
73
- * @template A - The type to check if it is a proper subtype
74
- * @template B - The type to check against
75
- * @template Yes - The result if `A` is a proper subtype of `B` (defaults to `true`)
76
- * @template No - The result if `A` is not a proper subtype of `B` (defaults to `false`)
77
- *
78
- * ### Result
79
- *
80
- * - `Yes`: `A` is a proper subtype of `B`
81
- * - `No`: Otherwise
82
- *
83
- * **Note:** the result will never be `boolean`.
84
- *
85
- * @example
86
- * ```ts
87
- * type T1 = ProperExtend<true, boolean> // true
88
- * type T2 = ProperExtend<1, number> // true
89
- * type F1 = ProperExtend<boolean, boolean> // false
90
- * type F2 = ProperExtend<number, string> // false
91
- * ```
92
- */
93
- export type ProperExtend<A, B, Yes = true, No = false> = [A] extends [B] ? Exact<A, B> extends false ? Yes : No : No;
94
- /**
95
- * Checks whether two types have any overlapping members.
96
- *
97
- * @template A - The first type to check for overlap
98
- * @template B - The second type to check for overlap
99
- * @template Yes - The result if types overlap (defaults to `true`)
100
- * @template No - The result if types do not overlap (defaults to `false`)
101
- *
102
- * ### Result
103
- *
104
- * - `Yes`: `A` and `B` share at least one common type
105
- * - `No`: `A` and `B` are completely disjoint
106
- *
107
- * @example
108
- * ```ts
109
- * type T1 = Overlap<1 | 2, 2 | 3> // true
110
- * type T2 = Overlap<string, 'hello'> // true
111
- * type F1 = Overlap<string, number> // false
112
- * type F2 = Overlap<1, 'one'> // false
113
- * ```
114
- */
115
- export type Overlap<A, B, Yes = true, No = false> = [A & B] extends [never] ? No : Yes;
116
- /**
117
- * Checks whether two types are disjoint.
118
- *
119
- * This is the logical negation of `Overlap<A, B>`.
120
- *
121
- * @template A - The first type to check for disjointness
122
- * @template B - The second type to check for disjointness
123
- * @template Yes - The result if types are disjoint (defaults to `true`)
124
- * @template No - The result if types are not disjoint (defaults to `false`)
125
- *
126
- * ### Result
127
- *
128
- * - `Yes`: `A` and `B` have no overlap
129
- * - `No`: `A` and `B` share at least one common type
130
- *
131
- * @example
132
- * ```ts
133
- * type T1 = Disjoint<string, number> // true
134
- * type T2 = Disjoint<1, 'one'> // true
135
- * type F1 = Disjoint<1 | 2, 2 | 3> // false
136
- * type F2 = Disjoint<string, 'hello'> // false
137
- * ```
138
- */
139
- export type Disjoint<A, B, Yes = true, No = false> = [A & B] extends [never] ? Yes : No;
140
- /**
141
- * Checks whether two types are mutually assignable.
142
- *
143
- * This is equivalent to checking that:
144
- * - `A` extends `B`
145
- * - `B` extends `A`
146
- *
147
- * In other words, the two types describe the same set of values,
148
- * even if they are written differently.
149
- *
150
- * @template A - The first type to check
151
- * @template B - The second type to check
152
- * @template Yes - The result if types are mutually assignable (defaults to `true`)
153
- * @template No - The result if types are not mutually assignable (defaults to `false`)
154
- *
155
- * ### Result
156
- *
157
- * - `Yes`: `A` and `B` are mutually assignable
158
- * - `No`: Otherwise
159
- *
160
- * @example
161
- * ```ts
162
- * type T1 = MutuallyAssignable<number, number> // true
163
- * type T2 = MutuallyAssignable<1 | 2, 2 | 1> // true
164
- * type F1 = MutuallyAssignable<string, number> // false
165
- * type F2 = MutuallyAssignable<1, number> // false
166
- * ```
167
- */
168
- export type MutuallyAssignable<A, B, Yes = true, No = false> = [A] extends [B] ? [B] extends [A] ? Yes : No : No;
169
- //# sourceMappingURL=compare.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/main/type/compare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,KAAK,CACf,CAAC,EACD,CAAC,EACD,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,EAAE,CAAA;AAEpF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,QAAQ,CAClB,CAAC,EACD,CAAC,EACD,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA;AAEpF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,CACjB,CAAC,EACD,CAAC,EACD,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,EAAE,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,YAAY,CACtB,CAAC,EACD,CAAC,EACD,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,KAAK,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,OAAO,CACjB,CAAC,EACD,CAAC,EACD,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,QAAQ,CAClB,CAAC,EACD,CAAC,EACD,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,kBAAkB,CAC5B,CAAC,EACD,CAAC,EACD,GAAG,GAAG,IAAI,EACV,EAAE,GAAG,KAAK,IACR,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=compare.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../../src/main/type/compare.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Checks whether two types are exactly the same.\n *\n * **⚠️Important:** parameter `A` and `B` are not distributive. When they are union type, it does not check each member separately.\n *\n * @template A - The first type to compare\n * @template B - The second type to compare\n * @template Yes - The result if types are exactly the same (defaults to `true`)\n * @template No - The result if types are not exactly the same (defaults to `false`)\n *\n * ### Result\n *\n * - `Yes`: `A` and `B` are exactly the same\n * - `No`: Otherwise\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<Exact<string, string>>().toBeTrue\n * expect<Exact<never, never>>().toBeTrue\n * expect<Exact<any, any>>().toBeTrue\n *\n * expect<Exact<{ a: 3 }, { a?: 3 }>>().toBeFalse\n * expect<Exact<1 | 2, 1>>().toBeFalse\n * expect<Exact<1, number>>().toBeFalse\n * expect<Exact<() => void, () => undefined>>().toBeFalse\n * ```\n */\nexport type Exact<\n A,\n B,\n Yes = true,\n No = false,\n> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? Yes : No\n\n/**\n * Checks whether two types are not exactly the same.\n *\n * This is the logical negation of `Exact<A, B>`.\n *\n * @template A - The first type to compare\n * @template B - The second type to compare\n * @template Yes - The result if types are not exactly the same (defaults to `true`)\n * @template No - The result if types are exactly the same (defaults to `false`)\n *\n * @example\n * ```ts\n * type T1 = NotExact<number, string> // true\n * type T2 = NotExact<1, number> // true\n * type F1 = NotExact<number, number> // false\n * type F2 = NotExact<1, 1> // false\n * ```\n */\nexport type NotExact<\n A,\n B,\n Yes = true,\n No = false,\n> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? No : Yes\n\n/**\n * Checks whether type `A` extends type `B`.\n *\n * **⚠️Important:** parameter `A` and `B` are not distributive. When they are union type, it treats them as a single entity.\n *\n * @template A - The type to check if it extends another type\n * @template B - The type to check if `A` extends\n * @template Yes - The result if `A` extends `B` (defaults to `true`)\n * @template No - The result if `A` does not extend `B` (defaults to `false`)\n *\n * ### Result\n *\n * - `Yes`: `A` is assignable to `B`\n * - `No`: Otherwise\n */\nexport type Extends<\n A,\n B,\n Yes = true,\n No = false,\n> = [A] extends [B] ? Yes : No\n\n/**\n * Checks whether type `A` is a *proper* subtype of type `B`.\n *\n * A proper extension means:\n * - `A` extends `B`\n * - `A` is not exactly the same type as `B`\n *\n * @template A - The type to check if it is a proper subtype\n * @template B - The type to check against\n * @template Yes - The result if `A` is a proper subtype of `B` (defaults to `true`)\n * @template No - The result if `A` is not a proper subtype of `B` (defaults to `false`)\n *\n * ### Result\n *\n * - `Yes`: `A` is a proper subtype of `B`\n * - `No`: Otherwise\n *\n * **Note:** the result will never be `boolean`.\n *\n * @example\n * ```ts\n * type T1 = ProperExtend<true, boolean> // true\n * type T2 = ProperExtend<1, number> // true\n * type F1 = ProperExtend<boolean, boolean> // false\n * type F2 = ProperExtend<number, string> // false\n * ```\n */\nexport type ProperExtend<\n A,\n B,\n Yes = true,\n No = false,\n> = [A] extends [B] ? Exact<A, B> extends false ? Yes : No : No\n\n/**\n * Checks whether two types have any overlapping members.\n *\n * @template A - The first type to check for overlap\n * @template B - The second type to check for overlap\n * @template Yes - The result if types overlap (defaults to `true`)\n * @template No - The result if types do not overlap (defaults to `false`)\n *\n * ### Result\n *\n * - `Yes`: `A` and `B` share at least one common type\n * - `No`: `A` and `B` are completely disjoint\n *\n * @example\n * ```ts\n * type T1 = Overlap<1 | 2, 2 | 3> // true\n * type T2 = Overlap<string, 'hello'> // true\n * type F1 = Overlap<string, number> // false\n * type F2 = Overlap<1, 'one'> // false\n * ```\n */\nexport type Overlap<\n A,\n B,\n Yes = true,\n No = false,\n> = [A & B] extends [never] ? No : Yes\n\n/**\n * Checks whether two types are disjoint.\n *\n * This is the logical negation of `Overlap<A, B>`.\n *\n * @template A - The first type to check for disjointness\n * @template B - The second type to check for disjointness\n * @template Yes - The result if types are disjoint (defaults to `true`)\n * @template No - The result if types are not disjoint (defaults to `false`)\n *\n * ### Result\n *\n * - `Yes`: `A` and `B` have no overlap\n * - `No`: `A` and `B` share at least one common type\n *\n * @example\n * ```ts\n * type T1 = Disjoint<string, number> // true\n * type T2 = Disjoint<1, 'one'> // true\n * type F1 = Disjoint<1 | 2, 2 | 3> // false\n * type F2 = Disjoint<string, 'hello'> // false\n * ```\n */\nexport type Disjoint<\n A,\n B,\n Yes = true,\n No = false,\n> = [A & B] extends [never] ? Yes : No\n\n/**\n * Checks whether two types are mutually assignable.\n *\n * This is equivalent to checking that:\n * - `A` extends `B`\n * - `B` extends `A`\n *\n * In other words, the two types describe the same set of values,\n * even if they are written differently.\n *\n * @template A - The first type to check\n * @template B - The second type to check\n * @template Yes - The result if types are mutually assignable (defaults to `true`)\n * @template No - The result if types are not mutually assignable (defaults to `false`)\n *\n * ### Result\n *\n * - `Yes`: `A` and `B` are mutually assignable\n * - `No`: Otherwise\n *\n * @example\n * ```ts\n * type T1 = MutuallyAssignable<number, number> // true\n * type T2 = MutuallyAssignable<1 | 2, 2 | 1> // true\n * type F1 = MutuallyAssignable<string, number> // false\n * type F2 = MutuallyAssignable<1, number> // false\n * ```\n */\nexport type MutuallyAssignable<\n A,\n B,\n Yes = true,\n No = false,\n> = [A] extends [B] ? [B] extends [A] ? Yes : No : No\n"]}
@@ -1,3 +0,0 @@
1
- export * from './compare.js';
2
- export * from './set.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/type/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/main/type/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,+CAA4B;AAC5B,2CAAwB;AACxB,+BAA+B","sourcesContent":["// Index start >>>>>>>>>>>>>>>>\nexport * from './compare.js'\nexport * from './set.js'\n// <<<<<<<<<<<<<<<< Index end\n"]}
@@ -1,34 +0,0 @@
1
- /**
2
- * Creates an intersection of all types in the provided tuple
3
- *
4
- * ## `IntersectOf<[A, B, ... T]>` = `A & B & ... & T`
5
- *
6
- * @template Types - A tuple of types to create an intersection from
7
- *
8
- * @example
9
- * ```ts
10
- * import { expect } from '@leawind/lay-sing/test-utils'
11
- *
12
- * type Result = IntersectOf<[{ a: string }, { b: number }, { c: boolean }]>
13
- * expect<Result>().toExtend<{ a: string } & { b: number } & { c: boolean }>().success
14
- * expect<Result>().toExtend<{ a: string; b: number; c: boolean }>().success
15
- * ```
16
- */
17
- export type IntersectOf<Types extends readonly unknown[]> = Types extends [infer First, ...infer Rest] ? First & IntersectOf<Rest> : unknown;
18
- /**
19
- * Creates a union of all types in the provided tuple
20
- *
21
- * ## `UnionOf<[A, B, ... T]>` = `A | B | ... | T`
22
- *
23
- * @template Types - A tuple of types to create a union from
24
- *
25
- * @example
26
- * ```ts
27
- * import { expect } from '@leawind/lay-sing/test-utils'
28
- *
29
- * type Result = UnionOf<[string, number, boolean]>
30
- * expect<Result>().toBe<string | number | boolean>().success
31
- * ```
32
- */
33
- export type UnionOf<Types extends readonly unknown[]> = Types extends [infer First, ...infer Rest] ? First | UnionOf<Rest> : never;
34
- //# sourceMappingURL=set.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/main/type/set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,IAAI,KAAK,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GAClG,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,GACzB,OAAO,CAAA;AAEX;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,IAAI,KAAK,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GAC9F,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,GACrB,KAAK,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/main/type/set.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Creates an intersection of all types in the provided tuple\n *\n * ## `IntersectOf<[A, B, ... T]>` = `A & B & ... & T`\n *\n * @template Types - A tuple of types to create an intersection from\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type Result = IntersectOf<[{ a: string }, { b: number }, { c: boolean }]>\n * expect<Result>().toExtend<{ a: string } & { b: number } & { c: boolean }>().success\n * expect<Result>().toExtend<{ a: string; b: number; c: boolean }>().success\n * ```\n */\nexport type IntersectOf<Types extends readonly unknown[]> = Types extends [infer First, ...infer Rest]\n ? First & IntersectOf<Rest>\n : unknown\n\n/**\n * Creates a union of all types in the provided tuple\n *\n * ## `UnionOf<[A, B, ... T]>` = `A | B | ... | T`\n *\n * @template Types - A tuple of types to create a union from\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type Result = UnionOf<[string, number, boolean]>\n * expect<Result>().toBe<string | number | boolean>().success\n * ```\n */\nexport type UnionOf<Types extends readonly unknown[]> = Types extends [infer First, ...infer Rest]\n ? First | UnionOf<Rest>\n : never\n"]}
@@ -1,5 +0,0 @@
1
- /**
2
- * Represents all possible TypedArray types
3
- */
4
- export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Float32Array | Float64Array | Uint32Array | BigInt64Array | BigUint64Array;
5
- //# sourceMappingURL=typed-array.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typed-array.d.ts","sourceRoot":"","sources":["../../src/main/typed-array.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,aAAa,GACb,cAAc,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=typed-array.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typed-array.js","sourceRoot":"","sources":["../../src/main/typed-array.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents all possible TypedArray types\n */\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Uint8ClampedArray\n | Int16Array\n | Uint16Array\n | Int32Array\n | Float32Array\n | Float64Array\n | Uint32Array\n | BigInt64Array\n | BigUint64Array\n"]}
@@ -1,81 +0,0 @@
1
- import type { Disjoint, Exact, If, MutuallyAssignable, NotExact, Overlap, SafePick } from '../main/index.js';
2
- /**
3
- * Type-level utility that compares two types and provides methods to test their relationship.
4
- * Offers options to check if types are same, different, overlapping, disjoint, or mutually assignable.
5
- *
6
- * @template T First type to compare
7
- * @template U Second type to compare
8
- * @template H Hidden property keys that are already used (internal tracking)
9
- *
10
- * @example
11
- * ```ts
12
- * import { compare } from '@leawind/lay-sing/test-utils'
13
- *
14
- * // Check if two types are the same
15
- * compare<number, number>().same // Available
16
- * // Check if two types are different
17
- * compare<number, string>().different // Available
18
- * // Check if two types overlap
19
- * compare<4, number>().overlap.different // Available
20
- * ```
21
- */
22
- export type CompareTypes<T, U, H extends PropertyKey = never> = Omit<SafePick<{
23
- /**
24
- * Available when types T and U are exactly the same.
25
- *
26
- * @example
27
- * ```ts
28
- * import { compare } from '@leawind/lay-sing/test-utils'
29
- *
30
- * compare<3, 3>().same // Available
31
- * compare<boolean, boolean>().same // Available
32
- * ```
33
- */
34
- same: CompareTypes<T, U, H | 'same'>;
35
- /**
36
- * Available when types T and U are different.
37
- *
38
- * @example
39
- * ```ts
40
- * import { compare } from '@leawind/lay-sing/test-utils'
41
- *
42
- * compare<4, 'abc'>().different // Available
43
- * compare<number, 4>().different // Available
44
- * ```
45
- */
46
- different: CompareTypes<T, U, H | 'different'>;
47
- /**
48
- * Available when types T and U have some overlap.
49
- *
50
- * @example
51
- * ```ts
52
- * import { compare } from '@leawind/lay-sing/test-utils'
53
- *
54
- * compare<4, number>().overlap // Available since 4 overlaps with number
55
- * ```
56
- */
57
- overlap: CompareTypes<T, U, H | 'overlap'>;
58
- /**
59
- * Available when types T and U have no overlap (are disjoint).
60
- *
61
- * @example
62
- * ```ts
63
- * import { compare } from '@leawind/lay-sing/test-utils'
64
- *
65
- * compare<4, 'abc'>().different.disjoint // Available since 4 and 'abc' are disjoint
66
- * ```
67
- */
68
- disjoint: CompareTypes<T, U, H | 'disjoint'>;
69
- /**
70
- * Available when types T and U are mutually assignable (each type can be assigned to the other).
71
- *
72
- * @example
73
- * ```ts
74
- * import { compare } from '@leawind/lay-sing/test-utils'
75
- *
76
- * compare<1 | 2, 1 | 2>().mutuallyAssignable // Available since identical union types are mutually assignable
77
- * ```
78
- */
79
- mutuallyAssignable: CompareTypes<T, U, H | 'mutuallyAssignable'>;
80
- }, If<Exact<T, U>, 'same'> | If<NotExact<T, U>, 'different'> | If<Overlap<T, U>, 'overlap'> | If<Disjoint<T, U>, 'disjoint'> | If<MutuallyAssignable<T, U>, 'mutuallyAssignable'>>, H>;
81
- //# sourceMappingURL=compare.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../src/test-utils/compare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,kBAAkB,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE5G;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,IAAI,CAClE,QAAQ,CACN;IACE;;;;;;;;;;OAUG;IACH,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAA;IAEpC;;;;;;;;;;OAUG;IACH,SAAS,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,CAAA;IAE9C;;;;;;;;;OASG;IACH,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAA;IAE1C;;;;;;;;;OASG;IACH,QAAQ,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAA;IAE5C;;;;;;;;;OASG;IACH,kBAAkB,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,oBAAoB,CAAC,CAAA;CACjE,EACC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,GACvB,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,GAC/B,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,GAC5B,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,GAC9B,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,oBAAoB,CAAC,CACrD,EACD,CAAC,CACF,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=compare.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/test-utils/compare.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disjoint, Exact, If, MutuallyAssignable, NotExact, Overlap, SafePick } from '../main/index.js'\n\n/**\n * Type-level utility that compares two types and provides methods to test their relationship.\n * Offers options to check if types are same, different, overlapping, disjoint, or mutually assignable.\n *\n * @template T First type to compare\n * @template U Second type to compare\n * @template H Hidden property keys that are already used (internal tracking)\n *\n * @example\n * ```ts\n * import { compare } from '@leawind/lay-sing/test-utils'\n *\n * // Check if two types are the same\n * compare<number, number>().same // Available\n * // Check if two types are different\n * compare<number, string>().different // Available\n * // Check if two types overlap\n * compare<4, number>().overlap.different // Available\n * ```\n */\nexport type CompareTypes<T, U, H extends PropertyKey = never> = Omit<\n SafePick<\n {\n /**\n * Available when types T and U are exactly the same.\n *\n * @example\n * ```ts\n * import { compare } from '@leawind/lay-sing/test-utils'\n *\n * compare<3, 3>().same // Available\n * compare<boolean, boolean>().same // Available\n * ```\n */\n same: CompareTypes<T, U, H | 'same'>\n\n /**\n * Available when types T and U are different.\n *\n * @example\n * ```ts\n * import { compare } from '@leawind/lay-sing/test-utils'\n *\n * compare<4, 'abc'>().different // Available\n * compare<number, 4>().different // Available\n * ```\n */\n different: CompareTypes<T, U, H | 'different'>\n\n /**\n * Available when types T and U have some overlap.\n *\n * @example\n * ```ts\n * import { compare } from '@leawind/lay-sing/test-utils'\n *\n * compare<4, number>().overlap // Available since 4 overlaps with number\n * ```\n */\n overlap: CompareTypes<T, U, H | 'overlap'>\n\n /**\n * Available when types T and U have no overlap (are disjoint).\n *\n * @example\n * ```ts\n * import { compare } from '@leawind/lay-sing/test-utils'\n *\n * compare<4, 'abc'>().different.disjoint // Available since 4 and 'abc' are disjoint\n * ```\n */\n disjoint: CompareTypes<T, U, H | 'disjoint'>\n\n /**\n * Available when types T and U are mutually assignable (each type can be assigned to the other).\n *\n * @example\n * ```ts\n * import { compare } from '@leawind/lay-sing/test-utils'\n *\n * compare<1 | 2, 1 | 2>().mutuallyAssignable // Available since identical union types are mutually assignable\n * ```\n */\n mutuallyAssignable: CompareTypes<T, U, H | 'mutuallyAssignable'>\n },\n | If<Exact<T, U>, 'same'>\n | If<NotExact<T, U>, 'different'>\n | If<Overlap<T, U>, 'overlap'>\n | If<Disjoint<T, U>, 'disjoint'>\n | If<MutuallyAssignable<T, U>, 'mutuallyAssignable'>\n >,\n H\n>\n"]}