@quantiya/codevibe-claude-plugin 2.0.26 → 2.0.27

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 (299) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/node_modules/@quantiya/codevibe-core/dist/__tests__/terminal-menu.test.d.ts +1 -0
  3. package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +2 -0
  4. package/node_modules/@quantiya/codevibe-core/dist/index.js +321 -317
  5. package/node_modules/@quantiya/codevibe-core/dist/prompt-parser.d.ts +3 -1
  6. package/node_modules/@quantiya/codevibe-core/dist/terminal-menu.d.ts +22 -0
  7. package/node_modules/@quantiya/codevibe-core/package.json +1 -1
  8. package/node_modules/es-toolkit/CHANGELOG.md +38 -3
  9. package/node_modules/es-toolkit/dist/browser.global.js +4 -4
  10. package/node_modules/es-toolkit/dist/compat/array/differenceWith.js +2 -1
  11. package/node_modules/es-toolkit/dist/compat/array/differenceWith.mjs +2 -1
  12. package/node_modules/es-toolkit/dist/compat/array/findLastIndex.js +5 -3
  13. package/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs +5 -3
  14. package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.js +1 -1
  15. package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.mjs +1 -1
  16. package/node_modules/es-toolkit/dist/compat/array/without.js +8 -2
  17. package/node_modules/es-toolkit/dist/compat/array/without.mjs +8 -2
  18. package/node_modules/es-toolkit/dist/compat/array/xorWith.js +4 -6
  19. package/node_modules/es-toolkit/dist/compat/array/xorWith.mjs +4 -6
  20. package/node_modules/es-toolkit/dist/compat/compat.js +1 -1
  21. package/node_modules/es-toolkit/dist/compat/compat.mjs +1 -1
  22. package/node_modules/es-toolkit/dist/compat/function/debounce.js +1 -1
  23. package/node_modules/es-toolkit/dist/compat/function/debounce.mjs +1 -1
  24. package/node_modules/es-toolkit/dist/compat/index.js +1 -1
  25. package/node_modules/es-toolkit/dist/compat/index.mjs +1 -1
  26. package/node_modules/es-toolkit/dist/compat/object/has.js +3 -2
  27. package/node_modules/es-toolkit/dist/compat/object/has.mjs +3 -2
  28. package/node_modules/es-toolkit/dist/compat/object/hasIn.js +3 -2
  29. package/node_modules/es-toolkit/dist/compat/object/hasIn.mjs +3 -2
  30. package/node_modules/es-toolkit/dist/compat/object/mergeWith.js +1 -1
  31. package/node_modules/es-toolkit/dist/compat/object/mergeWith.mjs +1 -1
  32. package/node_modules/es-toolkit/dist/compat/object/omitBy.js +1 -1
  33. package/node_modules/es-toolkit/dist/compat/object/omitBy.mjs +1 -1
  34. package/node_modules/es-toolkit/dist/compat/object/pickBy.js +1 -1
  35. package/node_modules/es-toolkit/dist/compat/object/pickBy.mjs +1 -1
  36. package/node_modules/es-toolkit/dist/compat/util/toString.js +3 -1
  37. package/node_modules/es-toolkit/dist/compat/util/toString.mjs +3 -1
  38. package/node_modules/es-toolkit/dist/fp/flowAsync.d.mts +213 -0
  39. package/node_modules/es-toolkit/dist/fp/flowAsync.d.ts +213 -0
  40. package/node_modules/es-toolkit/dist/fp/flowAsync.js +37 -0
  41. package/node_modules/es-toolkit/dist/fp/flowAsync.mjs +37 -0
  42. package/node_modules/es-toolkit/dist/fp/index.d.mts +2 -1
  43. package/node_modules/es-toolkit/dist/fp/index.d.ts +2 -1
  44. package/node_modules/es-toolkit/dist/fp/index.js +2 -0
  45. package/node_modules/es-toolkit/dist/fp/index.mjs +2 -1
  46. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.mts +23 -0
  47. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.ts +23 -0
  48. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.js +28 -0
  49. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.mjs +28 -0
  50. package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.mts +19 -0
  51. package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.ts +19 -0
  52. package/node_modules/es-toolkit/dist/fp/iterator/chunk.js +24 -0
  53. package/node_modules/es-toolkit/dist/fp/iterator/chunk.mjs +24 -0
  54. package/node_modules/es-toolkit/dist/fp/iterator/count.d.mts +20 -0
  55. package/node_modules/es-toolkit/dist/fp/iterator/count.d.ts +20 -0
  56. package/node_modules/es-toolkit/dist/fp/iterator/count.js +25 -0
  57. package/node_modules/es-toolkit/dist/fp/iterator/count.mjs +25 -0
  58. package/node_modules/es-toolkit/dist/fp/iterator/drop.d.mts +20 -0
  59. package/node_modules/es-toolkit/dist/fp/iterator/drop.d.ts +20 -0
  60. package/node_modules/es-toolkit/dist/fp/iterator/drop.js +24 -0
  61. package/node_modules/es-toolkit/dist/fp/iterator/drop.mjs +24 -0
  62. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.mts +18 -0
  63. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.ts +18 -0
  64. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.js +23 -0
  65. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.mjs +23 -0
  66. package/node_modules/es-toolkit/dist/fp/iterator/every.d.mts +20 -0
  67. package/node_modules/es-toolkit/dist/fp/iterator/every.d.ts +20 -0
  68. package/node_modules/es-toolkit/dist/fp/iterator/every.js +24 -0
  69. package/node_modules/es-toolkit/dist/fp/iterator/every.mjs +24 -0
  70. package/node_modules/es-toolkit/dist/fp/iterator/filter.d.mts +37 -0
  71. package/node_modules/es-toolkit/dist/fp/iterator/filter.d.ts +37 -0
  72. package/node_modules/es-toolkit/dist/fp/iterator/filter.js +8 -0
  73. package/node_modules/es-toolkit/dist/fp/iterator/filter.mjs +8 -0
  74. package/node_modules/es-toolkit/dist/fp/iterator/find.d.mts +20 -0
  75. package/node_modules/es-toolkit/dist/fp/iterator/find.d.ts +20 -0
  76. package/node_modules/es-toolkit/dist/fp/iterator/find.js +24 -0
  77. package/node_modules/es-toolkit/dist/fp/iterator/find.mjs +24 -0
  78. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.mts +20 -0
  79. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.ts +20 -0
  80. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.js +24 -0
  81. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.mjs +24 -0
  82. package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.mts +22 -0
  83. package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.ts +22 -0
  84. package/node_modules/es-toolkit/dist/fp/iterator/forEach.js +26 -0
  85. package/node_modules/es-toolkit/dist/fp/iterator/forEach.mjs +26 -0
  86. package/node_modules/es-toolkit/dist/fp/iterator/head.d.mts +19 -0
  87. package/node_modules/es-toolkit/dist/fp/iterator/head.d.ts +19 -0
  88. package/node_modules/es-toolkit/dist/fp/iterator/head.js +24 -0
  89. package/node_modules/es-toolkit/dist/fp/iterator/head.mjs +24 -0
  90. package/node_modules/es-toolkit/dist/fp/iterator/index.d.mts +22 -0
  91. package/node_modules/es-toolkit/dist/fp/iterator/index.d.ts +22 -0
  92. package/node_modules/es-toolkit/dist/fp/iterator/index.js +43 -0
  93. package/node_modules/es-toolkit/dist/fp/iterator/index.mjs +22 -0
  94. package/node_modules/es-toolkit/dist/fp/iterator/map.d.mts +20 -0
  95. package/node_modules/es-toolkit/dist/fp/iterator/map.d.ts +20 -0
  96. package/node_modules/es-toolkit/dist/fp/iterator/map.js +24 -0
  97. package/node_modules/es-toolkit/dist/fp/iterator/map.mjs +24 -0
  98. package/node_modules/es-toolkit/dist/fp/iterator/partition.d.mts +22 -0
  99. package/node_modules/es-toolkit/dist/fp/iterator/partition.d.ts +22 -0
  100. package/node_modules/es-toolkit/dist/fp/iterator/partition.js +27 -0
  101. package/node_modules/es-toolkit/dist/fp/iterator/partition.mjs +27 -0
  102. package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.mts +24 -0
  103. package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.ts +24 -0
  104. package/node_modules/es-toolkit/dist/fp/iterator/reduce.js +28 -0
  105. package/node_modules/es-toolkit/dist/fp/iterator/reduce.mjs +28 -0
  106. package/node_modules/es-toolkit/dist/fp/iterator/scan.d.mts +21 -0
  107. package/node_modules/es-toolkit/dist/fp/iterator/scan.d.ts +21 -0
  108. package/node_modules/es-toolkit/dist/fp/iterator/scan.js +26 -0
  109. package/node_modules/es-toolkit/dist/fp/iterator/scan.mjs +26 -0
  110. package/node_modules/es-toolkit/dist/fp/iterator/some.d.mts +20 -0
  111. package/node_modules/es-toolkit/dist/fp/iterator/some.d.ts +20 -0
  112. package/node_modules/es-toolkit/dist/fp/iterator/some.js +24 -0
  113. package/node_modules/es-toolkit/dist/fp/iterator/some.mjs +24 -0
  114. package/node_modules/es-toolkit/dist/fp/iterator/take.d.mts +21 -0
  115. package/node_modules/es-toolkit/dist/fp/iterator/take.d.ts +21 -0
  116. package/node_modules/es-toolkit/dist/fp/iterator/take.js +25 -0
  117. package/node_modules/es-toolkit/dist/fp/iterator/take.mjs +25 -0
  118. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.mts +19 -0
  119. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.ts +19 -0
  120. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.js +24 -0
  121. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.mjs +24 -0
  122. package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.mts +21 -0
  123. package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.ts +21 -0
  124. package/node_modules/es-toolkit/dist/fp/iterator/toArray.js +25 -0
  125. package/node_modules/es-toolkit/dist/fp/iterator/toArray.mjs +25 -0
  126. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.mts +20 -0
  127. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.ts +20 -0
  128. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.js +25 -0
  129. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.mjs +25 -0
  130. package/node_modules/es-toolkit/dist/fp/iterator/zip.d.mts +20 -0
  131. package/node_modules/es-toolkit/dist/fp/iterator/zip.d.ts +20 -0
  132. package/node_modules/es-toolkit/dist/fp/iterator/zip.js +25 -0
  133. package/node_modules/es-toolkit/dist/fp/iterator/zip.mjs +25 -0
  134. package/node_modules/es-toolkit/dist/index.d.mts +3 -1
  135. package/node_modules/es-toolkit/dist/index.d.ts +3 -1
  136. package/node_modules/es-toolkit/dist/index.js +4 -0
  137. package/node_modules/es-toolkit/dist/index.mjs +3 -1
  138. package/node_modules/es-toolkit/dist/iterator/_internal/iterator.js +74 -0
  139. package/node_modules/es-toolkit/dist/iterator/_internal/iterator.mjs +74 -0
  140. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.mts +33 -0
  141. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.ts +33 -0
  142. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.js +95 -0
  143. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.mjs +95 -0
  144. package/node_modules/es-toolkit/dist/iterator/chunk.d.mts +21 -0
  145. package/node_modules/es-toolkit/dist/iterator/chunk.d.ts +21 -0
  146. package/node_modules/es-toolkit/dist/iterator/chunk.js +40 -0
  147. package/node_modules/es-toolkit/dist/iterator/chunk.mjs +40 -0
  148. package/node_modules/es-toolkit/dist/iterator/count.d.mts +18 -0
  149. package/node_modules/es-toolkit/dist/iterator/count.d.ts +18 -0
  150. package/node_modules/es-toolkit/dist/iterator/count.js +26 -0
  151. package/node_modules/es-toolkit/dist/iterator/count.mjs +26 -0
  152. package/node_modules/es-toolkit/dist/iterator/dropWhile.d.mts +20 -0
  153. package/node_modules/es-toolkit/dist/iterator/dropWhile.d.ts +20 -0
  154. package/node_modules/es-toolkit/dist/iterator/dropWhile.js +52 -0
  155. package/node_modules/es-toolkit/dist/iterator/dropWhile.mjs +52 -0
  156. package/node_modules/es-toolkit/dist/iterator/head.d.mts +21 -0
  157. package/node_modules/es-toolkit/dist/iterator/head.d.ts +21 -0
  158. package/node_modules/es-toolkit/dist/iterator/head.js +26 -0
  159. package/node_modules/es-toolkit/dist/iterator/head.mjs +26 -0
  160. package/node_modules/es-toolkit/dist/iterator/index.d.mts +13 -0
  161. package/node_modules/es-toolkit/dist/iterator/index.d.ts +13 -0
  162. package/node_modules/es-toolkit/dist/iterator/index.js +25 -0
  163. package/node_modules/es-toolkit/dist/iterator/index.mjs +13 -0
  164. package/node_modules/es-toolkit/dist/iterator/iterate.d.mts +20 -0
  165. package/node_modules/es-toolkit/dist/iterator/iterate.d.ts +20 -0
  166. package/node_modules/es-toolkit/dist/iterator/iterate.js +32 -0
  167. package/node_modules/es-toolkit/dist/iterator/iterate.mjs +32 -0
  168. package/node_modules/es-toolkit/dist/iterator/partition.d.mts +18 -0
  169. package/node_modules/es-toolkit/dist/iterator/partition.d.ts +18 -0
  170. package/node_modules/es-toolkit/dist/iterator/partition.js +36 -0
  171. package/node_modules/es-toolkit/dist/iterator/partition.mjs +36 -0
  172. package/node_modules/es-toolkit/dist/iterator/range.d.mts +42 -0
  173. package/node_modules/es-toolkit/dist/iterator/range.d.ts +42 -0
  174. package/node_modules/es-toolkit/dist/iterator/range.js +25 -0
  175. package/node_modules/es-toolkit/dist/iterator/range.mjs +25 -0
  176. package/node_modules/es-toolkit/dist/iterator/scan.d.mts +23 -0
  177. package/node_modules/es-toolkit/dist/iterator/scan.d.ts +23 -0
  178. package/node_modules/es-toolkit/dist/iterator/scan.js +47 -0
  179. package/node_modules/es-toolkit/dist/iterator/scan.mjs +47 -0
  180. package/node_modules/es-toolkit/dist/iterator/takeWhile.d.mts +20 -0
  181. package/node_modules/es-toolkit/dist/iterator/takeWhile.d.ts +20 -0
  182. package/node_modules/es-toolkit/dist/iterator/takeWhile.js +34 -0
  183. package/node_modules/es-toolkit/dist/iterator/takeWhile.mjs +34 -0
  184. package/node_modules/es-toolkit/dist/iterator/uniqBy.d.mts +22 -0
  185. package/node_modules/es-toolkit/dist/iterator/uniqBy.d.ts +22 -0
  186. package/node_modules/es-toolkit/dist/iterator/uniqBy.js +43 -0
  187. package/node_modules/es-toolkit/dist/iterator/uniqBy.mjs +43 -0
  188. package/node_modules/es-toolkit/dist/iterator/zip.d.mts +23 -0
  189. package/node_modules/es-toolkit/dist/iterator/zip.d.ts +23 -0
  190. package/node_modules/es-toolkit/dist/iterator/zip.js +45 -0
  191. package/node_modules/es-toolkit/dist/iterator/zip.mjs +45 -0
  192. package/node_modules/es-toolkit/dist/object/merge.d.mts +3 -1
  193. package/node_modules/es-toolkit/dist/object/merge.d.ts +3 -1
  194. package/node_modules/es-toolkit/dist/object/merge.js +0 -40
  195. package/node_modules/es-toolkit/dist/object/merge.mjs +0 -40
  196. package/node_modules/es-toolkit/dist/object/omitBy.d.mts +4 -2
  197. package/node_modules/es-toolkit/dist/object/omitBy.d.ts +4 -2
  198. package/node_modules/es-toolkit/dist/object/omitBy.js +4 -3
  199. package/node_modules/es-toolkit/dist/object/omitBy.mjs +4 -3
  200. package/node_modules/es-toolkit/dist/object/pickBy.d.mts +4 -2
  201. package/node_modules/es-toolkit/dist/object/pickBy.d.ts +4 -2
  202. package/node_modules/es-toolkit/dist/object/pickBy.js +4 -3
  203. package/node_modules/es-toolkit/dist/object/pickBy.mjs +4 -3
  204. package/node_modules/es-toolkit/dist/types/EmptyObject.d.mts +21 -0
  205. package/node_modules/es-toolkit/dist/types/EmptyObject.d.ts +21 -0
  206. package/node_modules/es-toolkit/dist/types/IsEqual.d.mts +18 -0
  207. package/node_modules/es-toolkit/dist/types/IsEqual.d.ts +18 -0
  208. package/node_modules/es-toolkit/dist/types/JSONValue.d.mts +24 -0
  209. package/node_modules/es-toolkit/dist/types/JSONValue.d.ts +24 -0
  210. package/node_modules/es-toolkit/dist/types/Merge.d.mts +37 -0
  211. package/node_modules/es-toolkit/dist/types/Merge.d.ts +37 -0
  212. package/node_modules/es-toolkit/dist/types/ObjectKeys.d.mts +19 -0
  213. package/node_modules/es-toolkit/dist/types/ObjectKeys.d.ts +19 -0
  214. package/node_modules/es-toolkit/dist/types/Primitive.d.mts +14 -0
  215. package/node_modules/es-toolkit/dist/types/Primitive.d.ts +14 -0
  216. package/node_modules/es-toolkit/dist/types/SetOptional.d.mts +20 -0
  217. package/node_modules/es-toolkit/dist/types/SetOptional.d.ts +20 -0
  218. package/node_modules/es-toolkit/dist/types/SetRequired.d.mts +20 -0
  219. package/node_modules/es-toolkit/dist/types/SetRequired.d.ts +20 -0
  220. package/node_modules/es-toolkit/dist/types/UnknownRecord.d.mts +24 -0
  221. package/node_modules/es-toolkit/dist/types/UnknownRecord.d.ts +24 -0
  222. package/node_modules/es-toolkit/dist/types/index.d.mts +11 -2
  223. package/node_modules/es-toolkit/dist/types/index.d.ts +11 -2
  224. package/node_modules/es-toolkit/dist/util/attempt.d.mts +1 -1
  225. package/node_modules/es-toolkit/dist/util/attempt.d.ts +1 -1
  226. package/node_modules/es-toolkit/dist/util/attemptAsync.d.mts +1 -1
  227. package/node_modules/es-toolkit/dist/util/attemptAsync.d.ts +1 -1
  228. package/node_modules/es-toolkit/dist/util/defer.d.mts +27 -0
  229. package/node_modules/es-toolkit/dist/util/defer.d.ts +27 -0
  230. package/node_modules/es-toolkit/dist/util/defer.js +31 -0
  231. package/node_modules/es-toolkit/dist/util/defer.mjs +31 -0
  232. package/node_modules/es-toolkit/dist/util/deferAsync.d.mts +30 -0
  233. package/node_modules/es-toolkit/dist/util/deferAsync.d.ts +30 -0
  234. package/node_modules/es-toolkit/dist/util/deferAsync.js +34 -0
  235. package/node_modules/es-toolkit/dist/util/deferAsync.mjs +34 -0
  236. package/node_modules/es-toolkit/dist/util/index.d.mts +3 -1
  237. package/node_modules/es-toolkit/dist/util/index.d.ts +3 -1
  238. package/node_modules/es-toolkit/dist/util/index.js +4 -0
  239. package/node_modules/es-toolkit/dist/util/index.mjs +3 -1
  240. package/node_modules/es-toolkit/fp/iterator.d.ts +1 -0
  241. package/node_modules/es-toolkit/fp/iterator.js +1 -0
  242. package/node_modules/es-toolkit/iterator.d.ts +1 -0
  243. package/node_modules/es-toolkit/iterator.js +1 -0
  244. package/node_modules/es-toolkit/package.json +44 -1
  245. package/node_modules/node-abi/abi_registry.json +7 -0
  246. package/node_modules/node-abi/package.json +1 -1
  247. package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  248. package/node_modules/qs/CHANGELOG.md +15 -0
  249. package/node_modules/qs/README.md +19 -1
  250. package/node_modules/qs/dist/qs.js +21 -21
  251. package/node_modules/qs/eslint.config.mjs +1 -1
  252. package/node_modules/qs/lib/parse.js +3 -4
  253. package/node_modules/qs/lib/stringify.js +23 -8
  254. package/node_modules/qs/lib/utils.js +10 -3
  255. package/node_modules/qs/package.json +4 -4
  256. package/node_modules/qs/test/parse.js +192 -3
  257. package/node_modules/qs/test/stringify.js +317 -0
  258. package/node_modules/qs/test/utils.js +12 -0
  259. package/node_modules/type-fest/index.d.ts +6 -7
  260. package/node_modules/type-fest/package.json +1 -1
  261. package/node_modules/type-fest/readme.md +6 -5
  262. package/node_modules/type-fest/source/delimiter-case.d.ts +1 -1
  263. package/node_modules/type-fest/source/get.d.ts +1 -1
  264. package/node_modules/type-fest/source/internal/object.d.ts +30 -1
  265. package/node_modules/type-fest/source/is-boolean-literal.d.ts +39 -0
  266. package/node_modules/type-fest/source/is-literal.d.ts +43 -269
  267. package/node_modules/type-fest/source/is-numeric-literal.d.ts +50 -0
  268. package/node_modules/type-fest/source/is-string-literal.d.ts +72 -0
  269. package/node_modules/type-fest/source/is-symbol-literal.d.ts +39 -0
  270. package/node_modules/type-fest/source/jsonify.d.ts +1 -5
  271. package/node_modules/type-fest/source/remove-prefix.d.ts +1 -1
  272. package/node_modules/type-fest/source/remove-suffix.d.ts +1 -1
  273. package/node_modules/type-fest/source/rename-keys.d.ts +163 -0
  274. package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +4 -3
  275. package/node_modules/type-fest/source/split.d.ts +1 -1
  276. package/node_modules/type-fest/source/string-repeat.d.ts +1 -1
  277. package/node_modules/type-fest/source/string-to-array.d.ts +1 -1
  278. package/node_modules/type-fest/source/tsconfig-json.d.ts +1 -1
  279. package/node_modules/type-fest/source/typed-array.d.ts +1 -0
  280. package/node_modules/type-fest/source/writable.d.ts +2 -2
  281. package/package.json +2 -2
  282. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/LICENSE.md +0 -0
  283. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/README.md +0 -0
  284. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/common.gypi +0 -0
  285. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/except.gypi +0 -0
  286. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/index.js +0 -0
  287. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi-inl.deprecated.h +0 -0
  288. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi-inl.h +0 -0
  289. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi.h +0 -0
  290. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/node_api.gyp +0 -0
  291. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/noexcept.gypi +0 -0
  292. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/nothing.c +0 -0
  293. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/package-support.json +0 -0
  294. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/package.json +0 -0
  295. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/README.md +0 -0
  296. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/check-napi.js +0 -0
  297. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/clang-format.js +0 -0
  298. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/conversion.js +0 -0
  299. /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/eslint-format.js +0 -0
