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 +0,0 @@
1
- {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/test-utils/expect.ts"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=expect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expect.js","sourceRoot":"","sources":["../../src/test-utils/expect.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact, Extends, If, IfTupleIncludes, MutuallyAssignable, ProperExtend, SafePick } from '../main/index.js'\n\n/**\n * Represents the result of a type assertion based on a boolean condition.\n *\n * - If `true`, the result has a `success` property;\n * - If `false`, the result has a `fail` property;\n * - Otherwise, the result is `never`\n *\n * @template B The boolean condition result (true or false)\n * @template R The type of the result value (default is void)\n */\nexport type TypeAssertionResult<B extends boolean, R = void> = Exact<B, never> extends true ? never\n : [boolean] extends [B] ? never\n : [B] extends [true] ? {\n /**\n * This field exist only when this type assertion succeed\n *\n * If you expect this assertion to fail, use `.fail`\n */\n success: R\n }\n : [B] extends [false] ? {\n /**\n * This field exist only when this type assertion failed\n *\n * If you expect this assertion to success, use `.success`\n */\n fail: R\n }\n : never\n\ntype ExpectTypeMethods<T, H extends PropertyKey = never> = {\n /**\n * Tests if the current type is exactly the same as the provided type U.\n *\n * @template U The type to compare with\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<any>().toBe<any>().success\n * expect<never>().toBe<never>().success\n * expect<false>().toBe<true>().fail\n * ```\n */\n toBe<U>(): TypeAssertionResult<Exact<T, U>, ExpectType<T, H>>\n\n /**\n * Tests if the current type is mutually assignable with the provided type U.\n *\n * It's like:\n *\n * ```ts ignore\n * [T] extends [U] ? [U] extends [T] ? Yes : No : No\n * ```\n *\n * @template U The type to compare with\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<{ a: 1; b: 2 }>().toEqual<{ a: 1 } & { b: 2 }>().success\n * expect<1>().toEqual<1 | 2>().fail\n * ```\n */\n toEqual<U>(): TypeAssertionResult<MutuallyAssignable<T, U>, ExpectType<T, H>>\n\n /**\n * Tests if the current type T extends the provided type U.\n *\n * @template U The type to check extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<3.14>().toExtend<number>().success\n * expect<2>().toExtend<string>().fail\n * expect<'hello'>().toExtend<string>().success\n * ```\n */\n toExtend<U>(): TypeAssertionResult<Extends<T, U>, ExpectType<T, H>>\n\n /**\n * Tests if the current type T properly extends the provided type U (extends but is not the same).\n *\n * @template U The type to check proper extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<2>().toProperExtend<number>().success\n * expect<'a' | 'b'>().toProperExtend<string>().success\n * expect<number>().toProperExtend<number>().fail\n * ```\n */\n toProperExtend<U>(): TypeAssertionResult<ProperExtend<T, U>, ExpectType<T, H>>\n\n /**\n * Tests if the current type `T` has a property with key `K`.\n *\n * @template K The property key to check for\n *\n * ### Behavior\n *\n * - For single keys: succeeds if the key exists in `T`\n * - For union types: succeeds only if **all** keys in the union exist in `T`\n *\n * ### Examples\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type WithProp = { prop: string; another: number; may?: 5 }\n *\n * // Single key checks\n * expect<WithProp>().toHaveKey<'prop'>().success\n * expect<WithProp>().toHaveKey<'missing'>().fail\n *\n * // Union type checks\n * expect<WithProp>().toHaveKey<'prop' | 'another'>().success\n * expect<WithProp>().toHaveKey<'may' | 'unexist'>().fail\n * ```\n */\n toHaveKey<K extends PropertyKey>(): IfTupleIncludes<\n [never, any],\n K,\n never,\n TypeAssertionResult<Extends<K, keyof T>, ExpectType<T, H>>\n >\n}\n\n/**\n * Type-level testing utility that allows checking various relationships between types.\n * Provides methods to test type equality, extension, properties, and more.\n *\n * @template T The type being tested\n * @template H Hidden property keys that are already used (internal tracking)\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * // Test if two types are identical\n * expect<number>().toBe<number>().success\n * expect<number>().toBe<string>().fail\n * // Test if one type extends another\n * expect<2>().toExtend<number>().success\n * expect<2>().toExtend<string>().fail\n * // Test if type has a specific property\n * expect<{name: string}>().toHaveKey<'name'>().success\n * ```\n */\nexport type ExpectType<T, H extends PropertyKey = never> = Omit<\n (\n & ExpectTypeMethods<T, H>\n & {\n T: T\n inspect: { [K in keyof T]: T[K] }\n }\n & SafePick<\n {\n /**\n * Tests if the current type extends the Number primitive type.\n * Available only if the current type extends number.\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<3.14>().toExtendNumber\n * ```\n */\n toExtendNumber: ExpectType<T, H | 'toExtendNumber' | 'toExtend'>\n\n /**\n * Tests if the current type extends the String primitive type.\n * Available only if the current type extends string.\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<'hello'>().toExtendString\n * ```\n */\n toExtendString: ExpectType<T, H | 'toExtendString' | 'toExtend'>\n\n /**\n * Tests if the current type extends the Boolean primitive type.\n * Available only if the current type extends boolean.\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<true>().toExtendBoolean\n * ```\n */\n toExtendBoolean: ExpectType<T, H | 'toExtendBoolean' | 'toExtend'>\n },\n | If<Extends<T, number>, 'toExtendNumber'>\n | If<Extends<T, string>, 'toExtendString'>\n | If<Extends<T, boolean>, 'toExtendBoolean'>\n >\n & SafePick<\n {\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = any`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<any>().toBeAny\n * expect<any>().toBe<any>().success\n * ```\n */\n toBeAny: ExpectType<T, H | 'toBeAny' | 'toBe'>\n\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = never`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<never>().toBeNever\n * expect<never>().toBe<never>().success\n * ```\n */\n toBeNever: ExpectType<T, H | 'toBeNever' | 'toBe'>\n\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = unknown`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<unknown>().toBeUnknown\n * expect<unknown>().toBe<unknown>().success\n * ```\n */\n toBeUnknown: ExpectType<T, H | 'toBeUnknown' | 'toBe'>\n\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = void`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<void>().toBeVoid\n * expect<void>().toBe<void>().success\n * ```\n */\n toBeVoid: ExpectType<T, H | 'toBeVoid' | 'toBe'>\n\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = null`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<null>().toBeNull\n * expect<null>().toBe<null>().success\n * ```\n */\n toBeNull: ExpectType<T, H | 'toBeNull' | 'toBe'>\n\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = undefined`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<undefined>().toBeUndefined\n * expect<undefined>().toBe<undefined>().success\n * ```\n */\n toBeUndefined: ExpectType<T, H | 'toBeUndefined' | 'toBe'>\n\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = true`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<true>().toBeTrue\n * expect<true>().toBe<true>().success\n * ```\n */\n toBeTrue: ExpectType<T, H | 'toBeTrue' | 'toBe' | 'toExtendBoolean'>\n\n /**\n * Alias for {@link ExpectTypeMethods.toBe} where `U = false`\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<false>().toBeFalse\n * expect<false>().toBe<false>().success\n * ```\n */\n toBeFalse: ExpectType<T, H | 'toBeFalse' | 'toBe' | 'toExtendBoolean'>\n },\n | If<Exact<T, any>, 'toBeAny'>\n | If<Exact<T, never>, 'toBeNever'>\n | If<Exact<T, unknown>, 'toBeUnknown'>\n | If<Exact<T, void>, 'toBeVoid'>\n | If<Exact<T, null>, 'toBeNull'>\n | If<Exact<T, undefined>, 'toBeUndefined'>\n | If<Exact<T, true>, 'toBeTrue'>\n | If<Exact<T, false>, 'toBeFalse'>\n >\n ),\n H\n>\n"]}
@@ -1,77 +0,0 @@
1
- /**
2
- * [Full API documentation is available on JSR](https://jsr.io/@leawind/lay-sing/doc)
3
- *
4
- * @module
5
- */
6
- import type { CompareTypes } from './compare.js';
7
- import type { ExpectType } from './expect.js';
8
- export type { CompareTypes } from './compare.js';
9
- export type { ExpectType } from './expect.js';
10
- /**
11
- * A universal no-op placeholder implemented via `Proxy`.
12
- *
13
- * `NOOP` can be accessed, called, or chained indefinitely without throwing.
14
- * Every operation returns itself, making it safe to use as a dummy fallback
15
- * for APIs, optional hooks, or unimplemented interfaces.
16
- *
17
- * ### Special behaviors
18
- *
19
- * - Callable: invoking `NOOP()` returns `NOOP`
20
- * - Property access: `NOOP.anything` returns `NOOP`
21
- * - Promise-safe: `NOOP.then` is `undefined`, so it is not treated as a Promise
22
- * - Primitive coercion (`toString`, `valueOf`, `Symbol.toPrimitive`) yields
23
- * a stable string representation: `"[NOOP]"`
24
- *
25
- * This is useful in scenarios where a value is required syntactically but
26
- * should perform no action and never fail at runtime.
27
- *
28
- * @example
29
- * ```ts
30
- * NOOP.foo.bar().baz.qux; // safe, returns NOOP
31
- * String(NOOP); // "[NOOP]"
32
- * await NOOP; // does not await (not thenable)
33
- * ```
34
- */
35
- export declare const NOOP: any;
36
- /**
37
- * Creates an instance of CompareTypes to perform type-level comparisons between two types.
38
- * This function enables testing various relationships between types at compile time.
39
- * NOTE: This function does nothing at runtime and is purely for type-level testing.
40
- *
41
- * @template T First type to compare
42
- * @template U Second type to compare
43
- *
44
- * @returns A CompareTypes instance with methods to test relationships between T and U
45
- *
46
- * @example
47
- * ```ts
48
- * // Compare two identical types
49
- * compare<number, number>().same // Results in an available property
50
- * // Compare two different but overlapping types
51
- * compare<4, number>().overlap.different // Results in available properties
52
- * ```
53
- */
54
- export declare function compare<T, U>(): CompareTypes<T, U>;
55
- export declare function compare<T, U>(t: T, u: U): CompareTypes<T, U>;
56
- /**
57
- * Creates an instance of ExpectType to perform type-level assertions on the given type.
58
- * This function enables testing various type relationships at compile time.
59
- * NOTE: This function does nothing at runtime and is purely for type-level testing.
60
- *
61
- * @template T The type to be tested
62
- *
63
- * @returns An ExpectType instance with methods to test type relationships
64
- *
65
- * @example
66
- * ```ts
67
- * // Test exact type equality
68
- * expect<number>().toBe<number>().success
69
- * expect<number>().toBe<string>().fail
70
- * // Test if one type extends another
71
- * expect<3.14>().toExtend<number>().success
72
- * expect<2>().toExtend<string>().fail
73
- * ```
74
- */
75
- export declare function expect<T>(): ExpectType<T>;
76
- export declare function expect<T>(_: T): ExpectType<T>;
77
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,IAAI,EAAE,GA0BlB,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACnD,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAK7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA;AAC1C,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAQ,IAAI,KAAK,CAChC;IACE,OAAO,IAAI,CAAA;AACb,CAAC,EACD;IACE,GAAG,CAAC,CAAC,EAAE,IAAI;QACT,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,MAAM;gBACT,OAAO,SAAS,CAAA;YAClB,KAAK,SAAS,CAAC;YACf,KAAK,UAAU,CAAC;YAChB,KAAK,MAAM,CAAC,WAAW;gBACrB,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAA;YACvB;gBACE,OAAO,IAAI,CAAA;QACf,CAAC;IACH,CAAC;IACD,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI;IACf,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC;QAC/B,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,IAAI;KACZ,CAAC;IACF,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI;IAC1B,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI;IACf,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC;CAC7B,CACF,CAAA;AAsBD,MAAM,UAAU,OAAO;IACrB,OAAO,IAAI,CAAA;AACb,CAAC;AAuBD,MAAM,UAAU,MAAM;IACpB,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["/**\n * [Full API documentation is available on JSR](https://jsr.io/@leawind/lay-sing/doc)\n *\n * @module\n */\n\nimport type { CompareTypes } from './compare.js'\nimport type { ExpectType } from './expect.js'\n\nexport type { CompareTypes } from './compare.js'\nexport type { ExpectType } from './expect.js'\n\n/**\n * A universal no-op placeholder implemented via `Proxy`.\n *\n * `NOOP` can be accessed, called, or chained indefinitely without throwing.\n * Every operation returns itself, making it safe to use as a dummy fallback\n * for APIs, optional hooks, or unimplemented interfaces.\n *\n * ### Special behaviors\n *\n * - Callable: invoking `NOOP()` returns `NOOP`\n * - Property access: `NOOP.anything` returns `NOOP`\n * - Promise-safe: `NOOP.then` is `undefined`, so it is not treated as a Promise\n * - Primitive coercion (`toString`, `valueOf`, `Symbol.toPrimitive`) yields\n * a stable string representation: `\"[NOOP]\"`\n *\n * This is useful in scenarios where a value is required syntactically but\n * should perform no action and never fail at runtime.\n *\n * @example\n * ```ts\n * NOOP.foo.bar().baz.qux; // safe, returns NOOP\n * String(NOOP); // \"[NOOP]\"\n * await NOOP; // does not await (not thenable)\n * ```\n */\nexport const NOOP: any = new Proxy(\n function () {\n return NOOP\n },\n {\n get(_, prop) {\n switch (prop) {\n case 'then':\n return undefined\n case 'valueOf':\n case 'toString':\n case Symbol.toPrimitive:\n return () => '[NOOP]'\n default:\n return NOOP\n }\n },\n set: () => true,\n getOwnPropertyDescriptor: () => ({\n configurable: true,\n value: NOOP,\n }),\n getPrototypeOf: () => null,\n has: () => true,\n ownKeys: () => ['prototype'],\n },\n)\n\n/**\n * Creates an instance of CompareTypes to perform type-level comparisons between two types.\n * This function enables testing various relationships between types at compile time.\n * NOTE: This function does nothing at runtime and is purely for type-level testing.\n *\n * @template T First type to compare\n * @template U Second type to compare\n *\n * @returns A CompareTypes instance with methods to test relationships between T and U\n *\n * @example\n * ```ts\n * // Compare two identical types\n * compare<number, number>().same // Results in an available property\n * // Compare two different but overlapping types\n * compare<4, number>().overlap.different // Results in available properties\n * ```\n */\nexport function compare<T, U>(): CompareTypes<T, U>\nexport function compare<T, U>(t: T, u: U): CompareTypes<T, U>\nexport function compare<T, U>(): CompareTypes<T, U> {\n return NOOP\n}\n\n/**\n * Creates an instance of ExpectType to perform type-level assertions on the given type.\n * This function enables testing various type relationships at compile time.\n * NOTE: This function does nothing at runtime and is purely for type-level testing.\n *\n * @template T The type to be tested\n *\n * @returns An ExpectType instance with methods to test type relationships\n *\n * @example\n * ```ts\n * // Test exact type equality\n * expect<number>().toBe<number>().success\n * expect<number>().toBe<string>().fail\n * // Test if one type extends another\n * expect<3.14>().toExtend<number>().success\n * expect<2>().toExtend<string>().fail\n * ```\n */\nexport function expect<T>(): ExpectType<T>\nexport function expect<T>(_: T): ExpectType<T>\nexport function expect<T>(): ExpectType<T> {\n return NOOP\n}\n"]}
@@ -1,13 +0,0 @@
1
- /**
2
- * Represents a value that can be either `T` or a Promise of `T`
3
- *
4
- * @template T - The underlying type that may or may not be wrapped in a Promise
5
- *
6
- * @example
7
- * ```ts
8
- * type StringOrPromise = Awaitable<string>
9
- * // Equivalent to: string | Promise<string>
10
- * ```
11
- */
12
- export type Awaitable<T> = Promise<T> | T;
13
- //# sourceMappingURL=async.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/main/async.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/main/async.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents a value that can be either `T` or a Promise of `T`\n *\n * @template T - The underlying type that may or may not be wrapped in a Promise\n *\n * @example\n * ```ts\n * type StringOrPromise = Awaitable<string>\n * // Equivalent to: string | Promise<string>\n * ```\n */\nexport type Awaitable<T> = Promise<T> | T\n"]}
@@ -1,59 +0,0 @@
1
- /**
2
- * Negates a boolean type
3
- *
4
- * @template T - The boolean type to negate
5
- *
6
- * @example
7
- * ```ts
8
- * import { expect } from '@leawind/lay-sing/test-utils'
9
- *
10
- * expect<Not<true>>().toBeFalse
11
- * expect<Not<false>>().toBeTrue
12
- * expect<Not<boolean>>().toBe<boolean>().success
13
- * ```
14
- */
15
- export type Not<T extends boolean> = T extends true ? false : T extends false ? true : boolean;
16
- /**
17
- * Logical AND operation on two boolean types
18
- *
19
- * @template A - The first boolean type to compare
20
- * @template B - The second boolean type to compare
21
- *
22
- * @example
23
- * ```ts
24
- * import { expect } from '@leawind/lay-sing/test-utils'
25
- *
26
- * expect<And<true, true>>().toBeTrue
27
- * expect<And<true, false>>().toBeFalse
28
- * expect<And<false, true>>().toBeFalse
29
- * expect<And<false, false>>().toBeFalse
30
- * expect<And<boolean, boolean>>().toBe<boolean>().success
31
- * ```
32
- */
33
- export type And<A extends boolean, B extends boolean> = A extends never ? never : [B] extends [never] ? never : (A extends true ? (B extends true ? true : false) : false);
34
- /**
35
- * Logical OR operation on two boolean types
36
- *
37
- * @template A - The first boolean type to compare
38
- * @template B - The second boolean type to compare
39
- *
40
- * ### Result
41
- *
42
- * - `never`: if either `A` or `B` is `never`
43
- * - `boolean`: if either `A` or `B` is `boolean` or `any`
44
- * - `false`: if both `A` and `B` are `false`
45
- * - `true`: otherwise
46
- *
47
- * @example
48
- * ```ts
49
- * import { expect } from '@leawind/lay-sing/test-utils'
50
- *
51
- * expect<Or<true, true>>().toBeTrue
52
- * expect<Or<true, false>>().toBeTrue
53
- * expect<Or<false, true>>().toBeTrue
54
- * expect<Or<false, false>>().toBeFalse
55
- * expect<Or<boolean, false>>().toBe<boolean>().success
56
- * ```
57
- */
58
- export type Or<A extends boolean, B extends boolean> = [A] extends [never] ? never : [B] extends [never] ? never : [boolean] extends [A] ? boolean : [boolean] extends [B] ? boolean : true extends A ? true : true extends B ? true : false;
59
- //# sourceMappingURL=boolean.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../src/main/boolean.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,SAAS,IAAI,GAAG,KAAK,GACvD,CAAC,SAAS,KAAK,GAAG,IAAI,GACtB,OAAO,CAAA;AAEX;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,GAAG,CACb,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,IACf,CAAC,SAAS,KAAK,GAAG,KAAK,GACvB,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAC3B,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,EAAE,CACZ,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,IACf,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAC3B,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAC3B,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,GAC/B,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,GAC/B,IAAI,SAAS,CAAC,GAAG,IAAI,GACrB,IAAI,SAAS,CAAC,GAAG,IAAI,GACrB,KAAK,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../src/main/boolean.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Negates a boolean type\n *\n * @template T - The boolean type to negate\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<Not<true>>().toBeFalse\n * expect<Not<false>>().toBeTrue\n * expect<Not<boolean>>().toBe<boolean>().success\n * ```\n */\nexport type Not<T extends boolean> = T extends true ? false\n : T extends false ? true\n : boolean\n\n/**\n * Logical AND operation on two boolean types\n *\n * @template A - The first boolean type to compare\n * @template B - The second boolean type to compare\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<And<true, true>>().toBeTrue\n * expect<And<true, false>>().toBeFalse\n * expect<And<false, true>>().toBeFalse\n * expect<And<false, false>>().toBeFalse\n * expect<And<boolean, boolean>>().toBe<boolean>().success\n * ```\n */\nexport type And<\n A extends boolean,\n B extends boolean,\n> = A extends never ? never\n : [B] extends [never] ? never\n : (A extends true ? (B extends true ? true : false) : false)\n\n/**\n * Logical OR operation on two boolean types\n *\n * @template A - The first boolean type to compare\n * @template B - The second boolean type to compare\n *\n * ### Result\n *\n * - `never`: if either `A` or `B` is `never`\n * - `boolean`: if either `A` or `B` is `boolean` or `any`\n * - `false`: if both `A` and `B` are `false`\n * - `true`: otherwise\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<Or<true, true>>().toBeTrue\n * expect<Or<true, false>>().toBeTrue\n * expect<Or<false, true>>().toBeTrue\n * expect<Or<false, false>>().toBeFalse\n * expect<Or<boolean, false>>().toBe<boolean>().success\n * ```\n */\nexport type Or<\n A extends boolean,\n B extends boolean,\n> = [A] extends [never] ? never\n : [B] extends [never] ? never\n : [boolean] extends [A] ? boolean\n : [boolean] extends [B] ? boolean\n : true extends A ? true\n : true extends B ? true\n : false\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/main/control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,EAAE,CAAC,SAAS,SAAS,OAAO,EAAE,GAAG,EAAE,EAAE,GAAG,KAAK,IAAI,SAAS,SAAS,IAAI,GAAG,GAAG,GAAG,EAAE,CAAA;AAE9F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,OAAO,CAAC,SAAS,SAAS,OAAO,EAAE,GAAG,EAAE,EAAE,GAAG,KAAK,IAAI,SAAS,SAAS,KAAK,GAAG,GAAG,GAAG,EAAE,CAAA;AAEpG;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAE7D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,CACrB,CAAC,EACD,KAAK,SAAS,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAC3C,OAAO,GAAG,KAAK,IACb,KAAK,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GAAG,CAC7C,KAAK,SAAS,CAAC,MAAM,SAAS,EAAE,MAAM,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,SAAS,IAAI,GAAG,MAAM,GACpF,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,SAAS,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,GAAG,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GACvF,CAAC,KAAK,CAAC,CACZ,GACC,OAAO,CAAA;AAEX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,aAAa,CACvB,CAAC,EACD,KAAK,SAAS,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAC3C,OAAO,GAAG,KAAK,IACb,KAAK,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GAAG,CAC7C,KAAK,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAC5B,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,IAAI,SAAS,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,GAAG,KAAK,EAAE,OAAO,CAAC,CAAC,GAC5G,KAAK,CACV,GACC,OAAO,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/main/control.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact } from './type/compare.js'\n\n/**\n * Conditional type - returns `Yes` if condition `Condition` is true, otherwise returns `No`\n *\n * @template Condition - The boolean condition to check\n * @template Yes - The type to return if condition is true\n * @template No - The type to return if condition is false (defaults to `never`)\n *\n * @example\n * ```ts\n * type Result = If<true, 'yes', 'no'> // 'yes'\n * type Result2 = If<false, 'yes', 'no'> // 'no'\n * type BoolResult = If<boolean, 'yes', 'no'> // boolean\n * ```\n */\nexport type If<Condition extends boolean, Yes, No = never> = Condition extends true ? Yes : No\n\n/**\n * Conditional type - returns `Yes` if condition `Condition` is false, otherwise returns `No`\n *\n * @template Condition - The boolean condition to check\n * @template Yes - The type to return if condition is false\n * @template No - The type to return if condition is true (defaults to `never`)\n *\n * ### Result\n *\n * - `never`: if `Condition` is `never`\n * - `Yes`: if `Condition` is `false`\n * - `No`: if `Condition` is `true`\n *\n * @example\n * ```ts\n * type Result = IfFalse<false, 'yes', 'no'> // 'yes'\n * type Result2 = IfFalse<true, 'yes', 'no'> // 'no'\n * type BoolResult = IfFalse<boolean, 'yes', 'no'> // boolean\n * ```\n */\nexport type IfFalse<Condition extends boolean, Yes, No = never> = Condition extends false ? Yes : No\n\n/**\n * Case tuple type used with `SwitchExact` and `SwitchExtends`\n *\n * @template T - The condition type to match against\n * @template Result - The result type to return if match is found\n *\n * @example\n * ```ts\n * type MyCase = Case<1, 'one'>\n * // Equivalent to: [1, 'one']\n * ```\n *\n * @see SwitchExact\n */\nexport type Case<T = unknown, Result = unknown> = [T, Result]\n\n/**\n * Default case type used with `SwitchExact` and `SwitchExtends`\n *\n * @template T - The default result type\n *\n * @example\n * ```ts\n * type NameMap<id> = SwitchExact<id, [\n * [1, 'Alice'],\n * [2, 'Bob'],\n * ], DefaultCase<'Steve'>>\n * ```\n *\n * @see SwitchExact\n */\nexport type DefaultCase<T> = T\n\n/**\n * Switch type that uses exact matching logic\n *\n * **⚠️Important:** `T` parameter is not distributive. When `T` is a union type, it does not check each member separately.\n *\n * @template T - The type to match against cases\n * @template Cases - Array of case tuples, each tuple has the form [Condition, Result]\n * @template Default - Default result if no exact match is found (defaults to `never`)\n *\n * @example\n * ```ts\n * type Result = SwitchExact<2, [\n * [1, 'Alice'],\n * [2, 'Bob'],\n * [3, 'Charlie'],\n * ], DefaultCase<'Steve'>>\n *\n * // Result: 'Bob'\n * ```\n */\nexport type SwitchExact<\n T,\n Cases extends readonly [unknown, unknown][],\n Default = never,\n> = Cases extends [infer First, ...infer Rest] ? (\n First extends [infer Condition, infer Result] ? (Exact<T, Condition> extends true ? Result\n : (SwitchExact<T, Rest extends readonly [unknown, unknown][] ? Rest : never, Default>))\n : (never)\n )\n : Default\n\n/**\n * Switch type that uses 'extends' logic instead of 'Exact' logic\n *\n * **⚠️Important:** `T` parameter is not distributive. When `T` is a union type, it does not check each member separately.\n *\n * @template T - The type to match against cases\n * @template Cases - Array of case tuples, each tuple has the form [Condition, Result]\n * @template Default - Default result if no match is found (defaults to `never`)\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<\n * SwitchExtends<string, [\n * [number, boolean],\n * [string, boolean],\n * ], Error>\n * >().toBe<boolean>().success\n * ```\n */\nexport type SwitchExtends<\n T,\n Cases extends readonly [unknown, unknown][],\n Default = never,\n> = Cases extends [infer First, ...infer Rest] ? (\n First extends [infer C, infer R]\n ? ([T] extends [C] ? R : SwitchExtends<T, Rest extends readonly [unknown, unknown][] ? Rest : never, Default>)\n : never\n )\n : Default\n"]}
@@ -1,56 +0,0 @@
1
- /**
2
- * Append documentation or auxiliary metadata to type `T`
3
- * without changing its shape.
4
- *
5
- * This type intersects `Doc` onto `T`, but only keeps the keys
6
- * originally defined in `T`. As a result:
7
- *
8
- * - `Doc` cannot introduce new properties
9
- * - Existing properties in `T` are preserved
10
- * - `Doc` may further constrain or annotate existing properties
11
- *
12
- * This is typically used to attach JSDoc comments, branding,
13
- * or editor-only metadata to an existing type while keeping
14
- * its public structure intact.
15
- *
16
- * @template T - The target type to append documentation to
17
- * @template Doc - The documentation or metadata type to append
18
- *
19
- * @example
20
- * ```ts
21
- * import { expect } from '@leawind/lay-sing/test-utils'
22
- *
23
- * type User = { name: string; age: number }
24
- * type UserWithDoc = AppendDoc<User, { name: string }>
25
- *
26
- * expect<UserWithDoc>().toBe<User>().success
27
- * ```
28
- */
29
- export type AppendDoc<T, Doc> = Pick<T & Doc, keyof T>;
30
- /**
31
- * Prepend documentation or auxiliary metadata to type `T`
32
- * without changing its shape.
33
- *
34
- * This is similar to {@link AppendDoc}, but the intersection order
35
- * is reversed (`Doc & T`), which can affect how property types,
36
- * documentation, and hover information are presented by tooling.
37
- *
38
- * In practice, this allows `Doc` to act as a non-invasive,
39
- * descriptive layer while ensuring `T` remains the authoritative
40
- * source of truth for property types.
41
- *
42
- * @template T - The target type to prepend documentation to
43
- * @template Doc - The documentation or metadata type to prepend
44
- *
45
- * @example
46
- * ```ts
47
- * import { expect } from '@leawind/lay-sing/test-utils'
48
- *
49
- * type User = { name: string; age: number }
50
- * type UserWithDoc = PrependDoc<User, { age: number }>
51
- *
52
- * expect<UserWithDoc>().toBe<User>().success
53
- * ```
54
- */
55
- export type PrependDoc<T, Doc> = Pick<Doc & T, keyof T>;
56
- //# sourceMappingURL=doc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../src/main/doc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc.js","sourceRoot":"","sources":["../../src/main/doc.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Append documentation or auxiliary metadata to type `T`\n * without changing its shape.\n *\n * This type intersects `Doc` onto `T`, but only keeps the keys\n * originally defined in `T`. As a result:\n *\n * - `Doc` cannot introduce new properties\n * - Existing properties in `T` are preserved\n * - `Doc` may further constrain or annotate existing properties\n *\n * This is typically used to attach JSDoc comments, branding,\n * or editor-only metadata to an existing type while keeping\n * its public structure intact.\n *\n * @template T - The target type to append documentation to\n * @template Doc - The documentation or metadata type to append\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type User = { name: string; age: number }\n * type UserWithDoc = AppendDoc<User, { name: string }>\n *\n * expect<UserWithDoc>().toBe<User>().success\n * ```\n */\nexport type AppendDoc<T, Doc> = Pick<T & Doc, keyof T>\n\n/**\n * Prepend documentation or auxiliary metadata to type `T`\n * without changing its shape.\n *\n * This is similar to {@link AppendDoc}, but the intersection order\n * is reversed (`Doc & T`), which can affect how property types,\n * documentation, and hover information are presented by tooling.\n *\n * In practice, this allows `Doc` to act as a non-invasive,\n * descriptive layer while ensuring `T` remains the authoritative\n * source of truth for property types.\n *\n * @template T - The target type to prepend documentation to\n * @template Doc - The documentation or metadata type to prepend\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type User = { name: string; age: number }\n * type UserWithDoc = PrependDoc<User, { age: number }>\n *\n * expect<UserWithDoc>().toBe<User>().success\n * ```\n */\nexport type PrependDoc<T, Doc> = Pick<Doc & T, keyof T>\n"]}
@@ -1,27 +0,0 @@
1
- /**
2
- * Represents a function with any parameters and a specific return type
3
- *
4
- * @template Return - The return type of the function
5
- * @template Params - The parameters of the function as a tuple type
6
- *
7
- * @example
8
- * ```ts
9
- * type NumberToStringFn = AnyFunction<string, [number]>
10
- * // Equivalent to: (arg: number) => string
11
- * ```
12
- */
13
- export type AnyFunction<Return = any, Params extends any[] = any[]> = (...args: Params) => Return;
14
- /**
15
- * Represents a constructor function with any parameters and a specific return type
16
- *
17
- * @template Return - The type returned by the constructor function
18
- * @template Params - The parameters of the constructor function as a tuple type
19
- *
20
- * @example
21
- * ```ts
22
- * type StringConstructor = Constructor<string, [number]>
23
- * // Equivalent to: new (arg: number) => string
24
- * ```
25
- */
26
- export type Constructor<Return = any, Params extends any[] = any[]> = new (...args: Params) => Return;
27
- //# sourceMappingURL=function.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/main/function.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,CACrB,MAAM,GAAG,GAAG,EACZ,MAAM,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,IAC1B,CAAC,GAAG,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;AAE/B;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,CACrB,MAAM,GAAG,GAAG,EACZ,MAAM,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,IAC1B,KAAK,GAAG,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=function.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"function.js","sourceRoot":"","sources":["../../src/main/function.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents a function with any parameters and a specific return type\n *\n * @template Return - The return type of the function\n * @template Params - The parameters of the function as a tuple type\n *\n * @example\n * ```ts\n * type NumberToStringFn = AnyFunction<string, [number]>\n * // Equivalent to: (arg: number) => string\n * ```\n */\nexport type AnyFunction<\n Return = any,\n Params extends any[] = any[],\n> = (...args: Params) => Return\n\n/**\n * Represents a constructor function with any parameters and a specific return type\n *\n * @template Return - The type returned by the constructor function\n * @template Params - The parameters of the constructor function as a tuple type\n *\n * @example\n * ```ts\n * type StringConstructor = Constructor<string, [number]>\n * // Equivalent to: new (arg: number) => string\n * ```\n */\nexport type Constructor<\n Return = any,\n Params extends any[] = any[],\n> = new (...args: Params) => Return\n"]}
@@ -1,44 +0,0 @@
1
- /**
2
- * Primitive values allowed by the JSON specification.
3
- *
4
- * This represents the set of non-object, non-array values
5
- * that can appear in valid JSON data.
6
- */
7
- export type JsonPrimitive = string | number | boolean | null;
8
- /**
9
- * A JSON array.
10
- *
11
- * Each element of the array must itself be a valid `JsonValue`.
12
- */
13
- export type JsonArray = JsonValue[];
14
- /**
15
- * A JSON object.
16
- *
17
- * Keys are strings, and values must be valid `JsonValue`s.
18
- * This mirrors the object structure defined by the JSON specification.
19
- */
20
- export type JsonObject = {
21
- [key: string]: JsonValue;
22
- };
23
- /**
24
- * Any valid JSON value.
25
- *
26
- * This is a strict representation of JSON data, suitable for
27
- * describing the result of `JSON.parse`, serialized payloads,
28
- * or schema-level JSON structures.
29
- */
30
- export type JsonValue = JsonPrimitive | JsonArray | JsonObject;
31
- /**
32
- * A JavaScript value that can be safely serialized to JSON.
33
- *
34
- * Unlike `JsonValue`, this type represents values *before*
35
- * serialization, describing the set of recursive structures
36
- * that `JSON.stringify` can handle.
37
- *
38
- * This is useful for constraining inputs that are expected to
39
- * be JSON-serializable, rather than already being JSON data.
40
- */
41
- export type Jsonable = string | number | boolean | null | Jsonable[] | {
42
- [key: string]: Jsonable;
43
- };
44
- //# sourceMappingURL=json.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/main/json.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAE5D;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,EAAE,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAErD;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAA;AAE9D;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,QAAQ,EAAE,GACV;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/main/json.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Primitive values allowed by the JSON specification.\n *\n * This represents the set of non-object, non-array values\n * that can appear in valid JSON data.\n */\nexport type JsonPrimitive = string | number | boolean | null\n\n/**\n * A JSON array.\n *\n * Each element of the array must itself be a valid `JsonValue`.\n */\nexport type JsonArray = JsonValue[]\n\n/**\n * A JSON object.\n *\n * Keys are strings, and values must be valid `JsonValue`s.\n * This mirrors the object structure defined by the JSON specification.\n */\nexport type JsonObject = { [key: string]: JsonValue }\n\n/**\n * Any valid JSON value.\n *\n * This is a strict representation of JSON data, suitable for\n * describing the result of `JSON.parse`, serialized payloads,\n * or schema-level JSON structures.\n */\nexport type JsonValue = JsonPrimitive | JsonArray | JsonObject\n\n/**\n * A JavaScript value that can be safely serialized to JSON.\n *\n * Unlike `JsonValue`, this type represents values *before*\n * serialization, describing the set of recursive structures\n * that `JSON.stringify` can handle.\n *\n * This is useful for constraining inputs that are expected to\n * be JSON-serializable, rather than already being JSON data.\n */\nexport type Jsonable =\n | string\n | number\n | boolean\n | null\n | Jsonable[]\n | { [key: string]: Jsonable }\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/main/key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,cAAc,CAAC,GAAG,EAAE,SAAS,IAAI,OAAO,CAClD;KACG,CAAC,IAAI,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK;CAC9E,CAAC,MAAM,GAAG,CAAC,EACZ,SAAS,CACV,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,eAAe,CAAC,GAAG,EAAE,SAAS,IAAI,OAAO,CACnD;KAAG,CAAC,IAAI,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK;CAAE,CAAC,MAAM,GAAG,CAAC,EAClF,SAAS,CACV,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"key.js","sourceRoot":"","sources":["../../src/main/key.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact } from './type/index.js'\n\n/**\n * Extracts the keys of an object whose **base value type** matches the specified `ValueType` (ignoring undefined from optional properties).\n *\n * This utility matches the underlying/base type of each property (stripping `undefined` added by optional modifiers `?`).\n * For optional properties (e.g., `a?: string`), the type is treated as `string` – no need to include `undefined` in `ValueType` to match.\n *\n * @template Obj - The target object type to extract keys from.\n * @template ValueType - The base type to match against property values (ignoring undefined from optional properties).\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * // Basic usage: match base type (non-optional property)\n * type A = { a: 1; b: 2; c: 1 };\n * expect<KeysOfBaseType<A, 1>>().toBe<'a' | 'c'>().success\n *\n * // Key difference: optional property matching (ignores undefined)\n * type B = { a?: string; b: string };\n * expect<KeysOfBaseType<B, string>>().toBe<'a' | 'b'>().success // matches base type of both\n * expect<KeysOfBaseType<B, string | undefined>>().toBe<never>().success // base type does not include undefined\n *\n * type C = { a: never; b: any; c: unknown };\n * expect<KeysOfBaseType<C, never>>().toBe<'a'>().success\n * expect<KeysOfBaseType<C, any>>().toBe<'b'>().success\n * expect<KeysOfBaseType<C, unknown>>().toBe<'c'>().success\n * ```\n */\nexport type KeysOfBaseType<Obj, ValueType> = Exclude<\n {\n [K in keyof Obj]: Exact<Required<Obj>[K], ValueType> extends true ? K : never\n }[keyof Obj],\n undefined\n>\n\n/**\n * Extracts the keys of an object whose **complete value type** exactly matches the specified `ValueType` (including undefined for optional properties).\n *\n * This utility strictly matches the full type of each property (including `undefined` added by optional modifiers `?`).\n * For optional properties (e.g., `a?: string`), the type is treated as `string | undefined` – to match, `ValueType` must include `undefined`.\n *\n * @template Obj - The target object type to extract keys from.\n * @template ValueType - The exact type to match against property values (including undefined for optional properties).\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * // Basic usage: match exact type (non-optional property)\n * type A = { a: 1; b: 2; c: 1 };\n * expect<KeysOfExactType<A, 1>>().toBe<'a' | 'c'>().success\n *\n * // Key difference: optional property matching (requires undefined in `ValueType`)\n * type B = { a?: string };\n * expect<KeysOfExactType<B, string | undefined>>().toBe<'a'>().success // matches complete type\n * expect<KeysOfExactType<B, string>>().toBe<never>().success // does not match complete type\n *\n * type C = { a: never; b: any; c: unknown };\n * expect<KeysOfExactType<C, never>>().toBe<'a'>().success\n * expect<KeysOfExactType<C, any>>().toBe<'b'>().success\n * expect<KeysOfExactType<C, unknown>>().toBe<'c'>().success\n * ```\n */\nexport type KeysOfExactType<Obj, ValueType> = Exclude<\n { [K in keyof Obj]: Exact<Obj[K], ValueType> extends true ? K : never }[keyof Obj],\n undefined\n>\n"]}
@@ -1,120 +0,0 @@
1
- import type { KeysOfExactType } from './key.js';
2
- /**
3
- * Get property type from object, with fallback for missing keys.
4
- *
5
- * @template Obj - The object type to access
6
- * @template K - The key to access in the object
7
- * @template E - The fallback type if the key doesn't exist (defaults to `never`)
8
- *
9
- * @returns `Obj[K]` if key exists, otherwise `E`.
10
- *
11
- * @example
12
- * ```ts
13
- * import { expect } from '@leawind/lay-sing/test-utils'
14
- *
15
- * type User = { name: string; age?: number };
16
- *
17
- * expect<Access<User, 'name'>>().toBe<string>().success
18
- * expect<Access<User, 'age'>>().toBe<number | undefined>().success
19
- * expect<Access<User, 'email', 'none'>>().toBe<'none'>().success
20
- * ```
21
- */
22
- export type Access<Obj, K extends PropertyKey, E = never> = K extends keyof Obj ? Obj[K] : E;
23
- /**
24
- * Inverse of `Access` - gets keys from an object that have values of a specific type
25
- *
26
- * @template T - The object type to inspect
27
- * @template V - The value type to match against
28
- * @template E - The fallback type if no keys match (defaults to `never`)
29
- *
30
- * @example
31
- * ```ts
32
- * import { expect } from '@leawind/lay-sing/test-utils'
33
- *
34
- * expect<InverseAccess<{ a: string }, string>>().toBe<'a'>().success
35
- * expect<InverseAccess<{ a: string; b: string }, string>>().toBe<'a' | 'b'>().success
36
- * expect<InverseAccess<{ a: string }, number>>().toBe<never>().success
37
- * ```
38
- */
39
- export type InverseAccess<T, V, E = never> = {
40
- [K in keyof T]: T[K] extends V ? K : E;
41
- }[keyof T];
42
- /**
43
- * Recursively makes all properties of `T` optional
44
- *
45
- * @template T - The object type to make deep partial
46
- *
47
- * @example
48
- * ```ts
49
- * import { expect } from '@leawind/lay-sing/test-utils'
50
- *
51
- * type Result = DeepPartial<{ a: string; nested: { b: number } }>
52
- * expect<Result>().toBe<{ a?: string; nested?: { b?: number } }>().success
53
- * ```
54
- */
55
- export type DeepPartial<T> = {
56
- [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
57
- };
58
- /**
59
- * Recursively makes all properties of `T` required
60
- *
61
- * @template T - The object type to make deep required
62
- *
63
- * @example
64
- * ```ts
65
- * import { expect } from '@leawind/lay-sing/test-utils'
66
- *
67
- * expect<DeepRequire<{ _?: { _?: 1 } }>>().toBe<{ _: { _: 1 } }>().success
68
- * ```
69
- */
70
- export type DeepRequire<T> = {
71
- [K in keyof T]-?: T[K] extends object | undefined ? DeepRequire<NonNullable<T[K]>> : T[K];
72
- };
73
- /**
74
- * **⚠️Important:** parameter `T` and `U` are not distributive. When they are union type, it treats them as a single entity.
75
- *
76
- * @template T - The type to test (not distributed over unions)
77
- * @template U - The constraint type to test against
78
- *
79
- * @example
80
- *
81
- * ```ts
82
- * import { expect } from '@leawind/lay-sing/test-utils'
83
- *
84
- * expect<AssertExtends<string, number>>().toBeNever
85
- * expect<AssertExtends<1 | 2, 1>>().toBeNever
86
- * expect<AssertExtends<1, 1 | 2>>().toBe<1>().success
87
- * ```
88
- */
89
- export type AssertExtends<T, U> = [T] extends [U] ? T : never;
90
- /**
91
- * Safely picks keys `Key` from type `Obj`, excluding non-existent keys
92
- *
93
- * @template Obj - The object type to pick keys from
94
- * @template Key - The keys to pick from the object
95
- *
96
- * @example
97
- * ```ts
98
- * import { expect } from '@leawind/lay-sing/test-utils'
99
- *
100
- * type Result = SafePick<{ a: string; b: number }, 'a' | 'c'>
101
- * expect<Result>().toBe<{ a: string }>().success
102
- * ```
103
- */
104
- export type SafePick<Obj, Key> = Pick<Obj, Key & keyof Obj>;
105
- /**
106
- * Picks properties from `T` that have values of type `U`
107
- *
108
- * @template T - The object type to pick properties from
109
- * @template U - The value type to match against
110
- *
111
- * @example
112
- * ```ts
113
- * import { expect } from '@leawind/lay-sing/test-utils'
114
- * type A = { a: string; b: number; c: string }
115
- * type Strings = PropsOfBaseType<A, string> // { a: string; c: string }
116
- * expect<PropsOfBaseType<A, string>>().toBe<{ a: string; c: string }>()
117
- * ```
118
- */
119
- export type PropsOfBaseType<T, U> = Pick<T, KeysOfExactType<Required<T>, U>>;
120
- //# sourceMappingURL=object.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/main/object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,WAAW,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,SAAS,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC;CAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AAEhG;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC1F,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,QAAQ,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,CAAC,CAAA;AAE3D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/main/object.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeysOfExactType } from './key.js'\n\n/**\n * Get property type from object, with fallback for missing keys.\n *\n * @template Obj - The object type to access\n * @template K - The key to access in the object\n * @template E - The fallback type if the key doesn't exist (defaults to `never`)\n *\n * @returns `Obj[K]` if key exists, otherwise `E`.\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type User = { name: string; age?: number };\n *\n * expect<Access<User, 'name'>>().toBe<string>().success\n * expect<Access<User, 'age'>>().toBe<number | undefined>().success\n * expect<Access<User, 'email', 'none'>>().toBe<'none'>().success\n * ```\n */\nexport type Access<Obj, K extends PropertyKey, E = never> = K extends keyof Obj ? Obj[K] : E\n\n/**\n * Inverse of `Access` - gets keys from an object that have values of a specific type\n *\n * @template T - The object type to inspect\n * @template V - The value type to match against\n * @template E - The fallback type if no keys match (defaults to `never`)\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<InverseAccess<{ a: string }, string>>().toBe<'a'>().success\n * expect<InverseAccess<{ a: string; b: string }, string>>().toBe<'a' | 'b'>().success\n * expect<InverseAccess<{ a: string }, number>>().toBe<never>().success\n * ```\n */\nexport type InverseAccess<T, V, E = never> = { [K in keyof T]: T[K] extends V ? K : E }[keyof T]\n\n/**\n * Recursively makes all properties of `T` optional\n *\n * @template T - The object type to make deep partial\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type Result = DeepPartial<{ a: string; nested: { b: number } }>\n * expect<Result>().toBe<{ a?: string; nested?: { b?: number } }>().success\n * ```\n */\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]\n}\n\n/**\n * Recursively makes all properties of `T` required\n *\n * @template T - The object type to make deep required\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<DeepRequire<{ _?: { _?: 1 } }>>().toBe<{ _: { _: 1 } }>().success\n * ```\n */\nexport type DeepRequire<T> = {\n [K in keyof T]-?: T[K] extends object | undefined ? DeepRequire<NonNullable<T[K]>> : T[K]\n}\n\n/**\n * **⚠️Important:** parameter `T` and `U` are not distributive. When they are union type, it treats them as a single entity.\n *\n * @template T - The type to test (not distributed over unions)\n * @template U - The constraint type to test against\n *\n * @example\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * expect<AssertExtends<string, number>>().toBeNever\n * expect<AssertExtends<1 | 2, 1>>().toBeNever\n * expect<AssertExtends<1, 1 | 2>>().toBe<1>().success\n * ```\n */\nexport type AssertExtends<T, U> = [T] extends [U] ? T : never\n\n/**\n * Safely picks keys `Key` from type `Obj`, excluding non-existent keys\n *\n * @template Obj - The object type to pick keys from\n * @template Key - The keys to pick from the object\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n *\n * type Result = SafePick<{ a: string; b: number }, 'a' | 'c'>\n * expect<Result>().toBe<{ a: string }>().success\n * ```\n */\nexport type SafePick<Obj, Key> = Pick<Obj, Key & keyof Obj>\n\n/**\n * Picks properties from `T` that have values of type `U`\n *\n * @template T - The object type to pick properties from\n * @template U - The value type to match against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing/test-utils'\n * type A = { a: string; b: number; c: string }\n * type Strings = PropsOfBaseType<A, string> // { a: string; c: string }\n * expect<PropsOfBaseType<A, string>>().toBe<{ a: string; c: string }>()\n * ```\n */\nexport type PropsOfBaseType<T, U> = Pick<T, KeysOfExactType<Required<T>, U>>\n"]}