@quantiya/codevibe-claude-plugin 2.0.12 → 2.0.13

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 (271) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/server.js +10 -9
  3. package/hooks/session-end.sh +20 -24
  4. package/node_modules/es-toolkit/CHANGELOG.md +3 -38
  5. package/node_modules/es-toolkit/dist/browser.global.js +4 -4
  6. package/node_modules/es-toolkit/dist/compat/array/differenceWith.js +1 -2
  7. package/node_modules/es-toolkit/dist/compat/array/differenceWith.mjs +1 -2
  8. package/node_modules/es-toolkit/dist/compat/array/findLastIndex.js +3 -5
  9. package/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs +3 -5
  10. package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.js +1 -1
  11. package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.mjs +1 -1
  12. package/node_modules/es-toolkit/dist/compat/array/without.js +2 -8
  13. package/node_modules/es-toolkit/dist/compat/array/without.mjs +2 -8
  14. package/node_modules/es-toolkit/dist/compat/array/xorWith.js +6 -4
  15. package/node_modules/es-toolkit/dist/compat/array/xorWith.mjs +6 -4
  16. package/node_modules/es-toolkit/dist/compat/compat.js +1 -1
  17. package/node_modules/es-toolkit/dist/compat/compat.mjs +1 -1
  18. package/node_modules/es-toolkit/dist/compat/function/debounce.js +1 -1
  19. package/node_modules/es-toolkit/dist/compat/function/debounce.mjs +1 -1
  20. package/node_modules/es-toolkit/dist/compat/index.js +1 -1
  21. package/node_modules/es-toolkit/dist/compat/index.mjs +1 -1
  22. package/node_modules/es-toolkit/dist/compat/object/has.js +2 -3
  23. package/node_modules/es-toolkit/dist/compat/object/has.mjs +2 -3
  24. package/node_modules/es-toolkit/dist/compat/object/hasIn.js +2 -3
  25. package/node_modules/es-toolkit/dist/compat/object/hasIn.mjs +2 -3
  26. package/node_modules/es-toolkit/dist/compat/object/mergeWith.js +1 -1
  27. package/node_modules/es-toolkit/dist/compat/object/mergeWith.mjs +1 -1
  28. package/node_modules/es-toolkit/dist/compat/object/omitBy.js +1 -1
  29. package/node_modules/es-toolkit/dist/compat/object/omitBy.mjs +1 -1
  30. package/node_modules/es-toolkit/dist/compat/object/pickBy.js +1 -1
  31. package/node_modules/es-toolkit/dist/compat/object/pickBy.mjs +1 -1
  32. package/node_modules/es-toolkit/dist/compat/util/toString.js +1 -3
  33. package/node_modules/es-toolkit/dist/compat/util/toString.mjs +1 -3
  34. package/node_modules/es-toolkit/dist/fp/index.d.mts +1 -2
  35. package/node_modules/es-toolkit/dist/fp/index.d.ts +1 -2
  36. package/node_modules/es-toolkit/dist/fp/index.js +0 -2
  37. package/node_modules/es-toolkit/dist/fp/index.mjs +1 -2
  38. package/node_modules/es-toolkit/dist/index.d.mts +1 -3
  39. package/node_modules/es-toolkit/dist/index.d.ts +1 -3
  40. package/node_modules/es-toolkit/dist/index.js +0 -4
  41. package/node_modules/es-toolkit/dist/index.mjs +1 -3
  42. package/node_modules/es-toolkit/dist/object/merge.d.mts +1 -3
  43. package/node_modules/es-toolkit/dist/object/merge.d.ts +1 -3
  44. package/node_modules/es-toolkit/dist/object/merge.js +40 -0
  45. package/node_modules/es-toolkit/dist/object/merge.mjs +40 -0
  46. package/node_modules/es-toolkit/dist/object/omitBy.d.mts +2 -4
  47. package/node_modules/es-toolkit/dist/object/omitBy.d.ts +2 -4
  48. package/node_modules/es-toolkit/dist/object/omitBy.js +3 -4
  49. package/node_modules/es-toolkit/dist/object/omitBy.mjs +3 -4
  50. package/node_modules/es-toolkit/dist/object/pickBy.d.mts +2 -4
  51. package/node_modules/es-toolkit/dist/object/pickBy.d.ts +2 -4
  52. package/node_modules/es-toolkit/dist/object/pickBy.js +3 -4
  53. package/node_modules/es-toolkit/dist/object/pickBy.mjs +3 -4
  54. package/node_modules/es-toolkit/dist/types/index.d.mts +2 -11
  55. package/node_modules/es-toolkit/dist/types/index.d.ts +2 -11
  56. package/node_modules/es-toolkit/dist/util/attempt.d.mts +1 -1
  57. package/node_modules/es-toolkit/dist/util/attempt.d.ts +1 -1
  58. package/node_modules/es-toolkit/dist/util/attemptAsync.d.mts +1 -1
  59. package/node_modules/es-toolkit/dist/util/attemptAsync.d.ts +1 -1
  60. package/node_modules/es-toolkit/dist/util/index.d.mts +1 -3
  61. package/node_modules/es-toolkit/dist/util/index.d.ts +1 -3
  62. package/node_modules/es-toolkit/dist/util/index.js +0 -4
  63. package/node_modules/es-toolkit/dist/util/index.mjs +1 -3
  64. package/node_modules/es-toolkit/package.json +1 -44
  65. package/node_modules/fs-ext/build/Makefile +347 -0
  66. package/node_modules/fs-ext/build/Release/.deps/Release/fs_ext.node.d +1 -0
  67. package/node_modules/fs-ext/build/Release/.deps/Release/obj.target/fs_ext/fs-ext.o.d +165 -0
  68. package/node_modules/fs-ext/build/Release/fs_ext.node +0 -0
  69. package/node_modules/fs-ext/build/Release/obj.target/fs_ext/fs-ext.o +0 -0
  70. package/node_modules/fs-ext/build/binding.Makefile +6 -0
  71. package/node_modules/fs-ext/build/config.gypi +503 -0
  72. package/node_modules/fs-ext/build/fs_ext.target.mk +183 -0
  73. package/node_modules/fs-ext/build/gyp-mac-tool +768 -0
  74. package/node_modules/keytar/build/Release/keytar.node +0 -0
  75. package/node_modules/node-abi/abi_registry.json +0 -7
  76. package/node_modules/node-abi/package.json +1 -1
  77. package/package.json +1 -1
  78. package/node_modules/es-toolkit/dist/fp/flowAsync.d.mts +0 -213
  79. package/node_modules/es-toolkit/dist/fp/flowAsync.d.ts +0 -213
  80. package/node_modules/es-toolkit/dist/fp/flowAsync.js +0 -37
  81. package/node_modules/es-toolkit/dist/fp/flowAsync.mjs +0 -37
  82. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.mts +0 -23
  83. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.ts +0 -23
  84. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.js +0 -28
  85. package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.mjs +0 -28
  86. package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.mts +0 -19
  87. package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.ts +0 -19
  88. package/node_modules/es-toolkit/dist/fp/iterator/chunk.js +0 -24
  89. package/node_modules/es-toolkit/dist/fp/iterator/chunk.mjs +0 -24
  90. package/node_modules/es-toolkit/dist/fp/iterator/count.d.mts +0 -20
  91. package/node_modules/es-toolkit/dist/fp/iterator/count.d.ts +0 -20
  92. package/node_modules/es-toolkit/dist/fp/iterator/count.js +0 -25
  93. package/node_modules/es-toolkit/dist/fp/iterator/count.mjs +0 -25
  94. package/node_modules/es-toolkit/dist/fp/iterator/drop.d.mts +0 -20
  95. package/node_modules/es-toolkit/dist/fp/iterator/drop.d.ts +0 -20
  96. package/node_modules/es-toolkit/dist/fp/iterator/drop.js +0 -24
  97. package/node_modules/es-toolkit/dist/fp/iterator/drop.mjs +0 -24
  98. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.mts +0 -18
  99. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.ts +0 -18
  100. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.js +0 -23
  101. package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.mjs +0 -23
  102. package/node_modules/es-toolkit/dist/fp/iterator/every.d.mts +0 -20
  103. package/node_modules/es-toolkit/dist/fp/iterator/every.d.ts +0 -20
  104. package/node_modules/es-toolkit/dist/fp/iterator/every.js +0 -24
  105. package/node_modules/es-toolkit/dist/fp/iterator/every.mjs +0 -24
  106. package/node_modules/es-toolkit/dist/fp/iterator/filter.d.mts +0 -37
  107. package/node_modules/es-toolkit/dist/fp/iterator/filter.d.ts +0 -37
  108. package/node_modules/es-toolkit/dist/fp/iterator/filter.js +0 -8
  109. package/node_modules/es-toolkit/dist/fp/iterator/filter.mjs +0 -8
  110. package/node_modules/es-toolkit/dist/fp/iterator/find.d.mts +0 -20
  111. package/node_modules/es-toolkit/dist/fp/iterator/find.d.ts +0 -20
  112. package/node_modules/es-toolkit/dist/fp/iterator/find.js +0 -24
  113. package/node_modules/es-toolkit/dist/fp/iterator/find.mjs +0 -24
  114. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.mts +0 -20
  115. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.ts +0 -20
  116. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.js +0 -24
  117. package/node_modules/es-toolkit/dist/fp/iterator/flatMap.mjs +0 -24
  118. package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.mts +0 -22
  119. package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.ts +0 -22
  120. package/node_modules/es-toolkit/dist/fp/iterator/forEach.js +0 -26
  121. package/node_modules/es-toolkit/dist/fp/iterator/forEach.mjs +0 -26
  122. package/node_modules/es-toolkit/dist/fp/iterator/head.d.mts +0 -19
  123. package/node_modules/es-toolkit/dist/fp/iterator/head.d.ts +0 -19
  124. package/node_modules/es-toolkit/dist/fp/iterator/head.js +0 -24
  125. package/node_modules/es-toolkit/dist/fp/iterator/head.mjs +0 -24
  126. package/node_modules/es-toolkit/dist/fp/iterator/index.d.mts +0 -22
  127. package/node_modules/es-toolkit/dist/fp/iterator/index.d.ts +0 -22
  128. package/node_modules/es-toolkit/dist/fp/iterator/index.js +0 -43
  129. package/node_modules/es-toolkit/dist/fp/iterator/index.mjs +0 -22
  130. package/node_modules/es-toolkit/dist/fp/iterator/map.d.mts +0 -20
  131. package/node_modules/es-toolkit/dist/fp/iterator/map.d.ts +0 -20
  132. package/node_modules/es-toolkit/dist/fp/iterator/map.js +0 -24
  133. package/node_modules/es-toolkit/dist/fp/iterator/map.mjs +0 -24
  134. package/node_modules/es-toolkit/dist/fp/iterator/partition.d.mts +0 -22
  135. package/node_modules/es-toolkit/dist/fp/iterator/partition.d.ts +0 -22
  136. package/node_modules/es-toolkit/dist/fp/iterator/partition.js +0 -27
  137. package/node_modules/es-toolkit/dist/fp/iterator/partition.mjs +0 -27
  138. package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.mts +0 -24
  139. package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.ts +0 -24
  140. package/node_modules/es-toolkit/dist/fp/iterator/reduce.js +0 -28
  141. package/node_modules/es-toolkit/dist/fp/iterator/reduce.mjs +0 -28
  142. package/node_modules/es-toolkit/dist/fp/iterator/scan.d.mts +0 -21
  143. package/node_modules/es-toolkit/dist/fp/iterator/scan.d.ts +0 -21
  144. package/node_modules/es-toolkit/dist/fp/iterator/scan.js +0 -26
  145. package/node_modules/es-toolkit/dist/fp/iterator/scan.mjs +0 -26
  146. package/node_modules/es-toolkit/dist/fp/iterator/some.d.mts +0 -20
  147. package/node_modules/es-toolkit/dist/fp/iterator/some.d.ts +0 -20
  148. package/node_modules/es-toolkit/dist/fp/iterator/some.js +0 -24
  149. package/node_modules/es-toolkit/dist/fp/iterator/some.mjs +0 -24
  150. package/node_modules/es-toolkit/dist/fp/iterator/take.d.mts +0 -21
  151. package/node_modules/es-toolkit/dist/fp/iterator/take.d.ts +0 -21
  152. package/node_modules/es-toolkit/dist/fp/iterator/take.js +0 -25
  153. package/node_modules/es-toolkit/dist/fp/iterator/take.mjs +0 -25
  154. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.mts +0 -19
  155. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.ts +0 -19
  156. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.js +0 -24
  157. package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.mjs +0 -24
  158. package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.mts +0 -21
  159. package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.ts +0 -21
  160. package/node_modules/es-toolkit/dist/fp/iterator/toArray.js +0 -25
  161. package/node_modules/es-toolkit/dist/fp/iterator/toArray.mjs +0 -25
  162. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.mts +0 -20
  163. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.ts +0 -20
  164. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.js +0 -25
  165. package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.mjs +0 -25
  166. package/node_modules/es-toolkit/dist/fp/iterator/zip.d.mts +0 -20
  167. package/node_modules/es-toolkit/dist/fp/iterator/zip.d.ts +0 -20
  168. package/node_modules/es-toolkit/dist/fp/iterator/zip.js +0 -25
  169. package/node_modules/es-toolkit/dist/fp/iterator/zip.mjs +0 -25
  170. package/node_modules/es-toolkit/dist/iterator/_internal/iterator.js +0 -74
  171. package/node_modules/es-toolkit/dist/iterator/_internal/iterator.mjs +0 -74
  172. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.mts +0 -33
  173. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.ts +0 -33
  174. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.js +0 -95
  175. package/node_modules/es-toolkit/dist/iterator/cartesianProduct.mjs +0 -95
  176. package/node_modules/es-toolkit/dist/iterator/chunk.d.mts +0 -21
  177. package/node_modules/es-toolkit/dist/iterator/chunk.d.ts +0 -21
  178. package/node_modules/es-toolkit/dist/iterator/chunk.js +0 -40
  179. package/node_modules/es-toolkit/dist/iterator/chunk.mjs +0 -40
  180. package/node_modules/es-toolkit/dist/iterator/count.d.mts +0 -18
  181. package/node_modules/es-toolkit/dist/iterator/count.d.ts +0 -18
  182. package/node_modules/es-toolkit/dist/iterator/count.js +0 -26
  183. package/node_modules/es-toolkit/dist/iterator/count.mjs +0 -26
  184. package/node_modules/es-toolkit/dist/iterator/dropWhile.d.mts +0 -20
  185. package/node_modules/es-toolkit/dist/iterator/dropWhile.d.ts +0 -20
  186. package/node_modules/es-toolkit/dist/iterator/dropWhile.js +0 -52
  187. package/node_modules/es-toolkit/dist/iterator/dropWhile.mjs +0 -52
  188. package/node_modules/es-toolkit/dist/iterator/head.d.mts +0 -21
  189. package/node_modules/es-toolkit/dist/iterator/head.d.ts +0 -21
  190. package/node_modules/es-toolkit/dist/iterator/head.js +0 -26
  191. package/node_modules/es-toolkit/dist/iterator/head.mjs +0 -26
  192. package/node_modules/es-toolkit/dist/iterator/index.d.mts +0 -13
  193. package/node_modules/es-toolkit/dist/iterator/index.d.ts +0 -13
  194. package/node_modules/es-toolkit/dist/iterator/index.js +0 -25
  195. package/node_modules/es-toolkit/dist/iterator/index.mjs +0 -13
  196. package/node_modules/es-toolkit/dist/iterator/iterate.d.mts +0 -20
  197. package/node_modules/es-toolkit/dist/iterator/iterate.d.ts +0 -20
  198. package/node_modules/es-toolkit/dist/iterator/iterate.js +0 -32
  199. package/node_modules/es-toolkit/dist/iterator/iterate.mjs +0 -32
  200. package/node_modules/es-toolkit/dist/iterator/partition.d.mts +0 -18
  201. package/node_modules/es-toolkit/dist/iterator/partition.d.ts +0 -18
  202. package/node_modules/es-toolkit/dist/iterator/partition.js +0 -36
  203. package/node_modules/es-toolkit/dist/iterator/partition.mjs +0 -36
  204. package/node_modules/es-toolkit/dist/iterator/range.d.mts +0 -42
  205. package/node_modules/es-toolkit/dist/iterator/range.d.ts +0 -42
  206. package/node_modules/es-toolkit/dist/iterator/range.js +0 -25
  207. package/node_modules/es-toolkit/dist/iterator/range.mjs +0 -25
  208. package/node_modules/es-toolkit/dist/iterator/scan.d.mts +0 -23
  209. package/node_modules/es-toolkit/dist/iterator/scan.d.ts +0 -23
  210. package/node_modules/es-toolkit/dist/iterator/scan.js +0 -47
  211. package/node_modules/es-toolkit/dist/iterator/scan.mjs +0 -47
  212. package/node_modules/es-toolkit/dist/iterator/takeWhile.d.mts +0 -20
  213. package/node_modules/es-toolkit/dist/iterator/takeWhile.d.ts +0 -20
  214. package/node_modules/es-toolkit/dist/iterator/takeWhile.js +0 -34
  215. package/node_modules/es-toolkit/dist/iterator/takeWhile.mjs +0 -34
  216. package/node_modules/es-toolkit/dist/iterator/uniqBy.d.mts +0 -22
  217. package/node_modules/es-toolkit/dist/iterator/uniqBy.d.ts +0 -22
  218. package/node_modules/es-toolkit/dist/iterator/uniqBy.js +0 -43
  219. package/node_modules/es-toolkit/dist/iterator/uniqBy.mjs +0 -43
  220. package/node_modules/es-toolkit/dist/iterator/zip.d.mts +0 -23
  221. package/node_modules/es-toolkit/dist/iterator/zip.d.ts +0 -23
  222. package/node_modules/es-toolkit/dist/iterator/zip.js +0 -45
  223. package/node_modules/es-toolkit/dist/iterator/zip.mjs +0 -45
  224. package/node_modules/es-toolkit/dist/types/EmptyObject.d.mts +0 -21
  225. package/node_modules/es-toolkit/dist/types/EmptyObject.d.ts +0 -21
  226. package/node_modules/es-toolkit/dist/types/IsEqual.d.mts +0 -18
  227. package/node_modules/es-toolkit/dist/types/IsEqual.d.ts +0 -18
  228. package/node_modules/es-toolkit/dist/types/JSONValue.d.mts +0 -24
  229. package/node_modules/es-toolkit/dist/types/JSONValue.d.ts +0 -24
  230. package/node_modules/es-toolkit/dist/types/Merge.d.mts +0 -37
  231. package/node_modules/es-toolkit/dist/types/Merge.d.ts +0 -37
  232. package/node_modules/es-toolkit/dist/types/ObjectKeys.d.mts +0 -19
  233. package/node_modules/es-toolkit/dist/types/ObjectKeys.d.ts +0 -19
  234. package/node_modules/es-toolkit/dist/types/Primitive.d.mts +0 -14
  235. package/node_modules/es-toolkit/dist/types/Primitive.d.ts +0 -14
  236. package/node_modules/es-toolkit/dist/types/SetOptional.d.mts +0 -20
  237. package/node_modules/es-toolkit/dist/types/SetOptional.d.ts +0 -20
  238. package/node_modules/es-toolkit/dist/types/SetRequired.d.mts +0 -20
  239. package/node_modules/es-toolkit/dist/types/SetRequired.d.ts +0 -20
  240. package/node_modules/es-toolkit/dist/types/UnknownRecord.d.mts +0 -24
  241. package/node_modules/es-toolkit/dist/types/UnknownRecord.d.ts +0 -24
  242. package/node_modules/es-toolkit/dist/util/defer.d.mts +0 -27
  243. package/node_modules/es-toolkit/dist/util/defer.d.ts +0 -27
  244. package/node_modules/es-toolkit/dist/util/defer.js +0 -31
  245. package/node_modules/es-toolkit/dist/util/defer.mjs +0 -31
  246. package/node_modules/es-toolkit/dist/util/deferAsync.d.mts +0 -30
  247. package/node_modules/es-toolkit/dist/util/deferAsync.d.ts +0 -30
  248. package/node_modules/es-toolkit/dist/util/deferAsync.js +0 -34
  249. package/node_modules/es-toolkit/dist/util/deferAsync.mjs +0 -34
  250. package/node_modules/es-toolkit/fp/iterator.d.ts +0 -1
  251. package/node_modules/es-toolkit/fp/iterator.js +0 -1
  252. package/node_modules/es-toolkit/iterator.d.ts +0 -1
  253. package/node_modules/es-toolkit/iterator.js +0 -1
  254. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/LICENSE.md +0 -0
  255. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/README.md +0 -0
  256. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/common.gypi +0 -0
  257. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/except.gypi +0 -0
  258. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/index.js +0 -0
  259. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/napi-inl.deprecated.h +0 -0
  260. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/napi-inl.h +0 -0
  261. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/napi.h +0 -0
  262. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/node_api.gyp +0 -0
  263. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/noexcept.gypi +0 -0
  264. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/nothing.c +0 -0
  265. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/package-support.json +0 -0
  266. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/package.json +0 -0
  267. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/tools/README.md +0 -0
  268. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/tools/check-napi.js +0 -0
  269. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/tools/clang-format.js +0 -0
  270. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/tools/conversion.js +0 -0
  271. /package/node_modules/{keytar/node_modules/node-addon-api → node-addon-api}/tools/eslint-format.js +0 -0