@@ -2,46 +2,6 @@ import { isPlainObject } from "../predicate/isPlainObject.mjs";
2
2
  import { isMergeableValue } from "../_internal/isMergeableValue.mjs";
3
3
  import { isUnsafeProperty } from "../_internal/isUnsafeProperty.mjs";
4
4
  //#region src/object/merge.ts
5
- /**
6
- * Merges the properties of the source object into the target object.
7
- *
8
- * This function performs a deep merge, meaning nested objects and arrays are merged recursively.
9
- * If a property in the source object is an array or an object and the corresponding property in the target object is also an array or object, they will be merged.
10
- * If a property in the source object is undefined, it will not overwrite a defined property in the target object.
11
- *
12
- * Note that this function mutates the target object.
13
- *
14
- * @param target - The target object into which the source object properties will be merged. This object is modified in place.
15
- * @param source - The source object whose properties will be merged into the target object.
16
- * @returns The updated target object with properties from the source object merged in.
17
- *
18
- * @template T - Type of the target object.
19
- * @template S - Type of the source object.
20
- *
21
- * @example
22
- * const target = { a: 1, b: { x: 1, y: 2 } };
23
- * const source = { b: { y: 3, z: 4 }, c: 5 };
24
- *
25
- * const result = merge(target, source);
26
- * console.log(result);
27
- * // Output: { a: 1, b: { x: 1, y: 3, z: 4 }, c: 5 }
28
- *
29
- * @example
30
- * const target = { a: [1, 2], b: { x: 1 } };
31
- * const source = { a: [3], b: { y: 2 } };
32
- *
33
- * const result = merge(target, source);
34
- * console.log(result);
35
- * // Output: { a: [3, 2], b: { x: 1, y: 2 } }
36
- *
37
- * @example
38
- * const target = { a: null };
39
- * const source = { a: [1, 2, 3] };
40
- *
41
- * const result = merge(target, source);
42
- * console.log(result);
43
- * // Output: { a: [1, 2, 3] }
44
- */
45
5
  function merge(target, source) {
46
6
  const sourceKeys = Object.keys(source);
47
7
  for (let i = 0; i < sourceKeys.length; i++) {
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.mjs";
2
+
1
3
  //#region src/object/omitBy.d.ts
2
4
  /**
3
5
  * Creates a new object composed of the properties that do not satisfy the predicate function.
@@ -9,7 +11,7 @@
9
11
  * @param obj - The object to omit properties from.
10
12
  * @param shouldOmit - A predicate function that determines
11
13
  * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be omitted, and `false` otherwise.
14
+ * if the property should be omitted, and `false` otherwise. Numeric keys are passed as strings.
13
15
  * @returns A new object with the properties that do not satisfy the predicate function.
14
16
  *
15
17
  * @example
@@ -18,6 +20,6 @@
18
20
  * const result = omitBy(obj, shouldOmit);
19
21
  * // result will be { a: 1, c: 3 }
20
22
  */
21
- declare function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: keyof T) => boolean): Partial<T>;
23
+ declare function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: ObjectKeys<T>) => boolean): Partial<T>;
22
24
  //#endregion
