@vielzeug/arsenal 2.1.0 → 26.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (607) hide show
  1. package/README.md +5 -18
  2. package/dist/_common/_lruMap.cjs +1 -1
  3. package/dist/_common/_lruMap.cjs.map +1 -1
  4. package/dist/_common/_lruMap.js +1 -17
  5. package/dist/_common/_lruMap.js.map +1 -1
  6. package/dist/_common/_selectorSet.cjs +1 -1
  7. package/dist/_common/_selectorSet.cjs.map +1 -1
  8. package/dist/_common/_selectorSet.js +1 -15
  9. package/dist/_common/_selectorSet.js.map +1 -1
  10. package/dist/_common/unsafePaths.cjs +1 -1
  11. package/dist/_common/unsafePaths.cjs.map +1 -1
  12. package/dist/_common/unsafePaths.js +1 -12
  13. package/dist/_common/unsafePaths.js.map +1 -1
  14. package/dist/_dev.cjs +1 -1
  15. package/dist/_dev.cjs.map +1 -1
  16. package/dist/_dev.js +1 -5
  17. package/dist/_dev.js.map +1 -1
  18. package/dist/array/chunk.cjs +1 -1
  19. package/dist/array/chunk.cjs.map +1 -1
  20. package/dist/array/chunk.d.ts +1 -1
  21. package/dist/array/chunk.d.ts.map +1 -1
  22. package/dist/array/chunk.js +1 -9
  23. package/dist/array/chunk.js.map +1 -1
  24. package/dist/array/compact.cjs +1 -1
  25. package/dist/array/compact.cjs.map +1 -1
  26. package/dist/array/compact.d.ts +1 -1
  27. package/dist/array/compact.d.ts.map +1 -1
  28. package/dist/array/compact.js +1 -7
  29. package/dist/array/compact.js.map +1 -1
  30. package/dist/array/compare.cjs +1 -1
  31. package/dist/array/compare.cjs.map +1 -1
  32. package/dist/array/compare.js +1 -18
  33. package/dist/array/compare.js.map +1 -1
  34. package/dist/array/compareBy.cjs +1 -1
  35. package/dist/array/compareBy.cjs.map +1 -1
  36. package/dist/array/compareBy.js +1 -15
  37. package/dist/array/compareBy.js.map +1 -1
  38. package/dist/array/contains.cjs +1 -1
  39. package/dist/array/contains.cjs.map +1 -1
  40. package/dist/array/contains.d.ts +1 -1
  41. package/dist/array/contains.d.ts.map +1 -1
  42. package/dist/array/contains.js +1 -8
  43. package/dist/array/contains.js.map +1 -1
  44. package/dist/array/countBy.cjs +1 -1
  45. package/dist/array/countBy.cjs.map +1 -1
  46. package/dist/array/countBy.d.ts +1 -1
  47. package/dist/array/countBy.d.ts.map +1 -1
  48. package/dist/array/countBy.js +1 -13
  49. package/dist/array/countBy.js.map +1 -1
  50. package/dist/array/difference.cjs +1 -1
  51. package/dist/array/difference.cjs.map +1 -1
  52. package/dist/array/difference.d.ts +4 -2
  53. package/dist/array/difference.d.ts.map +1 -1
  54. package/dist/array/difference.js +1 -13
  55. package/dist/array/difference.js.map +1 -1
  56. package/dist/array/drop.cjs +1 -1
  57. package/dist/array/drop.cjs.map +1 -1
  58. package/dist/array/drop.d.ts +1 -1
  59. package/dist/array/drop.d.ts.map +1 -1
  60. package/dist/array/drop.js +1 -8
  61. package/dist/array/drop.js.map +1 -1
  62. package/dist/array/dropLast.cjs +1 -1
  63. package/dist/array/dropLast.cjs.map +1 -1
  64. package/dist/array/dropLast.d.ts +1 -1
  65. package/dist/array/dropLast.d.ts.map +1 -1
  66. package/dist/array/dropLast.js +1 -8
  67. package/dist/array/dropLast.js.map +1 -1
  68. package/dist/array/filterMap.cjs +1 -1
  69. package/dist/array/filterMap.cjs.map +1 -1
  70. package/dist/array/filterMap.d.ts +3 -1
  71. package/dist/array/filterMap.d.ts.map +1 -1
  72. package/dist/array/filterMap.js +1 -12
  73. package/dist/array/filterMap.js.map +1 -1
  74. package/dist/array/first.cjs +1 -1
  75. package/dist/array/first.cjs.map +1 -1
  76. package/dist/array/first.d.ts +1 -1
  77. package/dist/array/first.d.ts.map +1 -1
  78. package/dist/array/first.js +1 -7
  79. package/dist/array/first.js.map +1 -1
  80. package/dist/array/groupBy.cjs +1 -1
  81. package/dist/array/groupBy.cjs.map +1 -1
  82. package/dist/array/groupBy.d.ts +1 -1
  83. package/dist/array/groupBy.d.ts.map +1 -1
  84. package/dist/array/groupBy.js +1 -13
  85. package/dist/array/groupBy.js.map +1 -1
  86. package/dist/array/index.cjs +1 -1
  87. package/dist/array/index.d.ts +0 -1
  88. package/dist/array/index.d.ts.map +1 -1
  89. package/dist/array/index.js +1 -29
  90. package/dist/array/indexBy.cjs +1 -1
  91. package/dist/array/indexBy.cjs.map +1 -1
  92. package/dist/array/indexBy.d.ts +1 -1
  93. package/dist/array/indexBy.d.ts.map +1 -1
  94. package/dist/array/indexBy.js +1 -13
  95. package/dist/array/indexBy.js.map +1 -1
  96. package/dist/array/intersection.cjs +1 -1
  97. package/dist/array/intersection.cjs.map +1 -1
  98. package/dist/array/intersection.d.ts +4 -2
  99. package/dist/array/intersection.d.ts.map +1 -1
  100. package/dist/array/intersection.js +1 -13
  101. package/dist/array/intersection.js.map +1 -1
  102. package/dist/array/last.cjs +1 -1
  103. package/dist/array/last.cjs.map +1 -1
  104. package/dist/array/last.d.ts +1 -1
  105. package/dist/array/last.d.ts.map +1 -1
  106. package/dist/array/last.js +1 -7
  107. package/dist/array/last.js.map +1 -1
  108. package/dist/array/partition.cjs +1 -1
  109. package/dist/array/partition.cjs.map +1 -1
  110. package/dist/array/partition.d.ts +3 -1
  111. package/dist/array/partition.d.ts.map +1 -1
  112. package/dist/array/partition.js +1 -9
  113. package/dist/array/partition.js.map +1 -1
  114. package/dist/array/replace.cjs +1 -1
  115. package/dist/array/replace.cjs.map +1 -1
  116. package/dist/array/replace.d.ts +2 -15
  117. package/dist/array/replace.d.ts.map +1 -1
  118. package/dist/array/replace.js +1 -12
  119. package/dist/array/replace.js.map +1 -1
  120. package/dist/array/rotate.cjs +1 -1
  121. package/dist/array/rotate.cjs.map +1 -1
  122. package/dist/array/rotate.d.ts +5 -17
  123. package/dist/array/rotate.d.ts.map +1 -1
  124. package/dist/array/rotate.js +1 -9
  125. package/dist/array/rotate.js.map +1 -1
  126. package/dist/array/search.cjs +1 -1
  127. package/dist/array/search.cjs.map +1 -1
  128. package/dist/array/search.js +1 -29
  129. package/dist/array/search.js.map +1 -1
  130. package/dist/array/sort.cjs +1 -1
  131. package/dist/array/sort.cjs.map +1 -1
  132. package/dist/array/sort.d.ts +2 -2
  133. package/dist/array/sort.d.ts.map +1 -1
  134. package/dist/array/sort.js +1 -14
  135. package/dist/array/sort.js.map +1 -1
  136. package/dist/array/take.cjs +1 -1
  137. package/dist/array/take.cjs.map +1 -1
  138. package/dist/array/take.d.ts +1 -1
  139. package/dist/array/take.d.ts.map +1 -1
  140. package/dist/array/take.js +1 -8
  141. package/dist/array/take.js.map +1 -1
  142. package/dist/array/takeLast.cjs +1 -1
  143. package/dist/array/takeLast.cjs.map +1 -1
  144. package/dist/array/takeLast.d.ts +1 -1
  145. package/dist/array/takeLast.d.ts.map +1 -1
  146. package/dist/array/takeLast.js +1 -8
  147. package/dist/array/takeLast.js.map +1 -1
  148. package/dist/array/toggle.cjs +1 -1
  149. package/dist/array/toggle.cjs.map +1 -1
  150. package/dist/array/toggle.d.ts +1 -1
  151. package/dist/array/toggle.d.ts.map +1 -1
  152. package/dist/array/toggle.js +1 -8
  153. package/dist/array/toggle.js.map +1 -1
  154. package/dist/array/union.cjs +1 -1
  155. package/dist/array/union.cjs.map +1 -1
  156. package/dist/array/union.d.ts +4 -2
  157. package/dist/array/union.d.ts.map +1 -1
  158. package/dist/array/union.js +1 -8
  159. package/dist/array/union.js.map +1 -1
  160. package/dist/array/uniq.cjs +1 -1
  161. package/dist/array/uniq.cjs.map +1 -1
  162. package/dist/array/uniq.d.ts +1 -1
  163. package/dist/array/uniq.d.ts.map +1 -1
  164. package/dist/array/uniq.js +1 -8
  165. package/dist/array/uniq.js.map +1 -1
  166. package/dist/array/unzip.cjs +1 -1
  167. package/dist/array/unzip.cjs.map +1 -1
  168. package/dist/array/unzip.js +1 -10
  169. package/dist/array/unzip.js.map +1 -1
  170. package/dist/array/zip.cjs +1 -1
  171. package/dist/array/zip.cjs.map +1 -1
  172. package/dist/array/zip.d.ts +1 -1
  173. package/dist/array/zip.d.ts.map +1 -1
  174. package/dist/array/zip.js +1 -10
  175. package/dist/array/zip.js.map +1 -1
  176. package/dist/arsenal.cjs +1 -1
  177. package/dist/arsenal.cjs.map +1 -1
  178. package/dist/arsenal.iife.js +1 -1
  179. package/dist/arsenal.iife.js.map +1 -1
  180. package/dist/arsenal.js +1 -1
  181. package/dist/arsenal.js.map +1 -1
  182. package/dist/async/abortError.cjs +1 -1
  183. package/dist/async/abortError.cjs.map +1 -1
  184. package/dist/async/abortError.d.ts +3 -2
  185. package/dist/async/abortError.d.ts.map +1 -1
  186. package/dist/async/abortError.js +1 -7
  187. package/dist/async/abortError.js.map +1 -1
  188. package/dist/async/abortable.cjs +1 -1
  189. package/dist/async/abortable.cjs.map +1 -1
  190. package/dist/async/abortable.js +1 -11
  191. package/dist/async/abortable.js.map +1 -1
  192. package/dist/async/attempt.cjs +1 -1
  193. package/dist/async/attempt.cjs.map +1 -1
  194. package/dist/async/attempt.js +1 -23
  195. package/dist/async/attempt.js.map +1 -1
  196. package/dist/async/backoff.cjs +1 -1
  197. package/dist/async/backoff.cjs.map +1 -1
  198. package/dist/async/backoff.js +1 -7
  199. package/dist/async/backoff.js.map +1 -1
  200. package/dist/async/index.js +1 -10
  201. package/dist/async/parallel.cjs +1 -1
  202. package/dist/async/parallel.cjs.map +1 -1
  203. package/dist/async/parallel.js +1 -24
  204. package/dist/async/parallel.js.map +1 -1
  205. package/dist/async/retry.cjs +1 -1
  206. package/dist/async/retry.cjs.map +1 -1
  207. package/dist/async/retry.d.ts +4 -6
  208. package/dist/async/retry.d.ts.map +1 -1
  209. package/dist/async/retry.js +1 -24
  210. package/dist/async/retry.js.map +1 -1
  211. package/dist/async/sleep.cjs +1 -1
  212. package/dist/async/sleep.cjs.map +1 -1
  213. package/dist/async/sleep.js +1 -15
  214. package/dist/async/sleep.js.map +1 -1
  215. package/dist/async/taskPool.cjs +1 -1
  216. package/dist/async/taskPool.cjs.map +1 -1
  217. package/dist/async/taskPool.js +1 -50
  218. package/dist/async/taskPool.js.map +1 -1
  219. package/dist/async/waitFor.cjs +1 -1
  220. package/dist/async/waitFor.cjs.map +1 -1
  221. package/dist/async/waitFor.js +1 -12
  222. package/dist/async/waitFor.js.map +1 -1
  223. package/dist/cache/cache.cjs +1 -1
  224. package/dist/cache/cache.cjs.map +1 -1
  225. package/dist/cache/cache.d.ts +1 -0
  226. package/dist/cache/cache.d.ts.map +1 -1
  227. package/dist/cache/cache.js +1 -58
  228. package/dist/cache/cache.js.map +1 -1
  229. package/dist/cache/index.js +1 -3
  230. package/dist/cache/memo.cjs +1 -1
  231. package/dist/cache/memo.cjs.map +1 -1
  232. package/dist/cache/memo.js +1 -37
  233. package/dist/cache/memo.js.map +1 -1
  234. package/dist/encoding/base64url.cjs +2 -0
  235. package/dist/encoding/base64url.cjs.map +1 -0
  236. package/dist/encoding/base64url.d.ts +9 -0
  237. package/dist/encoding/base64url.d.ts.map +1 -0
  238. package/dist/encoding/base64url.js +2 -0
  239. package/dist/encoding/base64url.js.map +1 -0
  240. package/dist/encoding/index.cjs +1 -0
  241. package/dist/encoding/index.d.ts +2 -0
  242. package/dist/encoding/index.d.ts.map +1 -0
  243. package/dist/encoding/index.js +1 -0
  244. package/dist/errors.cjs +1 -1
  245. package/dist/errors.cjs.map +1 -1
  246. package/dist/errors.js +1 -9
  247. package/dist/errors.js.map +1 -1
  248. package/dist/function/assert.cjs +1 -1
  249. package/dist/function/assert.cjs.map +1 -1
  250. package/dist/function/assert.d.ts +1 -1
  251. package/dist/function/assert.js +1 -7
  252. package/dist/function/assert.js.map +1 -1
  253. package/dist/function/debounce.cjs +1 -1
  254. package/dist/function/debounce.cjs.map +1 -1
  255. package/dist/function/debounce.js +1 -26
  256. package/dist/function/debounce.js.map +1 -1
  257. package/dist/function/index.cjs +1 -1
  258. package/dist/function/index.d.ts +1 -0
  259. package/dist/function/index.d.ts.map +1 -1
  260. package/dist/function/index.js +1 -8
  261. package/dist/function/once.cjs +1 -1
  262. package/dist/function/once.cjs.map +1 -1
  263. package/dist/function/once.js +1 -10
  264. package/dist/function/once.js.map +1 -1
  265. package/dist/function/pipe.cjs +1 -1
  266. package/dist/function/pipe.cjs.map +1 -1
  267. package/dist/function/pipe.js +1 -9
  268. package/dist/function/pipe.js.map +1 -1
  269. package/dist/function/runAll.cjs +1 -1
  270. package/dist/function/runAll.cjs.map +1 -1
  271. package/dist/function/runAll.js +1 -18
  272. package/dist/function/runAll.js.map +1 -1
  273. package/dist/function/tap.cjs +1 -1
  274. package/dist/function/tap.cjs.map +1 -1
  275. package/dist/function/tap.js +1 -7
  276. package/dist/function/tap.js.map +1 -1
  277. package/dist/function/tapper.cjs +2 -0
  278. package/dist/function/tapper.cjs.map +1 -0
  279. package/dist/function/tapper.d.ts +27 -0
  280. package/dist/function/tapper.d.ts.map +1 -0
  281. package/dist/function/tapper.js +2 -0
  282. package/dist/function/tapper.js.map +1 -0
  283. package/dist/function/throttle.cjs +1 -1
  284. package/dist/function/throttle.cjs.map +1 -1
  285. package/dist/function/throttle.js +1 -35
  286. package/dist/function/throttle.js.map +1 -1
  287. package/dist/guards/combinators.cjs +1 -1
  288. package/dist/guards/combinators.cjs.map +1 -1
  289. package/dist/guards/combinators.js +1 -16
  290. package/dist/guards/combinators.js.map +1 -1
  291. package/dist/guards/index.cjs +1 -1
  292. package/dist/guards/index.js +1 -17
  293. package/dist/guards/isAbortError.cjs +1 -1
  294. package/dist/guards/isAbortError.cjs.map +1 -1
  295. package/dist/guards/isAbortError.js +1 -7
  296. package/dist/guards/isAbortError.js.map +1 -1
  297. package/dist/guards/isDate.cjs +1 -1
  298. package/dist/guards/isDate.cjs.map +1 -1
  299. package/dist/guards/isDate.js +1 -7
  300. package/dist/guards/isDate.js.map +1 -1
  301. package/dist/guards/isDefined.cjs +1 -1
  302. package/dist/guards/isDefined.cjs.map +1 -1
  303. package/dist/guards/isDefined.js +1 -7
  304. package/dist/guards/isDefined.js.map +1 -1
  305. package/dist/guards/isEmpty.cjs +1 -1
  306. package/dist/guards/isEmpty.cjs.map +1 -1
  307. package/dist/guards/isEmpty.d.ts.map +1 -1
  308. package/dist/guards/isEmpty.js +1 -9
  309. package/dist/guards/isEmpty.js.map +1 -1
  310. package/dist/guards/isEqual.cjs +1 -1
  311. package/dist/guards/isEqual.cjs.map +1 -1
  312. package/dist/guards/isEqual.js +1 -33
  313. package/dist/guards/isEqual.js.map +1 -1
  314. package/dist/guards/isError.cjs +1 -1
  315. package/dist/guards/isError.cjs.map +1 -1
  316. package/dist/guards/isError.js +1 -7
  317. package/dist/guards/isError.js.map +1 -1
  318. package/dist/guards/isFunction.cjs +1 -1
  319. package/dist/guards/isFunction.cjs.map +1 -1
  320. package/dist/guards/isFunction.d.ts +1 -1
  321. package/dist/guards/isFunction.d.ts.map +1 -1
  322. package/dist/guards/isFunction.js +1 -7
  323. package/dist/guards/isFunction.js.map +1 -1
  324. package/dist/guards/isMatch.cjs +1 -1
  325. package/dist/guards/isMatch.cjs.map +1 -1
  326. package/dist/guards/isMatch.js +1 -22
  327. package/dist/guards/isMatch.js.map +1 -1
  328. package/dist/guards/isNil.cjs +1 -1
  329. package/dist/guards/isNil.cjs.map +1 -1
  330. package/dist/guards/isNil.js +1 -7
  331. package/dist/guards/isNil.js.map +1 -1
  332. package/dist/guards/isNumber.cjs +1 -1
  333. package/dist/guards/isNumber.cjs.map +1 -1
  334. package/dist/guards/isNumber.js +1 -7
  335. package/dist/guards/isNumber.js.map +1 -1
  336. package/dist/guards/isPlainObject.cjs +1 -1
  337. package/dist/guards/isPlainObject.cjs.map +1 -1
  338. package/dist/guards/isPlainObject.js +1 -9
  339. package/dist/guards/isPlainObject.js.map +1 -1
  340. package/dist/guards/isPrimitive.cjs +1 -1
  341. package/dist/guards/isPrimitive.cjs.map +1 -1
  342. package/dist/guards/isPrimitive.d.ts +4 -17
  343. package/dist/guards/isPrimitive.d.ts.map +1 -1
  344. package/dist/guards/isPrimitive.js +1 -8
  345. package/dist/guards/isPrimitive.js.map +1 -1
  346. package/dist/guards/isPromise.cjs +1 -1
  347. package/dist/guards/isPromise.cjs.map +1 -1
  348. package/dist/guards/isPromise.js +1 -7
  349. package/dist/guards/isPromise.js.map +1 -1
  350. package/dist/guards/isRegex.cjs +1 -1
  351. package/dist/guards/isRegex.cjs.map +1 -1
  352. package/dist/guards/isRegex.js +1 -7
  353. package/dist/guards/isRegex.js.map +1 -1
  354. package/dist/guards/shallowEqual.cjs +1 -1
  355. package/dist/guards/shallowEqual.cjs.map +1 -1
  356. package/dist/guards/shallowEqual.js +1 -19
  357. package/dist/guards/shallowEqual.js.map +1 -1
  358. package/dist/index.cjs +1 -1
  359. package/dist/index.d.ts +13 -1
  360. package/dist/index.d.ts.map +1 -1
  361. package/dist/index.js +1 -30
  362. package/dist/math/allocate.cjs +1 -1
  363. package/dist/math/allocate.cjs.map +1 -1
  364. package/dist/math/allocate.js +1 -18
  365. package/dist/math/allocate.js.map +1 -1
  366. package/dist/math/average.cjs +1 -1
  367. package/dist/math/average.cjs.map +1 -1
  368. package/dist/math/average.d.ts +3 -2
  369. package/dist/math/average.d.ts.map +1 -1
  370. package/dist/math/average.js +1 -13
  371. package/dist/math/average.js.map +1 -1
  372. package/dist/math/clamp.cjs +1 -1
  373. package/dist/math/clamp.cjs.map +1 -1
  374. package/dist/math/clamp.js +1 -7
  375. package/dist/math/clamp.js.map +1 -1
  376. package/dist/math/gcd.cjs +1 -1
  377. package/dist/math/gcd.cjs.map +1 -1
  378. package/dist/math/gcd.d.ts.map +1 -1
  379. package/dist/math/gcd.js +1 -12
  380. package/dist/math/gcd.js.map +1 -1
  381. package/dist/math/index.cjs +1 -1
  382. package/dist/math/index.d.ts +0 -1
  383. package/dist/math/index.d.ts.map +1 -1
  384. package/dist/math/index.js +1 -17
  385. package/dist/math/lcm.cjs +1 -1
  386. package/dist/math/lcm.cjs.map +1 -1
  387. package/dist/math/lcm.d.ts.map +1 -1
  388. package/dist/math/lcm.js +1 -8
  389. package/dist/math/lcm.js.map +1 -1
  390. package/dist/math/lerp.cjs +1 -1
  391. package/dist/math/lerp.cjs.map +1 -1
  392. package/dist/math/lerp.js +1 -7
  393. package/dist/math/lerp.js.map +1 -1
  394. package/dist/math/linspace.cjs +1 -1
  395. package/dist/math/linspace.cjs.map +1 -1
  396. package/dist/math/linspace.d.ts.map +1 -1
  397. package/dist/math/linspace.js +1 -10
  398. package/dist/math/linspace.js.map +1 -1
  399. package/dist/math/median.cjs +1 -1
  400. package/dist/math/median.cjs.map +1 -1
  401. package/dist/math/median.d.ts +1 -1
  402. package/dist/math/median.d.ts.map +1 -1
  403. package/dist/math/median.js +1 -11
  404. package/dist/math/median.js.map +1 -1
  405. package/dist/math/mod.cjs +1 -1
  406. package/dist/math/mod.cjs.map +1 -1
  407. package/dist/math/mod.js +1 -8
  408. package/dist/math/mod.js.map +1 -1
  409. package/dist/math/normalize.cjs +1 -1
  410. package/dist/math/normalize.cjs.map +1 -1
  411. package/dist/math/normalize.js +1 -8
  412. package/dist/math/normalize.js.map +1 -1
  413. package/dist/math/range.cjs +1 -1
  414. package/dist/math/range.cjs.map +1 -1
  415. package/dist/math/range.js +1 -25
  416. package/dist/math/range.js.map +1 -1
  417. package/dist/math/round.cjs +1 -1
  418. package/dist/math/round.cjs.map +1 -1
  419. package/dist/math/round.js +1 -9
  420. package/dist/math/round.js.map +1 -1
  421. package/dist/math/standardDeviation.cjs +1 -1
  422. package/dist/math/standardDeviation.cjs.map +1 -1
  423. package/dist/math/standardDeviation.d.ts +1 -1
  424. package/dist/math/standardDeviation.d.ts.map +1 -1
  425. package/dist/math/standardDeviation.js +1 -8
  426. package/dist/math/standardDeviation.js.map +1 -1
  427. package/dist/math/sum.cjs +1 -1
  428. package/dist/math/sum.cjs.map +1 -1
  429. package/dist/math/sum.d.ts +1 -1
  430. package/dist/math/sum.d.ts.map +1 -1
  431. package/dist/math/sum.js +1 -11
  432. package/dist/math/sum.js.map +1 -1
  433. package/dist/math/variance.cjs +1 -1
  434. package/dist/math/variance.cjs.map +1 -1
  435. package/dist/math/variance.d.ts +1 -1
  436. package/dist/math/variance.d.ts.map +1 -1
  437. package/dist/math/variance.js +1 -10
  438. package/dist/math/variance.js.map +1 -1
  439. package/dist/object/defaults.cjs +1 -1
  440. package/dist/object/defaults.cjs.map +1 -1
  441. package/dist/object/defaults.js +1 -11
  442. package/dist/object/defaults.js.map +1 -1
  443. package/dist/object/diff.cjs +1 -1
  444. package/dist/object/diff.cjs.map +1 -1
  445. package/dist/object/diff.d.ts +1 -1
  446. package/dist/object/diff.d.ts.map +1 -1
  447. package/dist/object/diff.js +1 -26
  448. package/dist/object/diff.js.map +1 -1
  449. package/dist/object/filterValues.cjs +1 -1
  450. package/dist/object/filterValues.cjs.map +1 -1
  451. package/dist/object/filterValues.js +1 -10
  452. package/dist/object/filterValues.js.map +1 -1
  453. package/dist/object/flattenPaths.cjs +1 -1
  454. package/dist/object/flattenPaths.cjs.map +1 -1
  455. package/dist/object/flattenPaths.js +1 -30
  456. package/dist/object/flattenPaths.js.map +1 -1
  457. package/dist/object/getPath.cjs +1 -1
  458. package/dist/object/getPath.cjs.map +1 -1
  459. package/dist/object/getPath.js +1 -25
  460. package/dist/object/getPath.js.map +1 -1
  461. package/dist/object/hash.cjs +1 -1
  462. package/dist/object/hash.cjs.map +1 -1
  463. package/dist/object/hash.js +1 -27
  464. package/dist/object/hash.js.map +1 -1
  465. package/dist/object/index.js +1 -15
  466. package/dist/object/invert.cjs +1 -1
  467. package/dist/object/invert.cjs.map +1 -1
  468. package/dist/object/invert.js +1 -10
  469. package/dist/object/invert.js.map +1 -1
  470. package/dist/object/mapKeys.cjs +1 -1
  471. package/dist/object/mapKeys.cjs.map +1 -1
  472. package/dist/object/mapKeys.js +1 -14
  473. package/dist/object/mapKeys.js.map +1 -1
  474. package/dist/object/mapValues.cjs +1 -1
  475. package/dist/object/mapValues.cjs.map +1 -1
  476. package/dist/object/mapValues.js +1 -10
  477. package/dist/object/mapValues.js.map +1 -1
  478. package/dist/object/merge.cjs +1 -1
  479. package/dist/object/merge.cjs.map +1 -1
  480. package/dist/object/merge.js +1 -25
  481. package/dist/object/merge.js.map +1 -1
  482. package/dist/object/omit.cjs +1 -1
  483. package/dist/object/omit.cjs.map +1 -1
  484. package/dist/object/omit.js +1 -10
  485. package/dist/object/omit.js.map +1 -1
  486. package/dist/object/pick.cjs +1 -1
  487. package/dist/object/pick.cjs.map +1 -1
  488. package/dist/object/pick.js +1 -10
  489. package/dist/object/pick.js.map +1 -1
  490. package/dist/object/prune.cjs +1 -1
  491. package/dist/object/prune.cjs.map +1 -1
  492. package/dist/object/prune.d.ts.map +1 -1
  493. package/dist/object/prune.js +1 -34
  494. package/dist/object/prune.js.map +1 -1
  495. package/dist/object/tryParseJson.cjs +1 -1
  496. package/dist/object/tryParseJson.cjs.map +1 -1
  497. package/dist/object/tryParseJson.js +1 -17
  498. package/dist/object/tryParseJson.js.map +1 -1
  499. package/dist/random/_index.cjs +1 -1
  500. package/dist/random/_index.cjs.map +1 -1
  501. package/dist/random/_index.d.ts +1 -1
  502. package/dist/random/_index.d.ts.map +1 -1
  503. package/dist/random/_index.js +1 -9
  504. package/dist/random/_index.js.map +1 -1
  505. package/dist/random/draw.cjs +1 -1
  506. package/dist/random/draw.cjs.map +1 -1
  507. package/dist/random/draw.js +1 -20
  508. package/dist/random/draw.js.map +1 -1
  509. package/dist/random/index.cjs +1 -1
  510. package/dist/random/index.d.ts +0 -1
  511. package/dist/random/index.d.ts.map +1 -1
  512. package/dist/random/index.js +1 -5
  513. package/dist/random/random.cjs +1 -1
  514. package/dist/random/random.cjs.map +1 -1
  515. package/dist/random/random.js +1 -9
  516. package/dist/random/random.js.map +1 -1
  517. package/dist/random/shuffle.cjs +1 -1
  518. package/dist/random/shuffle.cjs.map +1 -1
  519. package/dist/random/shuffle.js +1 -13
  520. package/dist/random/shuffle.js.map +1 -1
  521. package/dist/random/source.cjs +2 -0
  522. package/dist/random/source.cjs.map +1 -0
  523. package/dist/random/source.d.ts +2 -0
  524. package/dist/random/source.d.ts.map +1 -1
  525. package/dist/random/source.js +2 -0
  526. package/dist/random/source.js.map +1 -0
  527. package/dist/string/_caseUtils.cjs +1 -1
  528. package/dist/string/_caseUtils.cjs.map +1 -1
  529. package/dist/string/_caseUtils.js +1 -12
  530. package/dist/string/_caseUtils.js.map +1 -1
  531. package/dist/string/camelCase.cjs +1 -1
  532. package/dist/string/camelCase.cjs.map +1 -1
  533. package/dist/string/camelCase.js +1 -8
  534. package/dist/string/camelCase.js.map +1 -1
  535. package/dist/string/escape.cjs +1 -1
  536. package/dist/string/escape.cjs.map +1 -1
  537. package/dist/string/escape.js +1 -14
  538. package/dist/string/escape.js.map +1 -1
  539. package/dist/string/index.cjs +1 -1
  540. package/dist/string/index.d.ts +1 -1
  541. package/dist/string/index.d.ts.map +1 -1
  542. package/dist/string/index.js +1 -12
  543. package/dist/string/kebabCase.cjs +1 -1
  544. package/dist/string/kebabCase.cjs.map +1 -1
  545. package/dist/string/kebabCase.js +1 -8
  546. package/dist/string/kebabCase.js.map +1 -1
  547. package/dist/string/padCenter.cjs +2 -0
  548. package/dist/string/padCenter.cjs.map +1 -0
  549. package/dist/string/padCenter.d.ts +3 -0
  550. package/dist/string/padCenter.d.ts.map +1 -0
  551. package/dist/string/padCenter.js +2 -0
  552. package/dist/string/padCenter.js.map +1 -0
  553. package/dist/string/pascalCase.cjs +1 -1
  554. package/dist/string/pascalCase.cjs.map +1 -1
  555. package/dist/string/pascalCase.js +1 -8
  556. package/dist/string/pascalCase.js.map +1 -1
  557. package/dist/string/similarity.cjs +1 -1
  558. package/dist/string/similarity.cjs.map +1 -1
  559. package/dist/string/similarity.js +1 -22
  560. package/dist/string/similarity.js.map +1 -1
  561. package/dist/string/snakeCase.cjs +1 -1
  562. package/dist/string/snakeCase.cjs.map +1 -1
  563. package/dist/string/snakeCase.js +1 -8
  564. package/dist/string/snakeCase.js.map +1 -1
  565. package/dist/string/titleCase.cjs +1 -1
  566. package/dist/string/titleCase.cjs.map +1 -1
  567. package/dist/string/titleCase.js +1 -8
  568. package/dist/string/titleCase.js.map +1 -1
  569. package/dist/string/truncate.cjs +1 -1
  570. package/dist/string/truncate.cjs.map +1 -1
  571. package/dist/string/truncate.js +1 -15
  572. package/dist/string/truncate.js.map +1 -1
  573. package/dist/string/unescape.cjs +1 -1
  574. package/dist/string/unescape.cjs.map +1 -1
  575. package/dist/string/unescape.js +1 -14
  576. package/dist/string/unescape.js.map +1 -1
  577. package/dist/string/words.cjs +1 -1
  578. package/dist/string/words.cjs.map +1 -1
  579. package/dist/string/words.js +1 -9
  580. package/dist/string/words.js.map +1 -1
  581. package/dist/types.d.ts +10 -0
  582. package/dist/types.d.ts.map +1 -1
  583. package/package.json +16 -8
  584. package/dist/array/flatten.cjs +0 -2
  585. package/dist/array/flatten.cjs.map +0 -1
  586. package/dist/array/flatten.d.ts +0 -5
  587. package/dist/array/flatten.d.ts.map +0 -1
  588. package/dist/array/flatten.js +0 -11
  589. package/dist/array/flatten.js.map +0 -1
  590. package/dist/math/percent.cjs +0 -2
  591. package/dist/math/percent.cjs.map +0 -1
  592. package/dist/math/percent.d.ts +0 -19
  593. package/dist/math/percent.d.ts.map +0 -1
  594. package/dist/math/percent.js +0 -8
  595. package/dist/math/percent.js.map +0 -1
  596. package/dist/random/uuid.cjs +0 -2
  597. package/dist/random/uuid.cjs.map +0 -1
  598. package/dist/random/uuid.d.ts +0 -12
  599. package/dist/random/uuid.d.ts.map +0 -1
  600. package/dist/random/uuid.js +0 -8
  601. package/dist/random/uuid.js.map +0 -1
  602. package/dist/string/pad.cjs +0 -2
  603. package/dist/string/pad.cjs.map +0 -1
  604. package/dist/string/pad.d.ts +0 -5
  605. package/dist/string/pad.d.ts.map +0 -1
  606. package/dist/string/pad.js +0 -10
  607. package/dist/string/pad.js.map +0 -1
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # @vielzeug/arsenal
2
2
 