@@ -1,25 +0,0 @@
1
- import { uniqBy as uniqBy$1 } from "../../iterator/uniqBy.mjs";
2
- //#region src/fp/iterator/uniqBy.ts
3
- /**
4
- * Creates a function that lazily yields the elements of an iterator whose mapped
5
- * key has not been seen before, preserving first-occurrence order, for use with
6
- * {@link pipe}. Keys are compared with SameValueZero semantics.
7
- *
8
- * @template T - The type of elements produced by the source iterator.
9
- * @template K - The type of the key used for comparison.
10
- * @param getKey - Maps an element to the key used to detect duplicates.
11
- * @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<T>`.
12
- *
13
- * @example
14
- * import { pipe } from 'es-toolkit/fp';
15
- * import { uniqBy, toArray } from 'es-toolkit/fp/iterator';
16
- *
17
- * pipe([1.1, 1.2, 2.3].values(), uniqBy(Math.floor), toArray()); // => [1.1, 2.3]
18
- */
19
- function uniqBy(getKey) {
20
- return function uniqByInIterator(source) {
21
- return uniqBy$1(source, getKey);
22
- };
23
- }
24
- //#endregion
25
- export { uniqBy };
@@ -1,20 +0,0 @@
1
- //#region src/fp/iterator/zip.d.ts
2
- /**
3
- * Creates a function that lazily pairs the elements of the piped iterator with
4
- * those of `other`, for use with {@link pipe}. Iteration stops as soon as either
5
- * iterator is exhausted.
6
- *
7
- * @template T - The type of elements produced by the piped iterator.
8
- * @template U - The type of elements produced by `other`.
9
- * @param other - The iterator to pair with the piped one.
10
- * @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
11
- *
12
- * @example
13
- * import { pipe } from 'es-toolkit/fp';
14
- * import { zip, toArray } from 'es-toolkit/fp/iterator';
15
- *
16
- * pipe([1, 2, 3].values(), zip(['a', 'b'].values()), toArray()); // => [[1, 'a'], [2, 'b']]
17
- */
18
- declare function zip<T, U>(other: Iterator<U>): (source: Iterator<T>) => IteratorObject<[T, U], undefined>;
19
- //#endregion
20
- export { zip };
@@ -1,20 +0,0 @@
1
- //#region src/fp/iterator/zip.d.ts
2
- /**
3
- * Creates a function that lazily pairs the elements of the piped iterator with
4
- * those of `other`, for use with {@link pipe}. Iteration stops as soon as either
5
- * iterator is exhausted.
6
- *
7
- * @template T - The type of elements produced by the piped iterator.
8
- * @template U - The type of elements produced by `other`.
9
- * @param other - The iterator to pair with the piped one.
10
- * @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
11
- *
12
- * @example
13
- * import { pipe } from 'es-toolkit/fp';
14
- * import { zip, toArray } from 'es-toolkit/fp/iterator';
15
- *
16
- * pipe([1, 2, 3].values(), zip(['a', 'b'].values()), toArray()); // => [[1, 'a'], [2, 'b']]
17
- */
18
- declare function zip<T, U>(other: Iterator<U>): (source: Iterator<T>) => IteratorObject<[T, U], undefined>;
19
- //#endregion
20
- export { zip };
@@ -1,25 +0,0 @@
1
- const require_zip = require("../../iterator/zip.js");
2
- //#region src/fp/iterator/zip.ts
3
- /**
4
- * Creates a function that lazily pairs the elements of the piped iterator with
5
- * those of `other`, for use with {@link pipe}. Iteration stops as soon as either
6
- * iterator is exhausted.
7
- *
8
- * @template T - The type of elements produced by the piped iterator.
9
- * @template U - The type of elements produced by `other`.
10
- * @param other - The iterator to pair with the piped one.
11
- * @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
12
- *
13
- * @example
14
- * import { pipe } from 'es-toolkit/fp';
15
- * import { zip, toArray } from 'es-toolkit/fp/iterator';
16
- *
17
- * pipe([1, 2, 3].values(), zip(['a', 'b'].values()), toArray()); // => [[1, 'a'], [2, 'b']]
18
- */
19
- function zip(other) {
20
- return function zipInIterator(source) {
21
- return require_zip.zip(source, other);
22
- };
23
- }
24
- //#endregion
25
- exports.zip = zip;
@@ -1,25 +0,0 @@
1
- import { zip as zip$1 } from "../../iterator/zip.mjs";
2
- //#region src/fp/iterator/zip.ts
3
- /**
4
- * Creates a function that lazily pairs the elements of the piped iterator with
5
- * those of `other`, for use with {@link pipe}. Iteration stops as soon as either
6
- * iterator is exhausted.
7
- *
8
- * @template T - The type of elements produced by the piped iterator.
9
- * @template U - The type of elements produced by `other`.
10
- * @param other - The iterator to pair with the piped one.
11
- * @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
12
- *
13
- * @example
14
- * import { pipe } from 'es-toolkit/fp';
15
- * import { zip, toArray } from 'es-toolkit/fp/iterator';
16
- *
17
- * pipe([1, 2, 3].values(), zip(['a', 'b'].values()), toArray()); // => [[1, 'a'], [2, 'b']]
18
- */
19
- function zip(other) {
20
- return function zipInIterator(source) {
21
- return zip$1(source, other);
22
- };
23
- }
24
- //#endregion
25
- export { zip };
@@ -1,74 +0,0 @@
1
- //#region src/iterator/_internal/iterator.ts
2
- /**
3
- * Wraps a `next` function into a lazy {@link IteratorObject} whose prototype is
4
- * the native `Iterator.prototype`. The result therefore behaves exactly like a
5
- * value returned by a built-in iterator helper (e.g. `array.values().map(...)`):
6
- * it is single-shot, it is iterable via `Symbol.iterator` (returning itself),
7
- * and it carries every native helper method (`map`, `filter`, `take`, `drop`,
8
- * `flatMap`, `reduce`, `toArray`, ...) so results can be chained with them.
9
- *
10
- * The result also follows the IteratorClose protocol of the native helpers, so
11
- * upstream resources (e.g. `try/finally` blocks in generator sources) are
12
- * released. `onClose` runs exactly once, at whichever of these happens first:
13
- * the consumer terminates early (`return()`, e.g. from `take` or a `for...of`
14
- * `break`), `next` throws, or `next` reports done. After the iterator is
15
- * closed, `next` is never called again and every subsequent step is done.
16
- *
17
- * Using a hand-rolled `next` rather than a generator function is a deliberate
18
- * performance choice — driving the iterator protocol directly measured roughly
19
- * twice as fast as `yield`-based generators for the same transforms, while
20
- * `Object.create(Iterator.prototype)` adds no measurable overhead over a plain
21
- * object literal.
22
- *
23
- * @template T - The type of values produced by the iterator.
24
- * @param next - Called to produce each step; return `{ done: true, value: undefined }` to finish.
25
- * @param onClose - Called once when the iterator closes; use it to close upstream iterators.
26
- * @returns A lazy {@link IteratorObject} that yields the values produced by `next`.
27
- *
28
- * @example
29
- * function repeat<T>(value: T, times: number): IteratorObject<T, undefined> {
30
- * let remaining = times;
31
- * return iterator(function () {
32
- * if (remaining <= 0) {
33
- * return { value: undefined, done: true };
34
- * }
35
- * remaining--;
36
- * return { value, done: false };
37
- * });
38
- * }
39
- */
40
- function iterator(next, onClose) {
41
- let closed = false;
42
- const close = () => {
43
- if (!closed) {
44
- closed = true;
45
- onClose?.();
46
- }
47
- };
48
- const result = Object.create(Iterator.prototype);
49
- result.next = function() {
50
- if (closed) return {
51
- value: void 0,
52
- done: true
53
- };
54
- let step;
55
- try {
56
- step = next();
57
- } catch (error) {
58
- close();
59
- throw error;
60
- }
61
- if (step.done) close();
62
- return step;
63
- };
64
- result.return = function() {
65
- close();
66
- return {
67
- value: void 0,
68
- done: true
69
- };
70
- };
71
- return result;
72
- }
73
- //#endregion
74
- exports.iterator = iterator;
@@ -1,74 +0,0 @@
1
- //#region src/iterator/_internal/iterator.ts
2
- /**
3
- * Wraps a `next` function into a lazy {@link IteratorObject} whose prototype is
4
- * the native `Iterator.prototype`. The result therefore behaves exactly like a
5
- * value returned by a built-in iterator helper (e.g. `array.values().map(...)`):
6
- * it is single-shot, it is iterable via `Symbol.iterator` (returning itself),
7
- * and it carries every native helper method (`map`, `filter`, `take`, `drop`,
8
- * `flatMap`, `reduce`, `toArray`, ...) so results can be chained with them.
9
- *
10
- * The result also follows the IteratorClose protocol of the native helpers, so
11
- * upstream resources (e.g. `try/finally` blocks in generator sources) are
12
- * released. `onClose` runs exactly once, at whichever of these happens first:
13
- * the consumer terminates early (`return()`, e.g. from `take` or a `for...of`
14
- * `break`), `next` throws, or `next` reports done. After the iterator is
15
- * closed, `next` is never called again and every subsequent step is done.
16
- *
17
- * Using a hand-rolled `next` rather than a generator function is a deliberate
18
- * performance choice — driving the iterator protocol directly measured roughly
19
- * twice as fast as `yield`-based generators for the same transforms, while
20
- * `Object.create(Iterator.prototype)` adds no measurable overhead over a plain
21
- * object literal.
22
- *
23
- * @template T - The type of values produced by the iterator.
24
- * @param next - Called to produce each step; return `{ done: true, value: undefined }` to finish.
25
- * @param onClose - Called once when the iterator closes; use it to close upstream iterators.
26
- * @returns A lazy {@link IteratorObject} that yields the values produced by `next`.
27
- *
28
- * @example
29
- * function repeat<T>(value: T, times: number): IteratorObject<T, undefined> {
30
- * let remaining = times;
31
- * return iterator(function () {
32
- * if (remaining <= 0) {
33
- * return { value: undefined, done: true };
34
- * }
35
- * remaining--;
36
- * return { value, done: false };
37
- * });
38
- * }
39
- */
40
- function iterator(next, onClose) {
41
- let closed = false;
42
- const close = () => {
43
- if (!closed) {
44
- closed = true;
45
- onClose?.();
46
- }
47
- };
48
- const result = Object.create(Iterator.prototype);
49
- result.next = function() {
50
- if (closed) return {
51
- value: void 0,
52
- done: true
53
- };
54
- let step;
55
- try {
56
- step = next();
57
- } catch (error) {
58
- close();
59
- throw error;
60
- }
61
- if (step.done) close();
62
- return step;
63
- };
64
- result.return = function() {
65
- close();
66
- return {
67
- value: void 0,
68
- done: true
69
- };
70
- };
71
- return result;
72
- }
73
- //#endregion
74
- export { iterator };
@@ -1,33 +0,0 @@
1
- //#region src/iterator/cartesianProduct.d.ts
2
- type IteratorValue<T> = T extends Iterator<infer V> ? V : never;
3
- /**
4
- * Lazily computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
5
- * of the source iterators, yielding every possible tuple formed by picking one
6
- * element from each source, in lexicographic order — the rightmost source
7
- * advances fastest, like the digits of an odometer.
8
- *
9
- * Because every source except the first is traversed many times, those sources
10
- * are buffered into arrays when iteration starts. The first source is consumed
11
- * lazily, one element at a time, so it may be infinite. When iteration ends —
12
- * because the first source ran out, a buffered source was empty, or the
13
- * consumer terminated early — every source is closed via its `return` method.
14
- *
15
- * If no sources are passed, a single empty tuple is yielded, matching the
16
- * array `cartesianProduct`. If any source is empty, nothing is yielded.
17
- *
18
- * @template T - A tuple of the source iterator types.
19
- * @param sources - The iterators to take the product of.
20
- * @returns A lazy iterator over tuples representing the Cartesian product.
21
- *
22
- * @example
23
- * cartesianProduct([1, 2].values(), ['a', 'b'].values()).toArray();
24
- * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
25
- *
26
- * @example
27
- * // The first source may be infinite; elements are produced on demand.
28
- * cartesianProduct(range(0, Infinity), ['a', 'b'].values()).take(3).toArray();
29
- * // => [[0, 'a'], [0, 'b'], [1, 'a']]
30
- */
31
- declare function cartesianProduct<T extends Array<Iterator<unknown>>>(...sources: T): IteratorObject<{ [K in keyof T]: IteratorValue<T[K]> }, undefined>;
32
- //#endregion
33
- export { cartesianProduct };
@@ -1,33 +0,0 @@
1
- //#region src/iterator/cartesianProduct.d.ts
2
- type IteratorValue<T> = T extends Iterator<infer V> ? V : never;
3
- /**
4
- * Lazily computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
5
- * of the source iterators, yielding every possible tuple formed by picking one
6
- * element from each source, in lexicographic order — the rightmost source
7
- * advances fastest, like the digits of an odometer.
8
- *
9
- * Because every source except the first is traversed many times, those sources
10
- * are buffered into arrays when iteration starts. The first source is consumed
11
- * lazily, one element at a time, so it may be infinite. When iteration ends —
12
- * because the first source ran out, a buffered source was empty, or the
13
- * consumer terminated early — every source is closed via its `return` method.
14
- *
15
- * If no sources are passed, a single empty tuple is yielded, matching the
16
- * array `cartesianProduct`. If any source is empty, nothing is yielded.
17
- *
18
- * @template T - A tuple of the source iterator types.
19
- * @param sources - The iterators to take the product of.
20
- * @returns A lazy iterator over tuples representing the Cartesian product.
21
- *
22
- * @example
23
- * cartesianProduct([1, 2].values(), ['a', 'b'].values()).toArray();
24
- * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
25
- *
26
- * @example
27
- * // The first source may be infinite; elements are produced on demand.
28
- * cartesianProduct(range(0, Infinity), ['a', 'b'].values()).take(3).toArray();
29
- * // => [[0, 'a'], [0, 'b'], [1, 'a']]
30
- */
31
- declare function cartesianProduct<T extends Array<Iterator<unknown>>>(...sources: T): IteratorObject<{ [K in keyof T]: IteratorValue<T[K]> }, undefined>;
32
- //#endregion
33
- export { cartesianProduct };
@@ -1,95 +0,0 @@
1
- const require_iterator = require("./_internal/iterator.js");
2
- //#region src/iterator/cartesianProduct.ts
3
- /**
4
- * Lazily computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
5
- * of the source iterators, yielding every possible tuple formed by picking one
6
- * element from each source, in lexicographic order — the rightmost source
7
- * advances fastest, like the digits of an odometer.
8
- *
9
- * Because every source except the first is traversed many times, those sources
10
- * are buffered into arrays when iteration starts. The first source is consumed
11
- * lazily, one element at a time, so it may be infinite. When iteration ends —
12
- * because the first source ran out, a buffered source was empty, or the
13
- * consumer terminated early — every source is closed via its `return` method.
14
- *
15
- * If no sources are passed, a single empty tuple is yielded, matching the
16
- * array `cartesianProduct`. If any source is empty, nothing is yielded.
17
- *
18
- * @template T - A tuple of the source iterator types.
19
- * @param sources - The iterators to take the product of.
20
- * @returns A lazy iterator over tuples representing the Cartesian product.
21
- *
22
- * @example
23
- * cartesianProduct([1, 2].values(), ['a', 'b'].values()).toArray();
24
- * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
25
- *
26
- * @example
27
- * // The first source may be infinite; elements are produced on demand.
28
- * cartesianProduct(range(0, Infinity), ['a', 'b'].values()).take(3).toArray();
29
- * // => [[0, 'a'], [0, 'b'], [1, 'a']]
30
- */
31
- function cartesianProduct(...sources) {
32
- const pools = [];
33
- const indices = [];
34
- let firstValue;
35
- let state = "initial";
36
- return require_iterator.iterator(function() {
37
- if (state === "done") return {
38
- value: void 0,
39
- done: true
40
- };
41
- if (state === "initial") {
42
- state = "active";
43
- if (sources.length === 0) {
44
- state = "done";
45
- return {
46
- value: [],
47
- done: false
48
- };
49
- }
50
- for (let index = 1; index < sources.length; index++) {
51
- const pool = [];
52
- let step = sources[index].next();
53
- while (!step.done) {
54
- pool.push(step.value);
55
- step = sources[index].next();
56
- }
57
- pools.push(pool);
58
- }
59
- if (pools.some((pool) => pool.length === 0)) return {
60
- value: void 0,
61
- done: true
62
- };
63
- const step = sources[0].next();
64
- if (step.done) return {
65
- value: void 0,
66
- done: true
67
- };
68
- firstValue = step.value;
69
- for (let index = 0; index < pools.length; index++) indices.push(0);
70
- }
71
- const tuple = new Array(sources.length);
72
- tuple[0] = firstValue;
73
- for (let index = 0; index < indices.length; index++) tuple[index + 1] = pools[index][indices[index]];
74
- let position = indices.length - 1;
75
- while (position >= 0) {
76
- indices[position]++;
77
- if (indices[position] < pools[position].length) break;
78
- indices[position] = 0;
79
- position--;
80
- }
81
- if (position < 0) {
82
- const step = sources[0].next();
83
- if (step.done) state = "done";
84
- else firstValue = step.value;
85
- }
86
- return {
87
- value: tuple,
88
- done: false
89
- };
90
- }, () => {
91
- for (const source of sources) source.return?.();
92
- });
93
- }
94
- //#endregion
95
- exports.cartesianProduct = cartesianProduct;
@@ -1,95 +0,0 @@
1
- import { iterator } from "./_internal/iterator.mjs";
2
- //#region src/iterator/cartesianProduct.ts
3
- /**
4
- * Lazily computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
5
- * of the source iterators, yielding every possible tuple formed by picking one
6
- * element from each source, in lexicographic order — the rightmost source
7
- * advances fastest, like the digits of an odometer.
8
- *
9
- * Because every source except the first is traversed many times, those sources
10
- * are buffered into arrays when iteration starts. The first source is consumed
11
- * lazily, one element at a time, so it may be infinite. When iteration ends —
12
- * because the first source ran out, a buffered source was empty, or the
13
- * consumer terminated early — every source is closed via its `return` method.
14
- *
15
- * If no sources are passed, a single empty tuple is yielded, matching the
16
- * array `cartesianProduct`. If any source is empty, nothing is yielded.
17
- *
18
- * @template T - A tuple of the source iterator types.
19
- * @param sources - The iterators to take the product of.
20
- * @returns A lazy iterator over tuples representing the Cartesian product.
21
- *
22
- * @example
23
- * cartesianProduct([1, 2].values(), ['a', 'b'].values()).toArray();
24
- * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
25
- *
26
- * @example
27
- * // The first source may be infinite; elements are produced on demand.
28
- * cartesianProduct(range(0, Infinity), ['a', 'b'].values()).take(3).toArray();
29
- * // => [[0, 'a'], [0, 'b'], [1, 'a']]
30
- */
31
- function cartesianProduct(...sources) {
32
- const pools = [];
33
- const indices = [];
34
- let firstValue;
35
- let state = "initial";
36
- return iterator(function() {
37
- if (state === "done") return {
38
- value: void 0,
39
- done: true
40
- };
41
- if (state === "initial") {
42
- state = "active";
43
- if (sources.length === 0) {
44
- state = "done";
45
- return {
46
- value: [],
47
- done: false
48
- };
49
- }
50
- for (let index = 1; index < sources.length; index++) {
51
- const pool = [];
52
- let step = sources[index].next();
53
- while (!step.done) {
54
- pool.push(step.value);
55
- step = sources[index].next();
56
- }
57
- pools.push(pool);
58
- }
59
- if (pools.some((pool) => pool.length === 0)) return {
60
- value: void 0,
61
- done: true
62
- };
63
- const step = sources[0].next();
64
- if (step.done) return {
65
- value: void 0,
66
- done: true
67
- };
68
- firstValue = step.value;
69
- for (let index = 0; index < pools.length; index++) indices.push(0);
70
- }
71
- const tuple = new Array(sources.length);
72
- tuple[0] = firstValue;
73
- for (let index = 0; index < indices.length; index++) tuple[index + 1] = pools[index][indices[index]];
74
- let position = indices.length - 1;
75
- while (position >= 0) {
76
- indices[position]++;
77
- if (indices[position] < pools[position].length) break;
78
- indices[position] = 0;
79
- position--;
80
- }
81
- if (position < 0) {
82
- const step = sources[0].next();
83
- if (step.done) state = "done";
84
- else firstValue = step.value;
85
- }
86
- return {
87
- value: tuple,
88
- done: false
89
- };
90
- }, () => {
91
- for (const source of sources) source.return?.();
92
- });
93
- }
94
- //#endregion
95
- export { cartesianProduct };
@@ -1,21 +0,0 @@
1
- //#region src/iterator/chunk.d.ts
2
- /**
3
- * Lazily groups the elements of `source` into arrays of length `size`. The final
4
- * chunk holds the remaining elements when the source length is not an exact
5
- * multiple of `size`, so it may be shorter.
6
- *
7
- * Each chunk is produced only when requested, so this works with infinite
8
- * iterators when bounded by a short-circuiting helper.
9
- *
10
- * @template T - The type of elements produced by the iterator.
11
- * @param source - The iterator to split into chunks.
12
- * @param size - The length of each chunk; must be an integer greater than zero.
13
- * @returns A lazy iterator over arrays of up to `size` elements.
14
- * @throws {Error} Throws an error if `size` is not an integer greater than zero.
15
- *
16
- * @example
17
- * chunk([1, 2, 3, 4, 5].values(), 2).toArray(); // => [[1, 2], [3, 4], [5]]
18
- */
19
- declare function chunk<T>(source: Iterator<T>, size: number): IteratorObject<T[], undefined>;
20
- //#endregion
21
- export { chunk };
@@ -1,21 +0,0 @@
1
- //#region src/iterator/chunk.d.ts
2
- /**
3
- * Lazily groups the elements of `source` into arrays of length `size`. The final
4
- * chunk holds the remaining elements when the source length is not an exact
5
- * multiple of `size`, so it may be shorter.
6
- *
7
- * Each chunk is produced only when requested, so this works with infinite
8
- * iterators when bounded by a short-circuiting helper.
9
- *
10
- * @template T - The type of elements produced by the iterator.
11
- * @param source - The iterator to split into chunks.
12
- * @param size - The length of each chunk; must be an integer greater than zero.
13
- * @returns A lazy iterator over arrays of up to `size` elements.
14
- * @throws {Error} Throws an error if `size` is not an integer greater than zero.
15
- *
16
- * @example
17
- * chunk([1, 2, 3, 4, 5].values(), 2).toArray(); // => [[1, 2], [3, 4], [5]]
18
- */
19
- declare function chunk<T>(source: Iterator<T>, size: number): IteratorObject<T[], undefined>;
20
- //#endregion
21
- export { chunk };
@@ -1,40 +0,0 @@
1
- const require_iterator = require("./_internal/iterator.js");
2
- //#region src/iterator/chunk.ts
3
- /**
4
- * Lazily groups the elements of `source` into arrays of length `size`. The final
5
- * chunk holds the remaining elements when the source length is not an exact
6
- * multiple of `size`, so it may be shorter.
7
- *
8
- * Each chunk is produced only when requested, so this works with infinite
9
- * iterators when bounded by a short-circuiting helper.
10
- *
11
- * @template T - The type of elements produced by the iterator.
12
- * @param source - The iterator to split into chunks.
13
- * @param size - The length of each chunk; must be an integer greater than zero.
14
- * @returns A lazy iterator over arrays of up to `size` elements.
15
- * @throws {Error} Throws an error if `size` is not an integer greater than zero.
16
- *
17
- * @example
18
- * chunk([1, 2, 3, 4, 5].values(), 2).toArray(); // => [[1, 2], [3, 4], [5]]
19
- */
20
- function chunk(source, size) {
21
- if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero.");
22
- return require_iterator.iterator(function() {
23
- const buffer = [];
24
- while (buffer.length < size) {
25
- const result = source.next();
26
- if (result.done) break;
27
- buffer.push(result.value);
28
- }
29
- if (buffer.length === 0) return {
30
- value: void 0,
31
- done: true
32
- };
33
- return {
34
- value: buffer,
35
- done: false
36
- };
37
- }, () => void source.return?.());
38
- }
39
- //#endregion
40
- exports.chunk = chunk;
@@ -1,40 +0,0 @@
1
- import { iterator } from "./_internal/iterator.mjs";
2
- //#region src/iterator/chunk.ts
3
- /**
4
- * Lazily groups the elements of `source` into arrays of length `size`. The final
5
- * chunk holds the remaining elements when the source length is not an exact
6
- * multiple of `size`, so it may be shorter.
7
- *
8
- * Each chunk is produced only when requested, so this works with infinite
9
- * iterators when bounded by a short-circuiting helper.
10
- *
11
- * @template T - The type of elements produced by the iterator.
12
- * @param source - The iterator to split into chunks.
13
- * @param size - The length of each chunk; must be an integer greater than zero.
14
- * @returns A lazy iterator over arrays of up to `size` elements.
15
- * @throws {Error} Throws an error if `size` is not an integer greater than zero.
16
- *
17
- * @example
18
- * chunk([1, 2, 3, 4, 5].values(), 2).toArray(); // => [[1, 2], [3, 4], [5]]
19
- */
20
- function chunk(source, size) {
21
- if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero.");
22
- return iterator(function() {
23
- const buffer = [];
24
- while (buffer.length < size) {
25
- const result = source.next();
26
- if (result.done) break;
27
- buffer.push(result.value);
28
- }
29
- if (buffer.length === 0) return {
30
- value: void 0,
31
- done: true
32
- };
33
- return {
34
- value: buffer,
35
- done: false
36
- };
37
- }, () => void source.return?.());
38
- }
39
- //#endregion
40
- export { chunk };
@@ -1,18 +0,0 @@
1
- //#region src/iterator/count.d.ts
2
- /**
3
- * Consumes `source` and returns the number of elements it produces. This is a
4
- * terminal operation: it pulls every element, so it must not be used on an
5
- * infinite iterator.
6
- *
7
- * Unlike `source.toArray().length`, this counts without allocating an array.
8
- *
9
- * @template T - The type of elements produced by the iterator.
10
- * @param source - The iterator to count.
11
- * @returns The number of elements produced by `source`.
12
- *
13
- * @example
14
- * count([1, 2, 3].values()); // => 3
15
- */
16
- declare function count<T>(source: Iterator<T>): number;
17
- //#endregion
18
- export { count };