23
25
  export { omitBy };
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.js";
2
+
1
3
  //#region src/object/omitBy.d.ts
2
4
  /**
3
5
  * Creates a new object composed of the properties that do not satisfy the predicate function.
@@ -9,7 +11,7 @@
9
11
  * @param obj - The object to omit properties from.
10
12
  * @param shouldOmit - A predicate function that determines
11
13
  * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be omitted, and `false` otherwise.
14
+ * if the property should be omitted, and `false` otherwise. Numeric keys are passed as strings.
13
15
  * @returns A new object with the properties that do not satisfy the predicate function.
14
16
  *
15
17
  * @example
@@ -18,6 +20,6 @@
18
20
  * const result = omitBy(obj, shouldOmit);
19
21
  * // result will be { a: 1, c: 3 }
20
22
  */
21
- declare function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: keyof T) => boolean): Partial<T>;
23
+ declare function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: ObjectKeys<T>) => boolean): Partial<T>;
22
24
  //#endregion
23
25
  export { omitBy };
@@ -9,7 +9,7 @@
9
9
  * @param obj - The object to omit properties from.
10
10
  * @param shouldOmit - A predicate function that determines
11
11
  * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be omitted, and `false` otherwise.
12
+ * if the property should be omitted, and `false` otherwise. Numeric keys are passed as strings.
13
13
  * @returns A new object with the properties that do not satisfy the predicate function.