3
- > Tree-shakeable, zero-dependency TypeScript utilities with focused category entry points.
4
-
5
- [![npm version](https://img.shields.io/npm/v/@vielzeug/arsenal)](https://www.npmjs.com/package/@vielzeug/arsenal) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ > Non-trivial TypeScript utilities — retry, cancellation, cache, safe-path, serialization, prototype-pollution-guarded collections
6
4
 
7
5
  ## Installation
8
6
 
@@ -15,7 +13,7 @@ yarn add @vielzeug/arsenal
15
13
  ## Quick Start
16
14
 
17
15
  ```ts
18
- import { chunk, groupBy, retry } from '@vielzeug/arsenal';
16
+ import { groupBy, retry } from '@vielzeug/arsenal';
19
17
  import { fuzzyFilter } from '@vielzeug/arsenal/array';
20
18
  import { taskPool } from '@vielzeug/arsenal/async';
21
19
  import { cache } from '@vielzeug/arsenal/cache';
@@ -30,30 +28,19 @@ const data = await pool.run((signal) => retry(() => fetch('/api', { signal }).th
30
28
 
31
29
  const responses = cache<string, unknown>({ ttlMs: 60_000 });
32
30
  const profile = await responses.getOrLoad('/profile', () => fetch('/profile').then((response) => response.json()));
31
+ const cachedResponses = responses.entries();
33
32
 
34
- console.log(chunk([1, 2, 3], 2), groupBy(matches, (user) => user.name), data, profile);
33
+ console.log(groupBy(matches, (user) => user.name), data, profile, cachedResponses);
35
34
  pool.dispose();
36
35
  ```
37
36
 
38
- ## Entry Points
39
-
40
- - `@vielzeug/arsenal` — curated common utilities
41
- - `@vielzeug/arsenal/array` — array transforms and fuzzy search
42
- - `@vielzeug/arsenal/async` — cancellation, retry, task pools, timing
43
- - `@vielzeug/arsenal/cache` — in-memory cache and memoization
44
- - `@vielzeug/arsenal/function` — function composition and timing
45
- - `@vielzeug/arsenal/guards` — type guards and predicates
46
- - `@vielzeug/arsenal/math` — numeric and statistical helpers
47
- - `@vielzeug/arsenal/object` — object transforms, paths, hash, JSON parsing result
48
- - `@vielzeug/arsenal/random` — cryptographic random helpers
49
- - `@vielzeug/arsenal/string` — text transforms and similarity
50
-
51
37
  ## Documentation
52
38
 
53
39
  - [Overview](https://vielzeug.dev/arsenal/)
54
40
  - [Usage Guide](https://vielzeug.dev/arsenal/usage)
55
41
  - [API Reference](https://vielzeug.dev/arsenal/api)
56
42
  - [Examples](https://vielzeug.dev/arsenal/examples)
43
+ - [Migration Guide](https://vielzeug.dev/arsenal/migration)
57
44
 
58
45
  ## License
59
46
 
@@ -1,2 +1,2 @@
1
- var e=class extends Map{maxSize;constructor(e){super(),this.maxSize=e}set(e,t){return this.has(e)&&this.delete(e),super.set(e,t),this.size>this.maxSize&&this.evictOldest(),this}evictOldest(e=()=>!0){for(let[t,n]of this)if(e(t,n))return this.delete(t),!0;return!1}};exports.LruMap=e;
1
+ var LruMap=class extends Map{maxSize;constructor(e){super(),this.maxSize=e}set(e,t){return this.has(e)&&this.delete(e),super.set(e,t),this.size>this.maxSize&&this.evictOldest(),this}evictOldest(e=()=>!0){for(let[t,n]of this)if(e(t,n))return this.delete(t),!0;return!1}};exports.LruMap=LruMap;
2
2
  //# sourceMappingURL=_lruMap.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"_lruMap.cjs","names":[],"sources":["../../src/_common/_lruMap.ts"],"sourcesContent":["/**\n * A Map subclass that evicts the oldest non-excluded entry when the map exceeds\n * `maxSize`. Iteration order (insertion order) determines LRU — the first key\n * returned by `keys()` is the oldest.\n *\n * Calling `set` on an existing key refreshes its position (move-to-end).\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n */\nexport class LruMap<K, V> extends Map<K, V> {\n readonly maxSize: number;\n\n constructor(maxSize: number) {\n super();\n this.maxSize = maxSize;\n }\n\n override set(key: K, value: V): this {\n // Move existing entry to the end (most-recently-used position)\n if (this.has(key)) this.delete(key);\n\n super.set(key, value);\n\n // Evict oldest entry if we've exceeded maxSize\n if (this.size > this.maxSize) this.evictOldest();\n\n return this;\n }\n\n /**\n * Evicts the oldest entry for which `canEvict` returns true.\n * Returns `true` if an entry was evicted, `false` if all entries are guarded.\n */\n evictOldest(canEvict: (key: K, value: V) => boolean = () => true): boolean {\n for (const [k, v] of this) {\n if (canEvict(k, v)) {\n this.delete(k);\n\n return true;\n }\n }\n\n return false;\n }\n}\n"],"mappings":"AASA,IAAa,EAAb,cAAkC,GAAU,CAC1C,QAEA,YAAY,EAAiB,CAC3B,MAAM,EACN,KAAK,QAAU,CACjB,CAEA,IAAa,EAAQ,EAAgB,CASnC,OAPI,KAAK,IAAI,CAAG,GAAG,KAAK,OAAO,CAAG,EAElC,MAAM,IAAI,EAAK,CAAK,EAGhB,KAAK,KAAO,KAAK,SAAS,KAAK,YAAY,EAExC,IACT,CAMA,YAAY,MAAgD,GAAe,CACzE,IAAK,GAAM,CAAC,EAAG,KAAM,KACnB,GAAI,EAAS,EAAG,CAAC,EAGf,OAFA,KAAK,OAAO,CAAC,EAEN,GAIX,MAAO,EACT,CACF"}
1
+ {"version":3,"file":"_lruMap.cjs","names":[],"sources":["../../src/_common/_lruMap.ts"],"sourcesContent":["/**\n * A Map subclass that evicts the oldest non-excluded entry when the map exceeds\n * `maxSize`. Iteration order (insertion order) determines LRU — the first key\n * returned by `keys()` is the oldest.\n *\n * Calling `set` on an existing key refreshes its position (move-to-end).\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n */\nexport class LruMap<K, V> extends Map<K, V> {\n readonly maxSize: number;\n\n constructor(maxSize: number) {\n super();\n this.maxSize = maxSize;\n }\n\n override set(key: K, value: V): this {\n // Move existing entry to the end (most-recently-used position)\n if (this.has(key)) this.delete(key);\n\n super.set(key, value);\n\n // Evict oldest entry if we've exceeded maxSize\n if (this.size > this.maxSize) this.evictOldest();\n\n return this;\n }\n\n /**\n * Evicts the oldest entry for which `canEvict` returns true.\n * Returns `true` if an entry was evicted, `false` if all entries are guarded.\n */\n evictOldest(canEvict: (key: K, value: V) => boolean = () => true): boolean {\n for (const [k, v] of this) {\n if (canEvict(k, v)) {\n this.delete(k);\n\n return true;\n }\n }\n\n return false;\n }\n}\n"],"mappings":"AASA,IAAa,OAAb,cAAkC,GAAU,CAC1C,QAEA,YAAY,EAAiB,CAC3B,MAAM,EACN,KAAK,QAAU,CACjB,CAEA,IAAa,EAAQ,EAAgB,CASnC,OAPI,KAAK,IAAI,CAAG,GAAG,KAAK,OAAO,CAAG,EAElC,MAAM,IAAI,EAAK,CAAK,EAGhB,KAAK,KAAO,KAAK,SAAS,KAAK,YAAY,EAExC,IACT,CAMA,YAAY,MAAgD,GAAe,CACzE,IAAK,GAAM,CAAC,EAAG,KAAM,KACnB,GAAI,EAAS,EAAG,CAAC,EAGf,OAFA,KAAK,OAAO,CAAC,EAEN,GAIX,MAAO,EACT,CACF"}
@@ -1,18 +1,2 @@
1
- //#region src/_common/_lruMap.ts
2
- var e = class extends Map {
3
- maxSize;
4
- constructor(e) {
5
- super(), this.maxSize = e;
6
- }
7
- set(e, t) {
8
- return this.has(e) && this.delete(e), super.set(e, t), this.size > this.maxSize && this.evictOldest(), this;
9
- }
10
- evictOldest(e = () => !0) {
11
- for (let [t, n] of this) if (e(t, n)) return this.delete(t), !0;
12
- return !1;
13
- }
14
- };
15
- //#endregion
16
- export { e as LruMap };
17
-
1
+ var LruMap=class extends Map{maxSize;constructor(e){super(),this.maxSize=e}set(e,t){return this.has(e)&&this.delete(e),super.set(e,t),this.size>this.maxSize&&this.evictOldest(),this}evictOldest(e=()=>!0){for(let[t,n]of this)if(e(t,n))return this.delete(t),!0;return!1}};export{LruMap};
18
2
  //# sourceMappingURL=_lruMap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_lruMap.js","names":[],"sources":["../../src/_common/_lruMap.ts"],"sourcesContent":["/**\n * A Map subclass that evicts the oldest non-excluded entry when the map exceeds\n * `maxSize`. Iteration order (insertion order) determines LRU — the first key\n * returned by `keys()` is the oldest.\n *\n * Calling `set` on an existing key refreshes its position (move-to-end).\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n */\nexport class LruMap<K, V> extends Map<K, V> {\n readonly maxSize: number;\n\n constructor(maxSize: number) {\n super();\n this.maxSize = maxSize;\n }\n\n override set(key: K, value: V): this {\n // Move existing entry to the end (most-recently-used position)\n if (this.has(key)) this.delete(key);\n\n super.set(key, value);\n\n // Evict oldest entry if we've exceeded maxSize\n if (this.size > this.maxSize) this.evictOldest();\n\n return this;\n }\n\n /**\n * Evicts the oldest entry for which `canEvict` returns true.\n * Returns `true` if an entry was evicted, `false` if all entries are guarded.\n */\n evictOldest(canEvict: (key: K, value: V) => boolean = () => true): boolean {\n for (const [k, v] of this) {\n if (canEvict(k, v)) {\n this.delete(k);\n\n return true;\n }\n }\n\n return false;\n }\n}\n"],"mappings":";AASA,IAAa,IAAb,cAAkC,IAAU;CAC1C;CAEA,YAAY,GAAiB;EAE3B,AADA,MAAM,GACN,KAAK,UAAU;CACjB;CAEA,IAAa,GAAQ,GAAgB;EASnC,OAPI,KAAK,IAAI,CAAG,KAAG,KAAK,OAAO,CAAG,GAElC,MAAM,IAAI,GAAK,CAAK,GAGhB,KAAK,OAAO,KAAK,WAAS,KAAK,YAAY,GAExC;CACT;CAMA,YAAY,UAAgD,IAAe;EACzE,KAAK,IAAM,CAAC,GAAG,MAAM,MACnB,IAAI,EAAS,GAAG,CAAC,GAGf,OAFA,KAAK,OAAO,CAAC,GAEN;EAIX,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"_lruMap.js","names":[],"sources":["../../src/_common/_lruMap.ts"],"sourcesContent":["/**\n * A Map subclass that evicts the oldest non-excluded entry when the map exceeds\n * `maxSize`. Iteration order (insertion order) determines LRU — the first key\n * returned by `keys()` is the oldest.\n *\n * Calling `set` on an existing key refreshes its position (move-to-end).\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n */\nexport class LruMap<K, V> extends Map<K, V> {\n readonly maxSize: number;\n\n constructor(maxSize: number) {\n super();\n this.maxSize = maxSize;\n }\n\n override set(key: K, value: V): this {\n // Move existing entry to the end (most-recently-used position)\n if (this.has(key)) this.delete(key);\n\n super.set(key, value);\n\n // Evict oldest entry if we've exceeded maxSize\n if (this.size > this.maxSize) this.evictOldest();\n\n return this;\n }\n\n /**\n * Evicts the oldest entry for which `canEvict` returns true.\n * Returns `true` if an entry was evicted, `false` if all entries are guarded.\n */\n evictOldest(canEvict: (key: K, value: V) => boolean = () => true): boolean {\n for (const [k, v] of this) {\n if (canEvict(k, v)) {\n this.delete(k);\n\n return true;\n }\n }\n\n return false;\n }\n}\n"],"mappings":"AASA,IAAa,OAAb,cAAkC,GAAU,CAC1C,QAEA,YAAY,EAAiB,CAC3B,MAAM,EACN,KAAK,QAAU,CACjB,CAEA,IAAa,EAAQ,EAAgB,CASnC,OAPI,KAAK,IAAI,CAAG,GAAG,KAAK,OAAO,CAAG,EAElC,MAAM,IAAI,EAAK,CAAK,EAGhB,KAAK,KAAO,KAAK,SAAS,KAAK,YAAY,EAExC,IACT,CAMA,YAAY,MAAgD,GAAe,CACzE,IAAK,GAAM,CAAC,EAAG,KAAM,KACnB,GAAI,EAAS,EAAG,CAAC,EAGf,OAFA,KAAK,OAAO,CAAC,EAEN,GAIX,MAAO,EACT,CACF"}
@@ -1,2 +1,2 @@
1
- function e(e,t){return new Set(e.map(e=>t(e)))}function t(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}exports.dedupeBySelector=t,exports.toSelectorSet=e;
1
+ function toSelectorSet(e,t){return new Set(e.map(e=>t(e)))}function dedupeBySelector(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}exports.dedupeBySelector=dedupeBySelector,exports.toSelectorSet=toSelectorSet;
2
2
  //# sourceMappingURL=_selectorSet.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"_selectorSet.cjs","names":[],"sources":["../../src/_common/_selectorSet.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Builds a `Set` of `selector(item)` results for O(1) membership checks — shared by\n * `intersection()` and `difference()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function toSelectorSet<T>(items: readonly T[], selector: (item: T) => Primitive): Set<Primitive> {\n return new Set(items.map((item) => selector(item)));\n}\n\n/**\n * Returns `items` with duplicate `selector(item)` results removed, preserving the first\n * occurrence of each key — shared by `union()` and `uniq()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function dedupeBySelector<T>(items: readonly T[], selector: (item: T) => Primitive): T[] {\n const seen = new Set<Primitive>();\n const out: T[] = [];\n\n for (const item of items) {\n const key = selector(item);\n\n if (seen.has(key)) continue;\n\n seen.add(key);\n out.push(item);\n }\n\n return out;\n}\n"],"mappings":"AASA,SAAgB,EAAiB,EAAqB,EAAkD,CACtG,OAAO,IAAI,IAAI,EAAM,IAAK,GAAS,EAAS,CAAI,CAAC,CAAC,CACpD,CASA,SAAgB,EAAoB,EAAqB,EAAuC,CAC9F,IAAM,EAAO,IAAI,IACX,EAAW,CAAC,EAElB,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAS,CAAI,EAErB,EAAK,IAAI,CAAG,IAEhB,EAAK,IAAI,CAAG,EACZ,EAAI,KAAK,CAAI,EACf,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"_selectorSet.cjs","names":[],"sources":["../../src/_common/_selectorSet.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Builds a `Set` of `selector(item)` results for O(1) membership checks — shared by\n * `intersection()` and `difference()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function toSelectorSet<T>(items: readonly T[], selector: (item: T) => Primitive): Set<Primitive> {\n return new Set(items.map((item) => selector(item)));\n}\n\n/**\n * Returns `items` with duplicate `selector(item)` results removed, preserving the first\n * occurrence of each key — shared by `union()` and `uniq()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function dedupeBySelector<T>(items: readonly T[], selector: (item: T) => Primitive): T[] {\n const seen = new Set<Primitive>();\n const out: T[] = [];\n\n for (const item of items) {\n const key = selector(item);\n\n if (seen.has(key)) continue;\n\n seen.add(key);\n out.push(item);\n }\n\n return out;\n}\n"],"mappings":"AASA,SAAgB,cAAiB,EAAqB,EAAkD,CACtG,OAAO,IAAI,IAAI,EAAM,IAAK,GAAS,EAAS,CAAI,CAAC,CAAC,CACpD,CASA,SAAgB,iBAAoB,EAAqB,EAAuC,CAC9F,IAAM,EAAO,IAAI,IACX,EAAW,CAAC,EAElB,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAS,CAAI,EAErB,EAAK,IAAI,CAAG,IAEhB,EAAK,IAAI,CAAG,EACZ,EAAI,KAAK,CAAI,EACf,CAEA,OAAO,CACT"}
@@ -1,16 +1,2 @@
1
- //#region src/_common/_selectorSet.ts
2
- function e(e, t) {
3
- return new Set(e.map((e) => t(e)));
4
- }
5
- function t(e, t) {
6
- let n = /* @__PURE__ */ new Set(), r = [];
7
- for (let i of e) {
8
- let e = t(i);
9
- n.has(e) || (n.add(e), r.push(i));
10
- }
11
- return r;
12
- }
13
- //#endregion
14
- export { t as dedupeBySelector, e as toSelectorSet };
15
-
1
+ function toSelectorSet(e,t){return new Set(e.map(e=>t(e)))}function dedupeBySelector(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}export{dedupeBySelector,toSelectorSet};
16
2
  //# sourceMappingURL=_selectorSet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_selectorSet.js","names":[],"sources":["../../src/_common/_selectorSet.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Builds a `Set` of `selector(item)` results for O(1) membership checks — shared by\n * `intersection()` and `difference()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function toSelectorSet<T>(items: readonly T[], selector: (item: T) => Primitive): Set<Primitive> {\n return new Set(items.map((item) => selector(item)));\n}\n\n/**\n * Returns `items` with duplicate `selector(item)` results removed, preserving the first\n * occurrence of each key — shared by `union()` and `uniq()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function dedupeBySelector<T>(items: readonly T[], selector: (item: T) => Primitive): T[] {\n const seen = new Set<Primitive>();\n const out: T[] = [];\n\n for (const item of items) {\n const key = selector(item);\n\n if (seen.has(key)) continue;\n\n seen.add(key);\n out.push(item);\n }\n\n return out;\n}\n"],"mappings":";AASA,SAAgB,EAAiB,GAAqB,GAAkD;CACtG,OAAO,IAAI,IAAI,EAAM,KAAK,MAAS,EAAS,CAAI,CAAC,CAAC;AACpD;AASA,SAAgB,EAAoB,GAAqB,GAAuC;CAC9F,IAAM,oBAAO,IAAI,IAAe,GAC1B,IAAW,CAAC;CAElB,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAM,EAAS,CAAI;EAErB,EAAK,IAAI,CAAG,MAEhB,EAAK,IAAI,CAAG,GACZ,EAAI,KAAK,CAAI;CACf;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"_selectorSet.js","names":[],"sources":["../../src/_common/_selectorSet.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Builds a `Set` of `selector(item)` results for O(1) membership checks — shared by\n * `intersection()` and `difference()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function toSelectorSet<T>(items: readonly T[], selector: (item: T) => Primitive): Set<Primitive> {\n return new Set(items.map((item) => selector(item)));\n}\n\n/**\n * Returns `items` with duplicate `selector(item)` results removed, preserving the first\n * occurrence of each key — shared by `union()` and `uniq()`.\n *\n * Module-private: underscore-prefixed file is excluded from barrel exports.\n * @internal\n */\nexport function dedupeBySelector<T>(items: readonly T[], selector: (item: T) => Primitive): T[] {\n const seen = new Set<Primitive>();\n const out: T[] = [];\n\n for (const item of items) {\n const key = selector(item);\n\n if (seen.has(key)) continue;\n\n seen.add(key);\n out.push(item);\n }\n\n return out;\n}\n"],"mappings":"AASA,SAAgB,cAAiB,EAAqB,EAAkD,CACtG,OAAO,IAAI,IAAI,EAAM,IAAK,GAAS,EAAS,CAAI,CAAC,CAAC,CACpD,CASA,SAAgB,iBAAoB,EAAqB,EAAuC,CAC9F,IAAM,EAAO,IAAI,IACX,EAAW,CAAC,EAElB,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAS,CAAI,EAErB,EAAK,IAAI,CAAG,IAEhB,EAAK,IAAI,CAAG,EACZ,EAAI,KAAK,CAAI,EACf,CAEA,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- var e=new Set([`__proto__`,`constructor`,`prototype`]);function t(t){return typeof t==`string`&&e.has(t)}exports.UNSAFE_PATH_SEGMENTS=e,exports.isUnsafeKey=t;
1
+ var e=new Set([`__proto__`,`constructor`,`prototype`]);function isUnsafeKey(t){return typeof t==`string`&&e.has(t)}exports.UNSAFE_PATH_SEGMENTS=e,exports.isUnsafeKey=isUnsafeKey;
2
2
  //# sourceMappingURL=unsafePaths.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"unsafePaths.cjs","names":[],"sources":["../../src/_common/unsafePaths.ts"],"sourcesContent":["/**\n * Path segments that must be rejected in any dot-notation traversal or mutation\n * to prevent prototype pollution reads and writes.\n * @internal\n */\nexport const UNSAFE_PATH_SEGMENTS = new Set(['__proto__', 'constructor', 'prototype']);\n\n/**\n * Returns `true` if every dot-notation segment in `key` is safe to use as a\n * plain-object property.\n *\n * @example\n * ```ts\n * isSafePath('user.name') // true\n * isSafePath('__proto__.polluted') // false\n * ```\n */\nexport function isSafePath(key: string): boolean {\n return key.split('.').every((s) => !UNSAFE_PATH_SEGMENTS.has(s));\n}\n\n/**\n * Returns `true` if `key` is one of the dangerous own-property names that can be used to\n * pollute `Object.prototype` (`__proto__`, `constructor`, `prototype`). Use this for plain\n * (non-dotted) property keys — e.g. object keys being copied or reassigned. For dotted paths,\n * use `isSafePath` instead.\n *\n * @example\n * ```ts\n * isUnsafeKey('name') // false\n * isUnsafeKey('__proto__') // true\n * ```\n */\nexport function isUnsafeKey(key: PropertyKey): boolean {\n return typeof key === 'string' && UNSAFE_PATH_SEGMENTS.has(key);\n}\n"],"mappings":"AAKA,IAAa,EAAuB,IAAI,IAAI,CAAC,YAAa,cAAe,WAAW,CAAC,EA4BrF,SAAgB,EAAY,EAA2B,CACrD,OAAO,OAAO,GAAQ,UAAY,EAAqB,IAAI,CAAG,CAChE"}
1
+ {"version":3,"file":"unsafePaths.cjs","names":[],"sources":["../../src/_common/unsafePaths.ts"],"sourcesContent":["/**\n * Path segments that must be rejected in any dot-notation traversal or mutation\n * to prevent prototype pollution reads and writes.\n * @internal\n */\nexport const UNSAFE_PATH_SEGMENTS = new Set(['__proto__', 'constructor', 'prototype']);\n\n/**\n * Returns `true` if every dot-notation segment in `key` is safe to use as a\n * plain-object property.\n *\n * @example\n * ```ts\n * isSafePath('user.name') // true\n * isSafePath('__proto__.polluted') // false\n * ```\n */\nexport function isSafePath(key: string): boolean {\n return key.split('.').every((s) => !UNSAFE_PATH_SEGMENTS.has(s));\n}\n\n/**\n * Returns `true` if `key` is one of the dangerous own-property names that can be used to\n * pollute `Object.prototype` (`__proto__`, `constructor`, `prototype`). Use this for plain\n * (non-dotted) property keys — e.g. object keys being copied or reassigned. For dotted paths,\n * use `isSafePath` instead.\n *\n * @example\n * ```ts\n * isUnsafeKey('name') // false\n * isUnsafeKey('__proto__') // true\n * ```\n */\nexport function isUnsafeKey(key: PropertyKey): boolean {\n return typeof key === 'string' && UNSAFE_PATH_SEGMENTS.has(key);\n}\n"],"mappings":"AAKA,IAAa,EAAuB,IAAI,IAAI,CAAC,YAAa,cAAe,WAAW,CAAC,EA4BrF,SAAgB,YAAY,EAA2B,CACrD,OAAO,OAAO,GAAQ,UAAY,EAAqB,IAAI,CAAG,CAChE"}
@@ -1,13 +1,2 @@
1
- //#region src/_common/unsafePaths.ts
2
- var e = /* @__PURE__ */ new Set([
3
- "__proto__",
4
- "constructor",
5
- "prototype"
6
- ]);
7
- function t(t) {
8
- return typeof t == "string" && e.has(t);
9
- }
10
- //#endregion
11
- export { e as UNSAFE_PATH_SEGMENTS, t as isUnsafeKey };
12
-
1
+ var e=new Set([`__proto__`,`constructor`,`prototype`]);function isUnsafeKey(t){return typeof t==`string`&&e.has(t)}export{e as UNSAFE_PATH_SEGMENTS,isUnsafeKey};
13
2
  //# sourceMappingURL=unsafePaths.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unsafePaths.js","names":[],"sources":["../../src/_common/unsafePaths.ts"],"sourcesContent":["/**\n * Path segments that must be rejected in any dot-notation traversal or mutation\n * to prevent prototype pollution reads and writes.\n * @internal\n */\nexport const UNSAFE_PATH_SEGMENTS = new Set(['__proto__', 'constructor', 'prototype']);\n\n/**\n * Returns `true` if every dot-notation segment in `key` is safe to use as a\n * plain-object property.\n *\n * @example\n * ```ts\n * isSafePath('user.name') // true\n * isSafePath('__proto__.polluted') // false\n * ```\n */\nexport function isSafePath(key: string): boolean {\n return key.split('.').every((s) => !UNSAFE_PATH_SEGMENTS.has(s));\n}\n\n/**\n * Returns `true` if `key` is one of the dangerous own-property names that can be used to\n * pollute `Object.prototype` (`__proto__`, `constructor`, `prototype`). Use this for plain\n * (non-dotted) property keys — e.g. object keys being copied or reassigned. For dotted paths,\n * use `isSafePath` instead.\n *\n * @example\n * ```ts\n * isUnsafeKey('name') // false\n * isUnsafeKey('__proto__') // true\n * ```\n */\nexport function isUnsafeKey(key: PropertyKey): boolean {\n return typeof key === 'string' && UNSAFE_PATH_SEGMENTS.has(key);\n}\n"],"mappings":";AAKA,IAAa,oBAAuB,IAAI,IAAI;CAAC;CAAa;CAAe;AAAW,CAAC;AA4BrF,SAAgB,EAAY,GAA2B;CACrD,OAAO,OAAO,KAAQ,YAAY,EAAqB,IAAI,CAAG;AAChE"}
1
+ {"version":3,"file":"unsafePaths.js","names":[],"sources":["../../src/_common/unsafePaths.ts"],"sourcesContent":["/**\n * Path segments that must be rejected in any dot-notation traversal or mutation\n * to prevent prototype pollution reads and writes.\n * @internal\n */\nexport const UNSAFE_PATH_SEGMENTS = new Set(['__proto__', 'constructor', 'prototype']);\n\n/**\n * Returns `true` if every dot-notation segment in `key` is safe to use as a\n * plain-object property.\n *\n * @example\n * ```ts\n * isSafePath('user.name') // true\n * isSafePath('__proto__.polluted') // false\n * ```\n */\nexport function isSafePath(key: string): boolean {\n return key.split('.').every((s) => !UNSAFE_PATH_SEGMENTS.has(s));\n}\n\n/**\n * Returns `true` if `key` is one of the dangerous own-property names that can be used to\n * pollute `Object.prototype` (`__proto__`, `constructor`, `prototype`). Use this for plain\n * (non-dotted) property keys — e.g. object keys being copied or reassigned. For dotted paths,\n * use `isSafePath` instead.\n *\n * @example\n * ```ts\n * isUnsafeKey('name') // false\n * isUnsafeKey('__proto__') // true\n * ```\n */\nexport function isUnsafeKey(key: PropertyKey): boolean {\n return typeof key === 'string' && UNSAFE_PATH_SEGMENTS.has(key);\n}\n"],"mappings":"AAKA,IAAa,EAAuB,IAAI,IAAI,CAAC,YAAa,cAAe,WAAW,CAAC,EA4BrF,SAAgB,YAAY,EAA2B,CACrD,OAAO,OAAO,GAAQ,UAAY,EAAqB,IAAI,CAAG,CAChE"}
package/dist/_dev.cjs CHANGED
@@ -1,2 +1,2 @@
1
- function e(e){}exports.warn=e;
1
+ function warn(e){}exports.warn=warn;
2
2
  //# sourceMappingURL=_dev.cjs.map
package/dist/_dev.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"_dev.cjs","names":[],"sources":["../src/_dev.ts"],"sourcesContent":["const isDev = !(globalThis as { __ARSENAL_PROD__?: boolean }).__ARSENAL_PROD__;\n\n/** @internal @security Messages may include user data. */\nexport function warn(msg: string): void {\n if (isDev) console.warn(`[@vielzeug/arsenal] ${msg}`);\n}\n"],"mappings":"AAGA,SAAgB,EAAK,EAAmB,CAExC"}
1
+ {"version":3,"file":"_dev.cjs","names":[],"sources":["../src/_dev.ts"],"sourcesContent":["const isDev = !(globalThis as { __ARSENAL_PROD__?: boolean }).__ARSENAL_PROD__;\n\n/** @internal @security Messages may include user data. */\nexport function warn(msg: string): void {\n if (isDev) console.warn(`[@vielzeug/arsenal] ${msg}`);\n}\n"],"mappings":"AAGA,SAAgB,KAAK,EAAmB,CAExC"}
package/dist/_dev.js CHANGED
@@ -1,6 +1,2 @@
1
- //#region src/_dev.ts
2
- function e(e) {}
3
- //#endregion
4
- export { e as warn };
5
-
1
+ function warn(e){}export{warn};
6
2
  //# sourceMappingURL=_dev.js.map
package/dist/_dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"_dev.js","names":[],"sources":["../src/_dev.ts"],"sourcesContent":["const isDev = !(globalThis as { __ARSENAL_PROD__?: boolean }).__ARSENAL_PROD__;\n\n/** @internal @security Messages may include user data. */\nexport function warn(msg: string): void {\n if (isDev) console.warn(`[@vielzeug/arsenal] ${msg}`);\n}\n"],"mappings":";AAGA,SAAgB,EAAK,GAAmB,CAExC"}
1
+ {"version":3,"file":"_dev.js","names":[],"sources":["../src/_dev.ts"],"sourcesContent":["const isDev = !(globalThis as { __ARSENAL_PROD__?: boolean }).__ARSENAL_PROD__;\n\n/** @internal @security Messages may include user data. */\nexport function warn(msg: string): void {\n if (isDev) console.warn(`[@vielzeug/arsenal] ${msg}`);\n}\n"],"mappings":"AAGA,SAAgB,KAAK,EAAmB,CAExC"}
@@ -1,2 +1,2 @@
1
- function e(e,t=2){if(!Array.isArray(e)&&typeof e!=`string`)throw TypeError(`chunk: argument must be an array or string`);if(!Number.isInteger(t)||t<1)throw RangeError(`chunk: size must be a positive integer`);return Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,r*t+t))}exports.chunk=e;
1
+ function chunk(e,t=2){if(!Array.isArray(e)&&typeof e!=`string`)throw TypeError(`chunk: argument must be an array or string`);if(!Number.isInteger(t)||t<1)throw RangeError(`chunk: size must be a positive integer`);return Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,r*t+t))}exports.chunk=chunk;
2
2
  //# sourceMappingURL=chunk.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunk.cjs","names":[],"sources":["../../src/array/chunk.ts"],"sourcesContent":["/**\n * Splits an array or string into chunks of a specified size.\n *\n * @example\n * ```ts\n * chunk([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]]\n * chunk('hello', 2) // ['he', 'll', 'o']\n * ```\n *\n * @param input - The input array or string to be chunked.\n * @param size - The size of each chunk (default 2).\n *\n * @returns An array of chunks.\n *\n * @throws {TypeError} If the input is not an array or string.\n * @throws {RangeError} If the chunk size is not a positive integer.\n */\nexport function chunk(input: string, size?: number): string[];\nexport function chunk<T>(input: T[], size?: number): T[][];\nexport function chunk<T>(input: T[] | string, size = 2): string[] | T[][] {\n if (!Array.isArray(input) && typeof input !== 'string')\n throw new TypeError('chunk: argument must be an array or string');\n\n if (!Number.isInteger(size) || size < 1) throw new RangeError('chunk: size must be a positive integer');\n\n return Array.from({ length: Math.ceil(input.length / size) }, (_, i) => input.slice(i * size, i * size + size)) as\n | string[]\n | T[][];\n}\n"],"mappings":"AAmBA,SAAgB,EAAS,EAAqB,EAAO,EAAqB,CACxE,GAAI,CAAC,MAAM,QAAQ,CAAK,GAAK,OAAO,GAAU,SAC5C,MAAU,UAAU,4CAA4C,EAElE,GAAI,CAAC,OAAO,UAAU,CAAI,GAAK,EAAO,EAAG,MAAU,WAAW,wCAAwC,EAEtG,OAAO,MAAM,KAAK,CAAE,OAAQ,KAAK,KAAK,EAAM,OAAS,CAAI,CAAE,GAAI,EAAG,IAAM,EAAM,MAAM,EAAI,EAAM,EAAI,EAAO,CAAI,CAAC,CAGhH"}
1
+ {"version":3,"file":"chunk.cjs","names":[],"sources":["../../src/array/chunk.ts"],"sourcesContent":["/**\n * Splits an array or string into chunks of a specified size.\n *\n * @example\n * ```ts\n * chunk([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]]\n * chunk('hello', 2) // ['he', 'll', 'o']\n * ```\n *\n * @param input - The input array or string to be chunked.\n * @param size - The size of each chunk (default 2).\n *\n * @returns An array of chunks.\n *\n * @throws {TypeError} If the input is not an array or string.\n * @throws {RangeError} If the chunk size is not a positive integer.\n */\nexport function chunk(input: string, size?: number): string[];\nexport function chunk<T>(input: readonly T[], size?: number): T[][];\nexport function chunk<T>(input: readonly T[] | string, size = 2): string[] | T[][] {\n if (!Array.isArray(input) && typeof input !== 'string')\n throw new TypeError('chunk: argument must be an array or string');\n\n if (!Number.isInteger(size) || size < 1) throw new RangeError('chunk: size must be a positive integer');\n\n return Array.from({ length: Math.ceil(input.length / size) }, (_, i) => input.slice(i * size, i * size + size)) as\n | string[]\n | T[][];\n}\n"],"mappings":"AAmBA,SAAgB,MAAS,EAA8B,EAAO,EAAqB,CACjF,GAAI,CAAC,MAAM,QAAQ,CAAK,GAAK,OAAO,GAAU,SAC5C,MAAU,UAAU,4CAA4C,EAElE,GAAI,CAAC,OAAO,UAAU,CAAI,GAAK,EAAO,EAAG,MAAU,WAAW,wCAAwC,EAEtG,OAAO,MAAM,KAAK,CAAE,OAAQ,KAAK,KAAK,EAAM,OAAS,CAAI,CAAE,GAAI,EAAG,IAAM,EAAM,MAAM,EAAI,EAAM,EAAI,EAAO,CAAI,CAAC,CAGhH"}
@@ -16,5 +16,5 @@
16
16
  * @throws {RangeError} If the chunk size is not a positive integer.
17
17
  */
18
18
  export declare function chunk(input: string, size?: number): string[];
19
- export declare function chunk<T>(input: T[], size?: number): T[][];
19
+ export declare function chunk<T>(input: readonly T[], size?: number): T[][];
20
20
  //# sourceMappingURL=chunk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../src/array/chunk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AAC9D,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../src/array/chunk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AAC9D,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC"}
@@ -1,10 +1,2 @@
1
- //#region src/array/chunk.ts
2
- function e(e, t = 2) {
3
- if (!Array.isArray(e) && typeof e != "string") throw TypeError("chunk: argument must be an array or string");
4
- if (!Number.isInteger(t) || t < 1) throw RangeError("chunk: size must be a positive integer");
5
- return Array.from({ length: Math.ceil(e.length / t) }, (n, r) => e.slice(r * t, r * t + t));
6
- }
7
- //#endregion
8
- export { e as chunk };
9
-
1
+ function chunk(e,t=2){if(!Array.isArray(e)&&typeof e!=`string`)throw TypeError(`chunk: argument must be an array or string`);if(!Number.isInteger(t)||t<1)throw RangeError(`chunk: size must be a positive integer`);return Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,r*t+t))}export{chunk};
10
2
  //# sourceMappingURL=chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunk.js","names":[],"sources":["../../src/array/chunk.ts"],"sourcesContent":["/**\n * Splits an array or string into chunks of a specified size.\n *\n * @example\n * ```ts\n * chunk([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]]\n * chunk('hello', 2) // ['he', 'll', 'o']\n * ```\n *\n * @param input - The input array or string to be chunked.\n * @param size - The size of each chunk (default 2).\n *\n * @returns An array of chunks.\n *\n * @throws {TypeError} If the input is not an array or string.\n * @throws {RangeError} If the chunk size is not a positive integer.\n */\nexport function chunk(input: string, size?: number): string[];\nexport function chunk<T>(input: T[], size?: number): T[][];\nexport function chunk<T>(input: T[] | string, size = 2): string[] | T[][] {\n if (!Array.isArray(input) && typeof input !== 'string')\n throw new TypeError('chunk: argument must be an array or string');\n\n if (!Number.isInteger(size) || size < 1) throw new RangeError('chunk: size must be a positive integer');\n\n return Array.from({ length: Math.ceil(input.length / size) }, (_, i) => input.slice(i * size, i * size + size)) as\n | string[]\n | T[][];\n}\n"],"mappings":";AAmBA,SAAgB,EAAS,GAAqB,IAAO,GAAqB;CACxE,IAAI,CAAC,MAAM,QAAQ,CAAK,KAAK,OAAO,KAAU,UAC5C,MAAU,UAAU,4CAA4C;CAElE,IAAI,CAAC,OAAO,UAAU,CAAI,KAAK,IAAO,GAAG,MAAU,WAAW,wCAAwC;CAEtG,OAAO,MAAM,KAAK,EAAE,QAAQ,KAAK,KAAK,EAAM,SAAS,CAAI,EAAE,IAAI,GAAG,MAAM,EAAM,MAAM,IAAI,GAAM,IAAI,IAAO,CAAI,CAAC;AAGhH"}
1
+ {"version":3,"file":"chunk.js","names":[],"sources":["../../src/array/chunk.ts"],"sourcesContent":["/**\n * Splits an array or string into chunks of a specified size.\n *\n * @example\n * ```ts\n * chunk([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]]\n * chunk('hello', 2) // ['he', 'll', 'o']\n * ```\n *\n * @param input - The input array or string to be chunked.\n * @param size - The size of each chunk (default 2).\n *\n * @returns An array of chunks.\n *\n * @throws {TypeError} If the input is not an array or string.\n * @throws {RangeError} If the chunk size is not a positive integer.\n */\nexport function chunk(input: string, size?: number): string[];\nexport function chunk<T>(input: readonly T[], size?: number): T[][];\nexport function chunk<T>(input: readonly T[] | string, size = 2): string[] | T[][] {\n if (!Array.isArray(input) && typeof input !== 'string')\n throw new TypeError('chunk: argument must be an array or string');\n\n if (!Number.isInteger(size) || size < 1) throw new RangeError('chunk: size must be a positive integer');\n\n return Array.from({ length: Math.ceil(input.length / size) }, (_, i) => input.slice(i * size, i * size + size)) as\n | string[]\n | T[][];\n}\n"],"mappings":"AAmBA,SAAgB,MAAS,EAA8B,EAAO,EAAqB,CACjF,GAAI,CAAC,MAAM,QAAQ,CAAK,GAAK,OAAO,GAAU,SAC5C,MAAU,UAAU,4CAA4C,EAElE,GAAI,CAAC,OAAO,UAAU,CAAI,GAAK,EAAO,EAAG,MAAU,WAAW,wCAAwC,EAEtG,OAAO,MAAM,KAAK,CAAE,OAAQ,KAAK,KAAK,EAAM,OAAS,CAAI,CAAE,GAAI,EAAG,IAAM,EAAM,MAAM,EAAI,EAAM,EAAI,EAAO,CAAI,CAAC,CAGhH"}
@@ -1,2 +1,2 @@
1
- function e(e){return e.filter(Boolean)}exports.compact=e;
1
+ function compact(e){return e.filter(Boolean)}exports.compact=compact;
2
2
  //# sourceMappingURL=compact.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"compact.cjs","names":[],"sources":["../../src/array/compact.ts"],"sourcesContent":["type Falsy = false | '' | 0 | 0n | null | undefined;\n\n/**\n * Creates a new array with all falsy values removed.\n */\nexport function compact<T>(array: T[]): Array<Exclude<T, Falsy>> {\n return array.filter(Boolean) as Array<Exclude<T, Falsy>>;\n}\n"],"mappings":"AAKA,SAAgB,EAAW,EAAsC,CAC/D,OAAO,EAAM,OAAO,OAAO,CAC7B"}