14
14
  *
15
15
  * @example
@@ -23,8 +23,9 @@ function omitBy(obj, shouldOmit) {
23
23
  const keys = Object.keys(obj);
24
24
  for (let i = 0; i < keys.length; i++) {
25
25
  const key = keys[i];
26
- const value = obj[key];
27
- if (!shouldOmit(value, key)) result[key] = value;
26
+ const objectKey = key;
27
+ const value = obj[objectKey];
28
+ if (!shouldOmit(value, key)) result[objectKey] = value;
28
29
  }
29
30
  return result;
30
31
  }
@@ -9,7 +9,7 @@
9
9
  * @param obj - The object to omit properties from.
10
10
  * @param shouldOmit - A predicate function that determines
11
11
  * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be omitted, and `false` otherwise.
12
+ * if the property should be omitted, and `false` otherwise. Numeric keys are passed as strings.
13
13
  * @returns A new object with the properties that do not satisfy the predicate function.
14
14
  *
15
15
  * @example
@@ -23,8 +23,9 @@ function omitBy(obj, shouldOmit) {
23
23
  const keys = Object.keys(obj);
24
24
  for (let i = 0; i < keys.length; i++) {
25
25
  const key = keys[i];
26
- const value = obj[key];
27
- if (!shouldOmit(value, key)) result[key] = value;
26
+ const objectKey = key;
27
+ const value = obj[objectKey];
28
+ if (!shouldOmit(value, key)) result[objectKey] = value;
28
29
  }
29
30
  return result;
30
31
  }
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.mjs";
2
+
1
3
  //#region src/object/pickBy.d.ts