1
+ {"version":3,"file":"compact.cjs","names":[],"sources":["../../src/array/compact.ts"],"sourcesContent":["type Falsy = false | '' | 0 | 0n | null | undefined;\n\n/**\n * Creates a new array with all falsy values removed.\n */\nexport function compact<T>(array: readonly T[]): Array<Exclude<T, Falsy>> {\n return array.filter(Boolean) as Array<Exclude<T, Falsy>>;\n}\n"],"mappings":"AAKA,SAAgB,QAAW,EAA+C,CACxE,OAAO,EAAM,OAAO,OAAO,CAC7B"}
@@ -2,6 +2,6 @@ type Falsy = false | '' | 0 | 0n | null | undefined;
2
2
  /**
3
3
  * Creates a new array with all falsy values removed.
4
4
  */
5
- export declare function compact<T>(array: T[]): Array<Exclude<T, Falsy>>;
5
+ export declare function compact<T>(array: readonly T[]): Array<Exclude<T, Falsy>>;
6
6
  export {};
7
7
  //# sourceMappingURL=compact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../src/array/compact.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAEpD;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAE/D"}
1
+ {"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../src/array/compact.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAEpD;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAExE"}
@@ -1,8 +1,2 @@
1
- //#region src/array/compact.ts
2
- function e(e) {
3
- return e.filter(Boolean);
4
- }
5
- //#endregion
6
- export { e as compact };
7
-
1
+ function compact(e){return e.filter(Boolean)}export{compact};
8
2
  //# sourceMappingURL=compact.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compact.js","names":[],"sources":["../../src/array/compact.ts"],"sourcesContent":["type Falsy = false | '' | 0 | 0n | null | undefined;\n\n/**\n * Creates a new array with all falsy values removed.\n */\nexport function compact<T>(array: T[]): Array<Exclude<T, Falsy>> {\n return array.filter(Boolean) as Array<Exclude<T, Falsy>>;\n}\n"],"mappings":";AAKA,SAAgB,EAAW,GAAsC;CAC/D,OAAO,EAAM,OAAO,OAAO;AAC7B"}
1
+ {"version":3,"file":"compact.js","names":[],"sources":["../../src/array/compact.ts"],"sourcesContent":["type Falsy = false | '' | 0 | 0n | null | undefined;\n\n/**\n * Creates a new array with all falsy values removed.\n */\nexport function compact<T>(array: readonly T[]): Array<Exclude<T, Falsy>> {\n return array.filter(Boolean) as Array<Exclude<T, Falsy>>;\n}\n"],"mappings":"AAKA,SAAgB,QAAW,EAA+C,CACxE,OAAO,EAAM,OAAO,OAAO,CAC7B"}
@@ -1,2 +1,2 @@
1
- var e=(e,t)=>{if(e===t)return 0;if(e===void 0)return 1;if(t===void 0)return-1;if(e===null)return t===null?0:-1;if(t===null)return 1;if(typeof e==`string`&&typeof t==`string`)return e.localeCompare(t);if(typeof e==`number`&&typeof t==`number`)return e===t?0:e>t?1:-1;if(e instanceof Date&&t instanceof Date){let n=e.getTime(),r=t.getTime();return n===r?0:n>r?1:-1}throw TypeError(`compare: unsupported types "${typeof e}" and "${typeof t}". Supported: number, string, Date, null, undefined.`)};exports.compare=e;
1
+ var compare=(e,t)=>{if(e===t)return 0;if(e===void 0)return 1;if(t===void 0)return-1;if(e===null)return t===null?0:-1;if(t===null)return 1;if(typeof e==`string`&&typeof t==`string`)return e.localeCompare(t);if(typeof e==`number`&&typeof t==`number`)return e===t?0:e>t?1:-1;if(e instanceof Date&&t instanceof Date){let n=e.getTime(),r=t.getTime();return n===r?0:n>r?1:-1}throw TypeError(`compare: unsupported types "${typeof e}" and "${typeof t}". Supported: number, string, Date, null, undefined.`)};exports.compare=compare;
2
2
  //# sourceMappingURL=compare.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"compare.cjs","names":[],"sources":["../../src/array/compare.ts"],"sourcesContent":["/**\n * Compares two values and returns a number suitable for use as a sort comparator.\n *\n * - Numbers and Dates: returns `0`, `1`, or `-1`.\n * - Strings: delegates to `String.prototype.localeCompare`, which may return any integer\n * (not just `0`, `1`, `-1`) depending on locale and engine.\n * - `null` sorts before all non-null values; `undefined` sorts last.\n *\n * @example\n * ```ts\n * compare('a', 'b'); // negative (locale-dependent)\n * compare(1, 2); // -1\n * compare(new Date('2023-01-01'), new Date('2023-01-02')); // -1\n * compare('a', 'a'); // 0\n * compare(1, 1); // 0\n * compare(new Date('2023-01-01'), new Date('2023-01-01')); // 0\n * ```\n *\n * @param a - The first value to compare.\n * @param b - The second value to compare.\n *\n * @returns A negative number, zero, or a positive number.\n *\n * Pass directly as an `Array.sort` comparator:\n * ```ts\n * [3, 1, 2].sort(compare); // [1, 2, 3]\n * ['banana', 'apple', 'cherry'].sort(compare); // ['apple', 'banana', 'cherry']\n * ```\n */\nexport const compare = (a: unknown, b: unknown): number => {\n if (a === b) return 0;\n\n if (a === undefined) return 1;\n\n if (b === undefined) return -1;\n\n if (a === null) return b === null ? 0 : -1;\n\n if (b === null) return 1;\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a.localeCompare(b);\n }\n\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a > b ? 1 : -1;\n }\n\n if (a instanceof Date && b instanceof Date) {\n const at = a.getTime();\n const bt = b.getTime();\n\n return at === bt ? 0 : at > bt ? 1 : -1;\n }\n\n throw new TypeError(\n `compare: unsupported types \"${typeof a}\" and \"${typeof b}\". Supported: number, string, Date, null, undefined.`,\n );\n};\n"],"mappings":"AA6BA,IAAa,GAAW,EAAY,IAAuB,CACzD,GAAI,IAAM,EAAG,MAAO,GAEpB,GAAI,IAAM,IAAA,GAAW,MAAO,GAE5B,GAAI,IAAM,IAAA,GAAW,MAAO,GAE5B,GAAI,IAAM,KAAM,OAAO,IAAM,KAAO,EAAI,GAExC,GAAI,IAAM,KAAM,MAAO,GAEvB,GAAI,OAAO,GAAM,UAAY,OAAO,GAAM,SACxC,OAAO,EAAE,cAAc,CAAC,EAG1B,GAAI,OAAO,GAAM,UAAY,OAAO,GAAM,SACxC,OAAO,IAAM,EAAI,EAAI,EAAI,EAAI,EAAI,GAGnC,GAAI,aAAa,MAAQ,aAAa,KAAM,CAC1C,IAAM,EAAK,EAAE,QAAQ,EACf,EAAK,EAAE,QAAQ,EAErB,OAAO,IAAO,EAAK,EAAI,EAAK,EAAK,EAAI,EACvC,CAEA,MAAU,UACR,+BAA+B,OAAO,EAAE,SAAS,OAAO,EAAE,qDAC5D,CACF"}