2
4
  /**
3
5
  * Creates a new object composed of the properties that satisfy the predicate function.
@@ -9,7 +11,7 @@
9
11
  * @param obj - The object to pick properties from.
10
12
  * @param shouldPick - A predicate function that determines
11
13
  * whether a property should be picked. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be picked, and `false` otherwise.
14
+ * if the property should be picked, and `false` otherwise. Numeric keys are passed as strings.
13
15
  * @returns A new object with the properties that satisfy the predicate function.
14
16
  *
15
17
  * @example
@@ -18,6 +20,6 @@
18
20
  * const result = pickBy(obj, shouldPick);
19
21
  * // result will be { b: 'pick' }
20
22
  */
21
- declare function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: keyof T) => boolean): Partial<T>;
23
+ declare function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: ObjectKeys<T>) => boolean): Partial<T>;
22
24
  //#endregion
23
25
  export { pickBy };
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.js";
2
+
1
3
  //#region src/object/pickBy.d.ts
2
4
  /**
3
5
  * Creates a new object composed of the properties that satisfy the predicate function.
@@ -9,7 +11,7 @@
9
11
  * @param obj - The object to pick properties from.
10
12
  * @param shouldPick - A predicate function that determines
11
13
  * whether a property should be picked. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be picked, and `false` otherwise.
14
+ * if the property should be picked, and `false` otherwise. Numeric keys are passed as strings.
13
15
  * @returns A new object with the properties that satisfy the predicate function.
14
16
  *
15
17
  * @example
@@ -18,6 +20,6 @@
18
20
  * const result = pickBy(obj, shouldPick);
19
21
  * // result will be { b: 'pick' }
20
22
  */
21
- declare function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: keyof T) => boolean): Partial<T>;
23
+ declare function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: ObjectKeys<T>) => boolean): Partial<T>;
22
24
  //#endregion
23
25
  export { pickBy };
@@ -9,7 +9,7 @@
9
9
  * @param obj - The object to pick properties from.
10
10
  * @param shouldPick - A predicate function that determines
11
11
  * whether a property should be picked. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be picked, and `false` otherwise.
12
+ * if the property should be picked, and `false` otherwise. Numeric keys are passed as strings.
13
13
  * @returns A new object with the properties that satisfy the predicate function.
14
14
  *
15
15
  * @example
@@ -23,8 +23,9 @@ function pickBy(obj, shouldPick) {
23
23
  const keys = Object.keys(obj);
24
24
  for (let i = 0; i < keys.length; i++) {
25
25
  const key = keys[i];
26
- const value = obj[key];
27
- if (shouldPick(value, key)) result[key] = value;
26
+ const objectKey = key;
27
+ const value = obj[objectKey];
28
+ if (shouldPick(value, key)) result[objectKey] = value;
28
29
  }
29
30
  return result;
30
31
  }
@@ -9,7 +9,7 @@
9
9
  * @param obj - The object to pick properties from.
10
10
  * @param shouldPick - A predicate function that determines
11
11
  * whether a property should be picked. It takes the property's key and value as arguments and returns `true`
12
- * if the property should be picked, and `false` otherwise.
12
+ * if the property should be picked, and `false` otherwise. Numeric keys are passed as strings.
13
13
  * @returns A new object with the properties that satisfy the predicate function.
14
14
  *
15
15
  * @example
@@ -23,8 +23,9 @@ function pickBy(obj, shouldPick) {
23
23
  const keys = Object.keys(obj);
24
24
  for (let i = 0; i < keys.length; i++) {
25
25
  const key = keys[i];
26
- const value = obj[key];
27
- if (shouldPick(value, key)) result[key] = value;
26
+ const objectKey = key;
27
+ const value = obj[objectKey];
28
+ if (shouldPick(value, key)) result[objectKey] = value;
28
29
  }
29
30
  return result;
30
31
  }