1
+ {"version":3,"file":"compare.cjs","names":[],"sources":["../../src/array/compare.ts"],"sourcesContent":["/**\n * Compares two values and returns a number suitable for use as a sort comparator.\n *\n * - Numbers and Dates: returns `0`, `1`, or `-1`.\n * - Strings: delegates to `String.prototype.localeCompare`, which may return any integer\n * (not just `0`, `1`, `-1`) depending on locale and engine.\n * - `null` sorts before all non-null values; `undefined` sorts last.\n *\n * @example\n * ```ts\n * compare('a', 'b'); // negative (locale-dependent)\n * compare(1, 2); // -1\n * compare(new Date('2023-01-01'), new Date('2023-01-02')); // -1\n * compare('a', 'a'); // 0\n * compare(1, 1); // 0\n * compare(new Date('2023-01-01'), new Date('2023-01-01')); // 0\n * ```\n *\n * @param a - The first value to compare.\n * @param b - The second value to compare.\n *\n * @returns A negative number, zero, or a positive number.\n *\n * Pass directly as an `Array.sort` comparator:\n * ```ts\n * [3, 1, 2].sort(compare); // [1, 2, 3]\n * ['banana', 'apple', 'cherry'].sort(compare); // ['apple', 'banana', 'cherry']\n * ```\n */\nexport const compare = (a: unknown, b: unknown): number => {\n if (a === b) return 0;\n\n if (a === undefined) return 1;\n\n if (b === undefined) return -1;\n\n if (a === null) return b === null ? 0 : -1;\n\n if (b === null) return 1;\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a.localeCompare(b);\n }\n\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a > b ? 1 : -1;\n }\n\n if (a instanceof Date && b instanceof Date) {\n const at = a.getTime();\n const bt = b.getTime();\n\n return at === bt ? 0 : at > bt ? 1 : -1;\n }\n\n throw new TypeError(\n `compare: unsupported types \"${typeof a}\" and \"${typeof b}\". Supported: number, string, Date, null, undefined.`,\n );\n};\n"],"mappings":"AA6BA,IAAa,SAAW,EAAY,IAAuB,CACzD,GAAI,IAAM,EAAG,MAAO,GAEpB,GAAI,IAAM,IAAA,GAAW,MAAO,GAE5B,GAAI,IAAM,IAAA,GAAW,MAAO,GAE5B,GAAI,IAAM,KAAM,OAAO,IAAM,KAAO,EAAI,GAExC,GAAI,IAAM,KAAM,MAAO,GAEvB,GAAI,OAAO,GAAM,UAAY,OAAO,GAAM,SACxC,OAAO,EAAE,cAAc,CAAC,EAG1B,GAAI,OAAO,GAAM,UAAY,OAAO,GAAM,SACxC,OAAO,IAAM,EAAI,EAAI,EAAI,EAAI,EAAI,GAGnC,GAAI,aAAa,MAAQ,aAAa,KAAM,CAC1C,IAAM,EAAK,EAAE,QAAQ,EACf,EAAK,EAAE,QAAQ,EAErB,OAAO,IAAO,EAAK,EAAI,EAAK,EAAK,EAAI,EACvC,CAEA,MAAU,UACR,+BAA+B,OAAO,EAAE,SAAS,OAAO,EAAE,qDAC5D,CACF"}
@@ -1,19 +1,2 @@
1
- //#region src/array/compare.ts
2
- var e = (e, t) => {
3
- if (e === t) return 0;
4
- if (e === void 0) return 1;
5
- if (t === void 0) return -1;
6
- if (e === null) return t === null ? 0 : -1;
7
- if (t === null) return 1;
8
- if (typeof e == "string" && typeof t == "string") return e.localeCompare(t);
9
- if (typeof e == "number" && typeof t == "number") return e === t ? 0 : e > t ? 1 : -1;
10
- if (e instanceof Date && t instanceof Date) {
11
- let n = e.getTime(), r = t.getTime();
12
- return n === r ? 0 : n > r ? 1 : -1;
13
- }
14
- throw TypeError(`compare: unsupported types "${typeof e}" and "${typeof t}". Supported: number, string, Date, null, undefined.`);
15
- };
16
- //#endregion
17
- export { e as compare };
18
-
1
+ var compare=(e,t)=>{if(e===t)return 0;if(e===void 0)return 1;if(t===void 0)return-1;if(e===null)return t===null?0:-1;if(t===null)return 1;if(typeof e==`string`&&typeof t==`string`)return e.localeCompare(t);if(typeof e==`number`&&typeof t==`number`)return e===t?0:e>t?1:-1;if(e instanceof Date&&t instanceof Date){let n=e.getTime(),r=t.getTime();return n===r?0:n>r?1:-1}throw TypeError(`compare: unsupported types "${typeof e}" and "${typeof t}". Supported: number, string, Date, null, undefined.`)};export{compare};
19
2
  //# sourceMappingURL=compare.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compare.js","names":[],"sources":["../../src/array/compare.ts"],"sourcesContent":["/**\n * Compares two values and returns a number suitable for use as a sort comparator.\n *\n * - Numbers and Dates: returns `0`, `1`, or `-1`.\n * - Strings: delegates to `String.prototype.localeCompare`, which may return any integer\n * (not just `0`, `1`, `-1`) depending on locale and engine.\n * - `null` sorts before all non-null values; `undefined` sorts last.\n *\n * @example\n * ```ts\n * compare('a', 'b'); // negative (locale-dependent)\n * compare(1, 2); // -1\n * compare(new Date('2023-01-01'), new Date('2023-01-02')); // -1\n * compare('a', 'a'); // 0\n * compare(1, 1); // 0\n * compare(new Date('2023-01-01'), new Date('2023-01-01')); // 0\n * ```\n *\n * @param a - The first value to compare.\n * @param b - The second value to compare.\n *\n * @returns A negative number, zero, or a positive number.\n *\n * Pass directly as an `Array.sort` comparator:\n * ```ts\n * [3, 1, 2].sort(compare); // [1, 2, 3]\n * ['banana', 'apple', 'cherry'].sort(compare); // ['apple', 'banana', 'cherry']\n * ```\n */\nexport const compare = (a: unknown, b: unknown): number => {\n if (a === b) return 0;\n\n if (a === undefined) return 1;\n\n if (b === undefined) return -1;\n\n if (a === null) return b === null ? 0 : -1;\n\n if (b === null) return 1;\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a.localeCompare(b);\n }\n\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a > b ? 1 : -1;\n }\n\n if (a instanceof Date && b instanceof Date) {\n const at = a.getTime();\n const bt = b.getTime();\n\n return at === bt ? 0 : at > bt ? 1 : -1;\n }\n\n throw new TypeError(\n `compare: unsupported types \"${typeof a}\" and \"${typeof b}\". Supported: number, string, Date, null, undefined.`,\n );\n};\n"],"mappings":";AA6BA,IAAa,KAAW,GAAY,MAAuB;CACzD,IAAI,MAAM,GAAG,OAAO;CAEpB,IAAI,MAAM,KAAA,GAAW,OAAO;CAE5B,IAAI,MAAM,KAAA,GAAW,OAAO;CAE5B,IAAI,MAAM,MAAM,OAAO,MAAM,OAAO,IAAI;CAExC,IAAI,MAAM,MAAM,OAAO;CAEvB,IAAI,OAAO,KAAM,YAAY,OAAO,KAAM,UACxC,OAAO,EAAE,cAAc,CAAC;CAG1B,IAAI,OAAO,KAAM,YAAY,OAAO,KAAM,UACxC,OAAO,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI;CAGnC,IAAI,aAAa,QAAQ,aAAa,MAAM;EAC1C,IAAM,IAAK,EAAE,QAAQ,GACf,IAAK,EAAE,QAAQ;EAErB,OAAO,MAAO,IAAK,IAAI,IAAK,IAAK,IAAI;CACvC;CAEA,MAAU,UACR,+BAA+B,OAAO,EAAE,SAAS,OAAO,EAAE,qDAC5D;AACF"}
1
+ {"version":3,"file":"compare.js","names":[],"sources":["../../src/array/compare.ts"],"sourcesContent":["/**\n * Compares two values and returns a number suitable for use as a sort comparator.\n *\n * - Numbers and Dates: returns `0`, `1`, or `-1`.\n * - Strings: delegates to `String.prototype.localeCompare`, which may return any integer\n * (not just `0`, `1`, `-1`) depending on locale and engine.\n * - `null` sorts before all non-null values; `undefined` sorts last.\n *\n * @example\n * ```ts\n * compare('a', 'b'); // negative (locale-dependent)\n * compare(1, 2); // -1\n * compare(new Date('2023-01-01'), new Date('2023-01-02')); // -1\n * compare('a', 'a'); // 0\n * compare(1, 1); // 0\n * compare(new Date('2023-01-01'), new Date('2023-01-01')); // 0\n * ```\n *\n * @param a - The first value to compare.\n * @param b - The second value to compare.\n *\n * @returns A negative number, zero, or a positive number.\n *\n * Pass directly as an `Array.sort` comparator:\n * ```ts\n * [3, 1, 2].sort(compare); // [1, 2, 3]\n * ['banana', 'apple', 'cherry'].sort(compare); // ['apple', 'banana', 'cherry']\n * ```\n */\nexport const compare = (a: unknown, b: unknown): number => {\n if (a === b) return 0;\n\n if (a === undefined) return 1;\n\n if (b === undefined) return -1;\n\n if (a === null) return b === null ? 0 : -1;\n\n if (b === null) return 1;\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a.localeCompare(b);\n }\n\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a > b ? 1 : -1;\n }\n\n if (a instanceof Date && b instanceof Date) {\n const at = a.getTime();\n const bt = b.getTime();\n\n return at === bt ? 0 : at > bt ? 1 : -1;\n }\n\n throw new TypeError(\n `compare: unsupported types \"${typeof a}\" and \"${typeof b}\". Supported: number, string, Date, null, undefined.`,\n );\n};\n"],"mappings":"AA6BA,IAAa,SAAW,EAAY,IAAuB,CACzD,GAAI,IAAM,EAAG,MAAO,GAEpB,GAAI,IAAM,IAAA,GAAW,MAAO,GAE5B,GAAI,IAAM,IAAA,GAAW,MAAO,GAE5B,GAAI,IAAM,KAAM,OAAO,IAAM,KAAO,EAAI,GAExC,GAAI,IAAM,KAAM,MAAO,GAEvB,GAAI,OAAO,GAAM,UAAY,OAAO,GAAM,SACxC,OAAO,EAAE,cAAc,CAAC,EAG1B,GAAI,OAAO,GAAM,UAAY,OAAO,GAAM,SACxC,OAAO,IAAM,EAAI,EAAI,EAAI,EAAI,EAAI,GAGnC,GAAI,aAAa,MAAQ,aAAa,KAAM,CAC1C,IAAM,EAAK,EAAE,QAAQ,EACf,EAAK,EAAE,QAAQ,EAErB,OAAO,IAAO,EAAK,EAAI,EAAK,EAAK,EAAI,EACvC,CAEA,MAAU,UACR,+BAA+B,OAAO,EAAE,SAAS,OAAO,EAAE,qDAC5D,CACF"}
@@ -1,2 +1,2 @@
1
- const e=require("./compare.cjs");var t=t=>{let n=Object.entries(t);return(t,r)=>{for(let[i,a]of n){let n=t[i],o=r[i],s=a===`desc`?-1:1,c=e.compare(n,o);if(c!==0)return c*s}return 0}};exports.compareBy=t;
1
+ const e=require("./compare.cjs");var compareBy=t=>{let n=Object.entries(t);return(t,r)=>{for(let[i,a]of n){let n=t[i],o=r[i],s=a===`desc`?-1:1,c=e.compare(n,o);if(c!==0)return c*s}return 0}};exports.compareBy=compareBy;
2
2
  //# sourceMappingURL=compareBy.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"compareBy.cjs","names":[],"sources":["../../src/array/compareBy.ts"],"sourcesContent":["import { compare } from './compare';\n\n/**\n * Compares two objects based on multiple selectors.\n * The comparison is done in the order of the selectors provided.\n * Each selector can be 'asc' for ascending or 'desc' for descending order.\n *\n * @example\n * ```ts\n * const compareByNameAndAge = compareBy<{ name: string; age: number }>({\n * name: 'asc',\n * age: 'desc',\n * });\n *\n * const a = { name: 'Alice', age: 30 };\n * const b = { name: 'Bob', age: 25 };\n *\n * console.log(compareByNameAndAge(a, b)); // -1 (Alice < Bob)\n * ```\n *\n * @param selectors - An object where keys are properties to compare and values are 'asc' or 'desc'.\n *\n * @returns A comparator for use with `Array.sort` or `sort()`.\n */\nexport const compareBy = <T>(selectors: Partial<Record<keyof T, 'asc' | 'desc'>>) => {\n const entries = Object.entries(selectors) as [keyof T, 'asc' | 'desc'][];\n\n return (a: T, b: T) => {\n for (const [key, direction] of entries) {\n const v1 = a[key];\n const v2 = b[key];\n const dir = direction === 'desc' ? -1 : 1;\n\n const cmp = compare(v1, v2);\n\n if (cmp !== 0) return cmp * dir;\n }\n\n return 0;\n };\n};\n"],"mappings":"iCAwBA,IAAa,EAAgB,GAAwD,CACnF,IAAM,EAAU,OAAO,QAAQ,CAAS,EAExC,OAAQ,EAAM,IAAS,CACrB,IAAK,GAAM,CAAC,EAAK,KAAc,EAAS,CACtC,IAAM,EAAK,EAAE,GACP,EAAK,EAAE,GACP,EAAM,IAAc,OAAS,GAAK,EAElC,EAAM,EAAA,QAAQ,EAAI,CAAE,EAE1B,GAAI,IAAQ,EAAG,OAAO,EAAM,CAC9B,CAEA,MAAO,EACT,CACF"}
1
+ {"version":3,"file":"compareBy.cjs","names":[],"sources":["../../src/array/compareBy.ts"],"sourcesContent":["import { compare } from './compare';\n\n/**\n * Compares two objects based on multiple selectors.\n * The comparison is done in the order of the selectors provided.\n * Each selector can be 'asc' for ascending or 'desc' for descending order.\n *\n * @example\n * ```ts\n * const compareByNameAndAge = compareBy<{ name: string; age: number }>({\n * name: 'asc',\n * age: 'desc',\n * });\n *\n * const a = { name: 'Alice', age: 30 };\n * const b = { name: 'Bob', age: 25 };\n *\n * console.log(compareByNameAndAge(a, b)); // -1 (Alice < Bob)\n * ```\n *\n * @param selectors - An object where keys are properties to compare and values are 'asc' or 'desc'.\n *\n * @returns A comparator for use with `Array.sort` or `sort()`.\n */\nexport const compareBy = <T>(selectors: Partial<Record<keyof T, 'asc' | 'desc'>>) => {\n const entries = Object.entries(selectors) as [keyof T, 'asc' | 'desc'][];\n\n return (a: T, b: T) => {\n for (const [key, direction] of entries) {\n const v1 = a[key];\n const v2 = b[key];\n const dir = direction === 'desc' ? -1 : 1;\n\n const cmp = compare(v1, v2);\n\n if (cmp !== 0) return cmp * dir;\n }\n\n return 0;\n };\n};\n"],"mappings":"iCAwBA,IAAa,UAAgB,GAAwD,CACnF,IAAM,EAAU,OAAO,QAAQ,CAAS,EAExC,OAAQ,EAAM,IAAS,CACrB,IAAK,GAAM,CAAC,EAAK,KAAc,EAAS,CACtC,IAAM,EAAK,EAAE,GACP,EAAK,EAAE,GACP,EAAM,IAAc,OAAS,GAAK,EAElC,EAAM,EAAA,QAAQ,EAAI,CAAE,EAE1B,GAAI,IAAQ,EAAG,OAAO,EAAM,CAC9B,CAEA,MAAO,EACT,CACF"}
@@ -1,16 +1,2 @@
1
- import { compare as e } from "./compare.js";
2
- //#region src/array/compareBy.ts
3
- var t = (t) => {
4
- let n = Object.entries(t);
5
- return (t, r) => {
6
- for (let [i, a] of n) {
7
- let n = t[i], o = r[i], s = a === "desc" ? -1 : 1, c = e(n, o);
8
- if (c !== 0) return c * s;
9
- }
10
- return 0;
11
- };
12
- };
13
- //#endregion
14
- export { t as compareBy };
15
-
1
+ import{compare as e}from"./compare.js";var compareBy=t=>{let n=Object.entries(t);return(t,r)=>{for(let[i,a]of n){let n=t[i],o=r[i],s=a===`desc`?-1:1,c=e(n,o);if(c!==0)return c*s}return 0}};export{compareBy};
16
2
  //# sourceMappingURL=compareBy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compareBy.js","names":[],"sources":["../../src/array/compareBy.ts"],"sourcesContent":["import { compare } from './compare';\n\n/**\n * Compares two objects based on multiple selectors.\n * The comparison is done in the order of the selectors provided.\n * Each selector can be 'asc' for ascending or 'desc' for descending order.\n *\n * @example\n * ```ts\n * const compareByNameAndAge = compareBy<{ name: string; age: number }>({\n * name: 'asc',\n * age: 'desc',\n * });\n *\n * const a = { name: 'Alice', age: 30 };\n * const b = { name: 'Bob', age: 25 };\n *\n * console.log(compareByNameAndAge(a, b)); // -1 (Alice < Bob)\n * ```\n *\n * @param selectors - An object where keys are properties to compare and values are 'asc' or 'desc'.\n *\n * @returns A comparator for use with `Array.sort` or `sort()`.\n */\nexport const compareBy = <T>(selectors: Partial<Record<keyof T, 'asc' | 'desc'>>) => {\n const entries = Object.entries(selectors) as [keyof T, 'asc' | 'desc'][];\n\n return (a: T, b: T) => {\n for (const [key, direction] of entries) {\n const v1 = a[key];\n const v2 = b[key];\n const dir = direction === 'desc' ? -1 : 1;\n\n const cmp = compare(v1, v2);\n\n if (cmp !== 0) return cmp * dir;\n }\n\n return 0;\n };\n};\n"],"mappings":";;AAwBA,IAAa,KAAgB,MAAwD;CACnF,IAAM,IAAU,OAAO,QAAQ,CAAS;CAExC,QAAQ,GAAM,MAAS;EACrB,KAAK,IAAM,CAAC,GAAK,MAAc,GAAS;GACtC,IAAM,IAAK,EAAE,IACP,IAAK,EAAE,IACP,IAAM,MAAc,SAAS,KAAK,GAElC,IAAM,EAAQ,GAAI,CAAE;GAE1B,IAAI,MAAQ,GAAG,OAAO,IAAM;EAC9B;EAEA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"compareBy.js","names":[],"sources":["../../src/array/compareBy.ts"],"sourcesContent":["import { compare } from './compare';\n\n/**\n * Compares two objects based on multiple selectors.\n * The comparison is done in the order of the selectors provided.\n * Each selector can be 'asc' for ascending or 'desc' for descending order.\n *\n * @example\n * ```ts\n * const compareByNameAndAge = compareBy<{ name: string; age: number }>({\n * name: 'asc',\n * age: 'desc',\n * });\n *\n * const a = { name: 'Alice', age: 30 };\n * const b = { name: 'Bob', age: 25 };\n *\n * console.log(compareByNameAndAge(a, b)); // -1 (Alice < Bob)\n * ```\n *\n * @param selectors - An object where keys are properties to compare and values are 'asc' or 'desc'.\n *\n * @returns A comparator for use with `Array.sort` or `sort()`.\n */\nexport const compareBy = <T>(selectors: Partial<Record<keyof T, 'asc' | 'desc'>>) => {\n const entries = Object.entries(selectors) as [keyof T, 'asc' | 'desc'][];\n\n return (a: T, b: T) => {\n for (const [key, direction] of entries) {\n const v1 = a[key];\n const v2 = b[key];\n const dir = direction === 'desc' ? -1 : 1;\n\n const cmp = compare(v1, v2);\n\n if (cmp !== 0) return cmp * dir;\n }\n\n return 0;\n };\n};\n"],"mappings":"uCAwBA,IAAa,UAAgB,GAAwD,CACnF,IAAM,EAAU,OAAO,QAAQ,CAAS,EAExC,OAAQ,EAAM,IAAS,CACrB,IAAK,GAAM,CAAC,EAAK,KAAc,EAAS,CACtC,IAAM,EAAK,EAAE,GACP,EAAK,EAAE,GACP,EAAM,IAAc,OAAS,GAAK,EAElC,EAAM,EAAQ,EAAI,CAAE,EAE1B,GAAI,IAAQ,EAAG,OAAO,EAAM,CAC9B,CAEA,MAAO,EACT,CACF"}