@@ -0,0 +1,21 @@
1
+ //#region src/types/EmptyObject.d.ts
2
+ /**
3
+ * An object with no properties.
4
+ *
5
+ * Pairs with the `isEmptyObject` guard. Assigning an object that has any property
6
+ * fails, because every value would have to be `never`.
7
+ *
8
+ * @example
9
+ * const a: EmptyObject = {}; // ok
10
+ * const b: EmptyObject = { a: 1 }; // error
11
+ *
12
+ * @example
13
+ * // Useful for a step that carries no data.
14
+ * interface StepContext {
15
+ * intro: EmptyObject;
16
+ * form: { amount: number };
17
+ * }
18
+ */
19
+ type EmptyObject = Record<PropertyKey, never>;
20
+ //#endregion
21
+ export { EmptyObject };
@@ -0,0 +1,21 @@
1
+ //#region src/types/EmptyObject.d.ts
2
+ /**
3
+ * An object with no properties.
4
+ *
5
+ * Pairs with the `isEmptyObject` guard. Assigning an object that has any property
6
+ * fails, because every value would have to be `never`.
7
+ *
8
+ * @example
9
+ * const a: EmptyObject = {}; // ok
10
+ * const b: EmptyObject = { a: 1 }; // error
11
+ *
12
+ * @example
13
+ * // Useful for a step that carries no data.
14
+ * interface StepContext {
15
+ * intro: EmptyObject;
16
+ * form: { amount: number };
17
+ * }
18
+ */
19
+ type EmptyObject = Record<PropertyKey, never>;
20
+ //#endregion
21
+ export { EmptyObject };
@@ -0,0 +1,18 @@
1
+ //#region src/types/IsEqual.d.ts
2
+ /**
3
+ * Resolves to `true` when `A` and `B` are exactly the same type, `false` otherwise.
4
+ *
5
+ * Unlike a plain conditional type, this tells `any` apart from every other type,
6
+ * which makes it useful for catching an accidental `any` in type-level tests.
7
+ *
8
+ * @template A - The first type to compare.
9
+ * @template B - The second type to compare.
10
+ *
11
+ * @example
12
+ * type A = IsEqual<{ a: string }, { a: string }>; // true
13
+ * type B = IsEqual<string, 'literal'>; // false
14
+ * type C = IsEqual<unknown, any>; // false
15
+ */
16
+ type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends (<G>() => G extends B ? 1 : 2) ? true : false;
17
+ //#endregion
18
+ export { IsEqual };
@@ -0,0 +1,18 @@
1
+ //#region src/types/IsEqual.d.ts
2
+ /**
3
+ * Resolves to `true` when `A` and `B` are exactly the same type, `false` otherwise.
4
+ *
5
+ * Unlike a plain conditional type, this tells `any` apart from every other type,
6
+ * which makes it useful for catching an accidental `any` in type-level tests.
7
+ *
8
+ * @template A - The first type to compare.
9
+ * @template B - The second type to compare.
10
+ *
11
+ * @example
12
+ * type A = IsEqual<{ a: string }, { a: string }>; // true
13
+ * type B = IsEqual<string, 'literal'>; // false
14
+ * type C = IsEqual<unknown, any>; // false
15
+ */
16
+ type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends (<G>() => G extends B ? 1 : 2) ? true : false;
17
+ //#endregion
18
+ export { IsEqual };
@@ -0,0 +1,24 @@
1
+ //#region src/types/JSONValue.d.ts
2
+ /**
3
+ * Any value that `JSON.parse` can produce.
4
+ *
5
+ * Functions, `Date`, `undefined`, and class instances are excluded, because they
6
+ * do not survive a JSON round trip.
7
+ *
8
+ * @example
9
+ * declare function parse(text: string): JSONValue;
10
+ *
11
+ * const value = parse('{"a":[1,null]}');
12
+ * if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
13
+ * const a = value.a; // JSONValue
14
+ * }
15
+ *
16
+ * @example
17
+ * // Use `Record` when you want to accept a JSON object specifically.
18
+ * declare function send(body: Record<string, JSONValue>): void;
19
+ */
20
+ type JSONValue = string | number | boolean | null | JSONValue[] | {
21
+ [key: string]: JSONValue;
22
+ };
23
+ //#endregion
24
+ export { JSONValue };
@@ -0,0 +1,24 @@
1
+ //#region src/types/JSONValue.d.ts
2
+ /**
3
+ * Any value that `JSON.parse` can produce.
4
+ *
5
+ * Functions, `Date`, `undefined`, and class instances are excluded, because they
6
+ * do not survive a JSON round trip.
7
+ *
8
+ * @example
9
+ * declare function parse(text: string): JSONValue;
10
+ *
11
+ * const value = parse('{"a":[1,null]}');
12
+ * if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
13
+ * const a = value.a; // JSONValue
14
+ * }
15
+ *
16
+ * @example
17
+ * // Use `Record` when you want to accept a JSON object specifically.
18
+ * declare function send(body: Record<string, JSONValue>): void;
19
+ */
20
+ type JSONValue = string | number | boolean | null | JSONValue[] | {
21
+ [key: string]: JSONValue;
22
+ };
23
+ //#endregion
24
+ export { JSONValue };
@@ -0,0 +1,37 @@
1
+ import { Simplify } from "./Simplify.mjs";
2
+
3
+ //#region src/types/Merge.d.ts
4
+ /**
5
+ * The result of deeply merging the source type `S` into the target type `T`,
6
+ * matching what `merge(target, source)` returns at runtime.
7
+ *
8
+ * Keys present on only one side are kept as-is. When both sides have a plain
9
+ * object at the same key, the merge recurses; tuples merge index by index, and
10
+ * other arrays merge into an array of both element types. If the source value
11
+ * can be `undefined`, the target type is kept because `merge` skips
12
+ * `undefined` source values. Values that are not plain objects or arrays
13
+ * (functions, `Date`, `RegExp`, `Map`, `Set`, etc.) are not merged into;
14
+ * the source value replaces the target value. When an array meets a plain
15
+ * object, `merge` keeps the target and assigns the source's properties onto
16
+ * it, so both property sets are kept (`T & S`).
17
+ *
18
+ * @template T - Type of the target object.
19
+ * @template S - Type of the source object.
20
+ *
21
+ * @example
22
+ * type Target = { a: number; b: { x: number; y: number } };
23
+ * type Source = { b: { y: string; z: boolean }; c: string };
24
+ * type Result = Merge<Target, Source>;
25
+ * // => { a: number; b: { x: number; y: string; z: boolean }; c: string }
26
+ */
27
+ type Merge<T, S> = undefined extends S ? T | MergeDefined<T, Exclude<S, undefined>> : MergeDefined<T, S>;
28
+ /**
29
+ * Values `merge` does not merge into: everything that is not a plain object
30
+ * or an array. The source value replaces the target value instead.
31
+ */
32
+ type NonMergeable = ((...args: any[]) => unknown) | Date | RegExp | Error | Promise<unknown> | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown> | WeakMap<object, unknown> | WeakSet<object>;
33
+ type MergeDefined<T, S> = S extends readonly unknown[] ? (T extends readonly unknown[] ? MergeArrays<T, S> : T extends NonMergeable ? S : T extends object ? T & S : S) : S extends NonMergeable ? S : S extends object ? (T extends readonly unknown[] ? T & S : T extends NonMergeable ? S : T extends object ? MergeRecords<T, S> : S) : S;
34
+ type MergeArrays<T extends readonly unknown[], S extends readonly unknown[]> = T extends readonly [] ? S : S extends readonly [] ? T : T extends readonly [infer TH, ...infer TR] ? S extends readonly [infer SH, ...infer SR] ? [Merge<TH, SH>, ...MergeArrays<TR, SR>] : Array<T[number] | S[number]> : Array<T[number] | S[number]>;
35
+ type MergeRecords<T extends object, S extends object> = Simplify<Omit<T, keyof S> & Omit<S, keyof T> & { [K in keyof T & keyof S]: Merge<T[K], S[K]> }>;
36
+ //#endregion
37
+ export { Merge };
@@ -0,0 +1,37 @@
1
+ import { Simplify } from "./Simplify.js";
2
+
3
+ //#region src/types/Merge.d.ts
4
+ /**
5
+ * The result of deeply merging the source type `S` into the target type `T`,
6
+ * matching what `merge(target, source)` returns at runtime.
7
+ *
8
+ * Keys present on only one side are kept as-is. When both sides have a plain
9
+ * object at the same key, the merge recurses; tuples merge index by index, and
10
+ * other arrays merge into an array of both element types. If the source value
11
+ * can be `undefined`, the target type is kept because `merge` skips
12
+ * `undefined` source values. Values that are not plain objects or arrays
13
+ * (functions, `Date`, `RegExp`, `Map`, `Set`, etc.) are not merged into;
14
+ * the source value replaces the target value. When an array meets a plain
15
+ * object, `merge` keeps the target and assigns the source's properties onto
16
+ * it, so both property sets are kept (`T & S`).
17
+ *
18
+ * @template T - Type of the target object.
19
+ * @template S - Type of the source object.
20
+ *
21
+ * @example
22
+ * type Target = { a: number; b: { x: number; y: number } };
23
+ * type Source = { b: { y: string; z: boolean }; c: string };
24
+ * type Result = Merge<Target, Source>;
25
+ * // => { a: number; b: { x: number; y: string; z: boolean }; c: string }
26
+ */
27
+ type Merge<T, S> = undefined extends S ? T | MergeDefined<T, Exclude<S, undefined>> : MergeDefined<T, S>;
28
+ /**
29
+ * Values `merge` does not merge into: everything that is not a plain object
30
+ * or an array. The source value replaces the target value instead.
31
+ */
32
+ type NonMergeable = ((...args: any[]) => unknown) | Date | RegExp | Error | Promise<unknown> | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown> | WeakMap<object, unknown> | WeakSet<object>;
33
+ type MergeDefined<T, S> = S extends readonly unknown[] ? (T extends readonly unknown[] ? MergeArrays<T, S> : T extends NonMergeable ? S : T extends object ? T & S : S) : S extends NonMergeable ? S : S extends object ? (T extends readonly unknown[] ? T & S : T extends NonMergeable ? S : T extends object ? MergeRecords<T, S> : S) : S;
34
+ type MergeArrays<T extends readonly unknown[], S extends readonly unknown[]> = T extends readonly [] ? S : S extends readonly [] ? T : T extends readonly [infer TH, ...infer TR] ? S extends readonly [infer SH, ...infer SR] ? [Merge<TH, SH>, ...MergeArrays<TR, SR>] : Array<T[number] | S[number]> : Array<T[number] | S[number]>;
35
+ type MergeRecords<T extends object, S extends object> = Simplify<Omit<T, keyof S> & Omit<S, keyof T> & { [K in keyof T & keyof S]: Merge<T[K], S[K]> }>;
36
+ //#endregion
37
+ export { Merge };
@@ -0,0 +1,19 @@
1
+ //#region src/types/ObjectKeys.d.ts
2
+ /**
3
+ * Creates a union of the keys of `T` as they are returned by `Object.keys`:
4
+ * numeric keys are converted to strings and symbol keys are excluded. The key-side
5
+ * counterpart to `ValueOf`.
6
+ *
7
+ * @template T - The object type to read keys from.
8
+ *
9
+ * @example
10
+ * type Keys = ObjectKeys<{ a: number; 1: string }>;
11
+ * // => 'a' | '1'
12
+ *
13
+ * const obj = { a: 1, b: 2 };
14
+ * const keys = Object.keys(obj) as Array<ObjectKeys<typeof obj>>;
15
+ * // => Array<'a' | 'b'>
16
+ */
17
+ type ObjectKeys<T> = `${Exclude<keyof T, symbol>}`;
18
+ //#endregion
19
+ export { ObjectKeys };
@@ -0,0 +1,19 @@
1
+ //#region src/types/ObjectKeys.d.ts
2
+ /**
3
+ * Creates a union of the keys of `T` as they are returned by `Object.keys`:
4
+ * numeric keys are converted to strings and symbol keys are excluded. The key-side
5
+ * counterpart to `ValueOf`.
6
+ *
7
+ * @template T - The object type to read keys from.
8
+ *
9
+ * @example
10
+ * type Keys = ObjectKeys<{ a: number; 1: string }>;
11
+ * // => 'a' | '1'
12
+ *
13
+ * const obj = { a: 1, b: 2 };
14
+ * const keys = Object.keys(obj) as Array<ObjectKeys<typeof obj>>;
15
+ * // => Array<'a' | 'b'>
16
+ */
17
+ type ObjectKeys<T> = `${Exclude<keyof T, symbol>}`;
18
+ //#endregion
19
+ export { ObjectKeys };
@@ -0,0 +1,14 @@
1
+ //#region src/types/Primitive.d.ts
2
+ /**
3
+ * Every primitive value in JavaScript. Anything that is not a primitive is an object.
4
+ *
5
+ * Writing this union by hand usually misses `bigint` or `symbol`.
6
+ *
7
+ * @example
8
+ * function isPrimitive(value: unknown): value is Primitive {
9
+ * return value === null || (typeof value !== 'object' && typeof value !== 'function');
10
+ * }
11
+ */
12
+ type Primitive = string | number | bigint | boolean | symbol | null | undefined;
13
+ //#endregion
14
+ export { Primitive };
@@ -0,0 +1,14 @@
1
+ //#region src/types/Primitive.d.ts
2
+ /**
3
+ * Every primitive value in JavaScript. Anything that is not a primitive is an object.
4
+ *
5
+ * Writing this union by hand usually misses `bigint` or `symbol`.
6
+ *
7
+ * @example
8
+ * function isPrimitive(value: unknown): value is Primitive {
9
+ * return value === null || (typeof value !== 'object' && typeof value !== 'function');
10
+ * }
11
+ */
12
+ type Primitive = string | number | bigint | boolean | symbol | null | undefined;
13
+ //#endregion
14
+ export { Primitive };
@@ -0,0 +1,20 @@
1
+ import { Simplify } from "./Simplify.mjs";
2
+
3
+ //#region src/types/SetOptional.d.ts
4
+ /**
5
+ * Makes the given keys `K` of `T` optional, leaving the rest unchanged.
6
+ * Like the built-in `Partial`, but scoped to specific keys.
7
+ *
8
+ * Distributes over unions, so a union stays a union.
9
+ *
10
+ * @template T - The object type to transform.
11
+ * @template K - The keys to make optional.
12
+ *
13
+ * @example
14
+ * type User = { id: number; name: string; email: string };
15
+ * type UserDraft = SetOptional<User, 'email'>;
16
+ * // => { id: number; name: string; email?: string }
17
+ */
18
+ type SetOptional<T, K extends keyof T> = T extends unknown ? Simplify<Omit<T, K> & Partial<Pick<T, K>>> : never;
19
+ //#endregion
20
+ export { SetOptional };
@@ -0,0 +1,20 @@
1
+ import { Simplify } from "./Simplify.js";
2
+
3
+ //#region src/types/SetOptional.d.ts
4
+ /**
5
+ * Makes the given keys `K` of `T` optional, leaving the rest unchanged.
6
+ * Like the built-in `Partial`, but scoped to specific keys.
7
+ *
8
+ * Distributes over unions, so a union stays a union.
9
+ *
10
+ * @template T - The object type to transform.
11
+ * @template K - The keys to make optional.
12
+ *
13
+ * @example
14
+ * type User = { id: number; name: string; email: string };
15
+ * type UserDraft = SetOptional<User, 'email'>;
16
+ * // => { id: number; name: string; email?: string }
17
+ */
18
+ type SetOptional<T, K extends keyof T> = T extends unknown ? Simplify<Omit<T, K> & Partial<Pick<T, K>>> : never;
19
+ //#endregion
20
+ export { SetOptional };
@@ -0,0 +1,20 @@
1
+ import { Simplify } from "./Simplify.mjs";
2
+
3
+ //#region src/types/SetRequired.d.ts
4
+ /**
5
+ * Makes the given keys `K` of `T` required, leaving the rest unchanged.
6
+ * Like the built-in `Required`, but scoped to specific keys.
7
+ *
8
+ * Distributes over unions, so a union stays a union.
9
+ *
10
+ * @template T - The object type to transform.
11
+ * @template K - The keys to make required.
12
+ *
13
+ * @example
14
+ * type User = { id: number; name: string; avatar?: string };
15
+ * type ProfileUser = SetRequired<User, 'avatar'>;
16
+ * // => { id: number; name: string; avatar: string }
17
+ */
18
+ type SetRequired<T, K extends keyof T> = T extends unknown ? Simplify<T & Required<Pick<T, K>>> : never;
19
+ //#endregion
20
+ export { SetRequired };
@@ -0,0 +1,20 @@
1
+ import { Simplify } from "./Simplify.js";
2
+
3
+ //#region src/types/SetRequired.d.ts
4
+ /**
5
+ * Makes the given keys `K` of `T` required, leaving the rest unchanged.
6
+ * Like the built-in `Required`, but scoped to specific keys.
7
+ *
8
+ * Distributes over unions, so a union stays a union.
9
+ *
10
+ * @template T - The object type to transform.
11
+ * @template K - The keys to make required.
12
+ *
13
+ * @example
14
+ * type User = { id: number; name: string; avatar?: string };
15
+ * type ProfileUser = SetRequired<User, 'avatar'>;
16
+ * // => { id: number; name: string; avatar: string }
17
+ */
18
+ type SetRequired<T, K extends keyof T> = T extends unknown ? Simplify<T & Required<Pick<T, K>>> : never;
19
+ //#endregion
20
+ export { SetRequired };
@@ -0,0 +1,24 @@
1
+ //#region src/types/UnknownRecord.d.ts
2
+ /**
3
+ * An object with unknown keys and unknown values.
4
+ *
5
+ * Use it instead of `{}`, which accepts every non-nullish value including numbers
6
+ * and strings. Values are `unknown`, so reading one forces a check first.
7
+ *
8
+ * Only types with an index signature are assignable. An `interface` declares its
9
+ * keys one by one and is rejected, so accept `object` when the caller may pass
10
+ * one, or spread it at the call site.
11
+ *
12
+ * @example
13
+ * function log(data: UnknownRecord) {
14
+ * if (typeof data.id === 'string') {
15
+ * console.log(data.id);
16
+ * }
17
+ * }
18
+ *
19
+ * log({ id: '1' }); // ok
20
+ * log(42); // error, while `{}` would have allowed it
21
+ */
22
+ type UnknownRecord = Record<PropertyKey, unknown>;
23
+ //#endregion
24
+ export { UnknownRecord };
@@ -0,0 +1,24 @@
1
+ //#region src/types/UnknownRecord.d.ts
2
+ /**
3
+ * An object with unknown keys and unknown values.
4
+ *
5
+ * Use it instead of `{}`, which accepts every non-nullish value including numbers
6
+ * and strings. Values are `unknown`, so reading one forces a check first.
7
+ *
8
+ * Only types with an index signature are assignable. An `interface` declares its
9
+ * keys one by one and is rejected, so accept `object` when the caller may pass
10
+ * one, or spread it at the call site.
11
+ *
12
+ * @example
13
+ * function log(data: UnknownRecord) {
14
+ * if (typeof data.id === 'string') {
15
+ * console.log(data.id);
16
+ * }
17
+ * }
18
+ *
19
+ * log({ id: '1' }); // ok
20
+ * log(42); // error, while `{}` would have allowed it
21
+ */
22
+ type UnknownRecord = Record<PropertyKey, unknown>;
23
+ //#endregion
24
+ export { UnknownRecord };