@@ -1,2 +1,2 @@
1
- const e=require("../guards/isEqual.cjs");function t(t,n){return typeof n!=`object`||!n?t.includes(n):t.some(t=>e.isEqual(t,n))}exports.contains=t;
1
+ const e=require("../guards/isEqual.cjs");function contains(t,n){return typeof n!=`object`||!n?t.includes(n):t.some(t=>e.isEqual(t,n))}exports.contains=contains;
2
2
  //# sourceMappingURL=contains.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"contains.cjs","names":[],"sources":["../../src/array/contains.ts"],"sourcesContent":["import { isEqual } from '../guards/isEqual';\n\n/**\n * Checks if a value is present in an array.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, { a: 1 }, 'hello'];\n * const value = { a: 1 };\n * contains(arr, value) // true;\n * ```\n *\n * @param array - The array to check.\n * @param value - The value to search for.\n *\n * @returns true if the value is present in the array, else false.\n */\n\nexport function contains<T>(array: T[], value: unknown): boolean {\n // Fast path: reference / primitive equality via Array.includes — avoids\n // deep-equal traversal for the common case of searching for a scalar.\n if (value === null || value === undefined || typeof value !== 'object') {\n return array.includes(value as T);\n }\n\n return array.some((val) => isEqual(val, value));\n}\n"],"mappings":"yCAkBA,SAAgB,EAAY,EAAY,EAAyB,CAO/D,OAJ6C,OAAO,GAAU,WAA1D,EACK,EAAM,SAAS,CAAU,EAG3B,EAAM,KAAM,GAAQ,EAAA,QAAQ,EAAK,CAAK,CAAC,CAChD"}
1
+ {"version":3,"file":"contains.cjs","names":[],"sources":["../../src/array/contains.ts"],"sourcesContent":["import { isEqual } from '../guards/isEqual';\n\n/**\n * Checks if a value is present in an array.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, { a: 1 }, 'hello'];\n * const value = { a: 1 };\n * contains(arr, value) // true;\n * ```\n *\n * @param array - The array to check.\n * @param value - The value to search for.\n *\n * @returns true if the value is present in the array, else false.\n */\n\nexport function contains<T>(array: readonly T[], value: unknown): boolean {\n // Fast path: reference / primitive equality via Array.includes — avoids\n // deep-equal traversal for the common case of searching for a scalar.\n if (value === null || value === undefined || typeof value !== 'object') {\n return array.includes(value as T);\n }\n\n return array.some((val) => isEqual(val, value));\n}\n"],"mappings":"yCAkBA,SAAgB,SAAY,EAAqB,EAAyB,CAOxE,OAJ6C,OAAO,GAAU,WAA1D,EACK,EAAM,SAAS,CAAU,EAG3B,EAAM,KAAM,GAAQ,EAAA,QAAQ,EAAK,CAAK,CAAC,CAChD"}
@@ -13,5 +13,5 @@
13
13
  *
14
14
  * @returns true if the value is present in the array, else false.
15
15
  */
16
- export declare function contains<T>(array: T[], value: unknown): boolean;
16
+ export declare function contains<T>(array: readonly T[], value: unknown): boolean;
17
17
  //# sourceMappingURL=contains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contains.d.ts","sourceRoot":"","sources":["../../src/array/contains.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAQ/D"}
1
+ {"version":3,"file":"contains.d.ts","sourceRoot":"","sources":["../../src/array/contains.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAQxE"}
@@ -1,9 +1,2 @@
1
- import { isEqual as e } from "../guards/isEqual.js";
2
- //#region src/array/contains.ts
3
- function t(t, n) {
4
- return typeof n != "object" || !n ? t.includes(n) : t.some((t) => e(t, n));
5
- }
6
- //#endregion
7
- export { t as contains };
8
-
1
+ import{isEqual as e}from"../guards/isEqual.js";function contains(t,n){return typeof n!=`object`||!n?t.includes(n):t.some(t=>e(t,n))}export{contains};
9
2
  //# sourceMappingURL=contains.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contains.js","names":[],"sources":["../../src/array/contains.ts"],"sourcesContent":["import { isEqual } from '../guards/isEqual';\n\n/**\n * Checks if a value is present in an array.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, { a: 1 }, 'hello'];\n * const value = { a: 1 };\n * contains(arr, value) // true;\n * ```\n *\n * @param array - The array to check.\n * @param value - The value to search for.\n *\n * @returns true if the value is present in the array, else false.\n */\n\nexport function contains<T>(array: T[], value: unknown): boolean {\n // Fast path: reference / primitive equality via Array.includes — avoids\n // deep-equal traversal for the common case of searching for a scalar.\n if (value === null || value === undefined || typeof value !== 'object') {\n return array.includes(value as T);\n }\n\n return array.some((val) => isEqual(val, value));\n}\n"],"mappings":";;AAkBA,SAAgB,EAAY,GAAY,GAAyB;CAO/D,OAJ6C,OAAO,KAAU,aAA1D,IACK,EAAM,SAAS,CAAU,IAG3B,EAAM,MAAM,MAAQ,EAAQ,GAAK,CAAK,CAAC;AAChD"}
1
+ {"version":3,"file":"contains.js","names":[],"sources":["../../src/array/contains.ts"],"sourcesContent":["import { isEqual } from '../guards/isEqual';\n\n/**\n * Checks if a value is present in an array.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, { a: 1 }, 'hello'];\n * const value = { a: 1 };\n * contains(arr, value) // true;\n * ```\n *\n * @param array - The array to check.\n * @param value - The value to search for.\n *\n * @returns true if the value is present in the array, else false.\n */\n\nexport function contains<T>(array: readonly T[], value: unknown): boolean {\n // Fast path: reference / primitive equality via Array.includes — avoids\n // deep-equal traversal for the common case of searching for a scalar.\n if (value === null || value === undefined || typeof value !== 'object') {\n return array.includes(value as T);\n }\n\n return array.some((val) => isEqual(val, value));\n}\n"],"mappings":"+CAkBA,SAAgB,SAAY,EAAqB,EAAyB,CAOxE,OAJ6C,OAAO,GAAU,WAA1D,EACK,EAAM,SAAS,CAAU,EAG3B,EAAM,KAAM,GAAQ,EAAQ,EAAK,CAAK,CAAC,CAChD"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t,n){let r={};for(let i=0;i<t.length;i++){let a=n(t[i]),o=a==null?`_`:String(a);e.isUnsafeKey(o)||(r[o]=(r[o]??0)+1)}return r}exports.countBy=t;
1
+ const e=require("../_common/unsafePaths.cjs");function countBy(t,n){let r={};for(let i=0;i<t.length;i++){let a=n(t[i]),o=a==null?`_`:String(a);e.isUnsafeKey(o)||(r[o]=(r[o]??0)+1)}return r}exports.countBy=countBy;
2
2
  //# sourceMappingURL=countBy.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"countBy.cjs","names":[],"sources":["../../src/array/countBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Counts elements in an array by selector output. Selector results of `null`/`undefined` are\n * bucketed under the key `'_'`, matching `groupBy`'s convention. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are skipped.\n */\nexport function countBy<T>(array: T[], selector: (item: T) => Primitive): Record<string, number> {\n const out: Record<string, number> = {};\n\n for (let index = 0; index < array.length; index++) {\n const rawKey = selector(array[index]);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n out[key] = (out[key] ?? 0) + 1;\n }\n\n return out;\n}\n"],"mappings":"8CAQA,SAAgB,EAAW,EAAY,EAA0D,CAC/F,IAAM,EAA8B,CAAC,EAErC,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IAAS,CACjD,IAAM,EAAS,EAAS,EAAM,EAAM,EAC9B,EAAM,GAAmC,KAAO,IAAM,OAAO,CAAM,EAErE,EAAA,YAAY,CAAG,IAEnB,EAAI,IAAQ,EAAI,IAAQ,GAAK,EAC/B,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"countBy.cjs","names":[],"sources":["../../src/array/countBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Counts elements in an array by selector output. Selector results of `null`/`undefined` are\n * bucketed under the key `'_'`, matching `groupBy`'s convention. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are skipped.\n */\nexport function countBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, number> {\n const out: Record<string, number> = {};\n\n for (let index = 0; index < array.length; index++) {\n const rawKey = selector(array[index]);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n out[key] = (out[key] ?? 0) + 1;\n }\n\n return out;\n}\n"],"mappings":"8CAQA,SAAgB,QAAW,EAAqB,EAA0D,CACxG,IAAM,EAA8B,CAAC,EAErC,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IAAS,CACjD,IAAM,EAAS,EAAS,EAAM,EAAM,EAC9B,EAAM,GAAmC,KAAO,IAAM,OAAO,CAAM,EAErE,EAAA,YAAY,CAAG,IAEnB,EAAI,IAAQ,EAAI,IAAQ,GAAK,EAC/B,CAEA,OAAO,CACT"}
@@ -4,5 +4,5 @@ import type { Primitive } from '../types';
4
4
  * bucketed under the key `'_'`, matching `groupBy`'s convention. Dangerous keys (`__proto__`,
5
5
  * `constructor`, `prototype`) are skipped.
6
6
  */
7
- export declare function countBy<T>(array: T[], selector: (item: T) => Primitive): Record<string, number>;
7
+ export declare function countBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, number>;
8
8
  //# sourceMappingURL=countBy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"countBy.d.ts","sourceRoot":"","sources":["../../src/array/countBy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAa/F"}
1
+ {"version":3,"file":"countBy.d.ts","sourceRoot":"","sources":["../../src/array/countBy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxG"}
@@ -1,14 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/array/countBy.ts
3
- function t(t, n) {
4
- let r = {};
5
- for (let i = 0; i < t.length; i++) {
6
- let a = n(t[i]), o = a == null ? "_" : String(a);
7
- e(o) || (r[o] = (r[o] ?? 0) + 1);
8
- }
9
- return r;
10
- }
11
- //#endregion
12
- export { t as countBy };
13
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function countBy(t,n){let r={};for(let i=0;i<t.length;i++){let a=n(t[i]),o=a==null?`_`:String(a);e(o)||(r[o]=(r[o]??0)+1)}return r}export{countBy};
14
2
  //# sourceMappingURL=countBy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"countBy.js","names":[],"sources":["../../src/array/countBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Counts elements in an array by selector output. Selector results of `null`/`undefined` are\n * bucketed under the key `'_'`, matching `groupBy`'s convention. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are skipped.\n */\nexport function countBy<T>(array: T[], selector: (item: T) => Primitive): Record<string, number> {\n const out: Record<string, number> = {};\n\n for (let index = 0; index < array.length; index++) {\n const rawKey = selector(array[index]);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n out[key] = (out[key] ?? 0) + 1;\n }\n\n return out;\n}\n"],"mappings":";;AAQA,SAAgB,EAAW,GAAY,GAA0D;CAC/F,IAAM,IAA8B,CAAC;CAErC,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAM,QAAQ,KAAS;EACjD,IAAM,IAAS,EAAS,EAAM,EAAM,GAC9B,IAAM,KAAmC,OAAO,MAAM,OAAO,CAAM;EAErE,EAAY,CAAG,MAEnB,EAAI,MAAQ,EAAI,MAAQ,KAAK;CAC/B;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"countBy.js","names":[],"sources":["../../src/array/countBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Counts elements in an array by selector output. Selector results of `null`/`undefined` are\n * bucketed under the key `'_'`, matching `groupBy`'s convention. Dangerous keys (`__proto__`,\n * `constructor`, `prototype`) are skipped.\n */\nexport function countBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, number> {\n const out: Record<string, number> = {};\n\n for (let index = 0; index < array.length; index++) {\n const rawKey = selector(array[index]);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n out[key] = (out[key] ?? 0) + 1;\n }\n\n return out;\n}\n"],"mappings":"wDAQA,SAAgB,QAAW,EAAqB,EAA0D,CACxG,IAAM,EAA8B,CAAC,EAErC,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IAAS,CACjD,IAAM,EAAS,EAAS,EAAM,EAAM,EAC9B,EAAM,GAAmC,KAAO,IAAM,OAAO,CAAM,EAErE,EAAY,CAAG,IAEnB,EAAI,IAAQ,EAAI,IAAQ,GAAK,EAC/B,CAEA,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/_selectorSet.cjs");function t(t,n,r){if(!r){let e=new Set(n);return t.filter(t=>!e.has(t))}let i=e.toSelectorSet(n,r);return t.filter(e=>!i.has(r(e)))}exports.difference=t;
1
+ const e=require("../_common/_selectorSet.cjs");function difference(t,n,r){if(!r){let e=new Set(n);return t.filter(t=>!e.has(t))}let i=e.toSelectorSet(n,r);return t.filter(e=>!i.has(r(e)))}exports.difference=difference;
2
2
  //# sourceMappingURL=difference.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"difference.cjs","names":[],"sources":["../../src/array/difference.ts"],"sourcesContent":["import { toSelectorSet } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns elements that are in source but not in other.\n */\nexport function difference<T>(source: T[], other: T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n const deny = new Set(other);\n\n return source.filter((item) => !deny.has(item));\n }\n\n const deny = toSelectorSet(other, selector);\n\n return source.filter((item) => !deny.has(selector(item)));\n}\n"],"mappings":"+CAMA,SAAgB,EAAc,EAAa,EAAY,EAAwC,CAC7F,GAAI,CAAC,EAAU,CACb,IAAM,EAAO,IAAI,IAAI,CAAK,EAE1B,OAAO,EAAO,OAAQ,GAAS,CAAC,EAAK,IAAI,CAAI,CAAC,CAChD,CAEA,IAAM,EAAO,EAAA,cAAc,EAAO,CAAQ,EAE1C,OAAO,EAAO,OAAQ,GAAS,CAAC,EAAK,IAAI,EAAS,CAAI,CAAC,CAAC,CAC1D"}
1
+ {"version":3,"file":"difference.cjs","names":[],"sources":["../../src/array/difference.ts"],"sourcesContent":["import { toSelectorSet } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns elements that are in `source` but not in `other`.\n *\n * Allocates a `Set` from `other` for O(1) membership checks, plus a new array for the result.\n */\nexport function difference<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n const deny = new Set(other);\n\n return source.filter((item) => !deny.has(item));\n }\n\n const deny = toSelectorSet(other, selector);\n\n return source.filter((item) => !deny.has(selector(item)));\n}\n"],"mappings":"+CAQA,SAAgB,WAAc,EAAsB,EAAqB,EAAwC,CAC/G,GAAI,CAAC,EAAU,CACb,IAAM,EAAO,IAAI,IAAI,CAAK,EAE1B,OAAO,EAAO,OAAQ,GAAS,CAAC,EAAK,IAAI,CAAI,CAAC,CAChD,CAEA,IAAM,EAAO,EAAA,cAAc,EAAO,CAAQ,EAE1C,OAAO,EAAO,OAAQ,GAAS,CAAC,EAAK,IAAI,EAAS,CAAI,CAAC,CAAC,CAC1D"}
@@ -1,6 +1,8 @@
1
1
  import type { Primitive } from '../types';
2
2
  /**
3
- * Returns elements that are in source but not in other.
3
+ * Returns elements that are in `source` but not in `other`.
4
+ *
5
+ * Allocates a `Set` from `other` for O(1) membership checks, plus a new array for the result.
4
6
  */
5
- export declare function difference<T>(source: T[], other: T[], selector?: (item: T) => Primitive): T[];
7
+ export declare function difference<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[];
6
8
  //# sourceMappingURL=difference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../src/array/difference.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,GAAG,CAAC,EAAE,CAU7F"}
1
+ {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../src/array/difference.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,GAAG,CAAC,EAAE,CAU/G"}