@vielzeug/arsenal 3.0.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 (491) hide show
  1. package/dist/_common/_lruMap.cjs +1 -1
  2. package/dist/_common/_lruMap.cjs.map +1 -1
  3. package/dist/_common/_lruMap.js +1 -17
  4. package/dist/_common/_lruMap.js.map +1 -1
  5. package/dist/_common/_selectorSet.cjs +1 -1
  6. package/dist/_common/_selectorSet.cjs.map +1 -1
  7. package/dist/_common/_selectorSet.js +1 -15
  8. package/dist/_common/_selectorSet.js.map +1 -1
  9. package/dist/_common/unsafePaths.cjs +1 -1
  10. package/dist/_common/unsafePaths.cjs.map +1 -1
  11. package/dist/_common/unsafePaths.js +1 -12
  12. package/dist/_common/unsafePaths.js.map +1 -1
  13. package/dist/_dev.cjs +1 -1
  14. package/dist/_dev.cjs.map +1 -1
  15. package/dist/_dev.js +1 -5
  16. package/dist/_dev.js.map +1 -1
  17. package/dist/array/chunk.cjs +1 -1
  18. package/dist/array/chunk.cjs.map +1 -1
  19. package/dist/array/chunk.js +1 -9
  20. package/dist/array/chunk.js.map +1 -1
  21. package/dist/array/compact.cjs +1 -1
  22. package/dist/array/compact.cjs.map +1 -1
  23. package/dist/array/compact.js +1 -7
  24. package/dist/array/compact.js.map +1 -1
  25. package/dist/array/compare.cjs +1 -1
  26. package/dist/array/compare.cjs.map +1 -1
  27. package/dist/array/compare.js +1 -18
  28. package/dist/array/compare.js.map +1 -1
  29. package/dist/array/compareBy.cjs +1 -1
  30. package/dist/array/compareBy.cjs.map +1 -1
  31. package/dist/array/compareBy.js +1 -15
  32. package/dist/array/compareBy.js.map +1 -1
  33. package/dist/array/contains.cjs +1 -1
  34. package/dist/array/contains.cjs.map +1 -1
  35. package/dist/array/contains.js +1 -8
  36. package/dist/array/contains.js.map +1 -1
  37. package/dist/array/countBy.cjs +1 -1
  38. package/dist/array/countBy.cjs.map +1 -1
  39. package/dist/array/countBy.js +1 -13
  40. package/dist/array/countBy.js.map +1 -1
  41. package/dist/array/difference.cjs +1 -1
  42. package/dist/array/difference.cjs.map +1 -1
  43. package/dist/array/difference.js +1 -13
  44. package/dist/array/difference.js.map +1 -1
  45. package/dist/array/drop.cjs +1 -1
  46. package/dist/array/drop.cjs.map +1 -1
  47. package/dist/array/drop.js +1 -8
  48. package/dist/array/drop.js.map +1 -1
  49. package/dist/array/dropLast.cjs +1 -1
  50. package/dist/array/dropLast.cjs.map +1 -1
  51. package/dist/array/dropLast.js +1 -8
  52. package/dist/array/dropLast.js.map +1 -1
  53. package/dist/array/filterMap.cjs +1 -1
  54. package/dist/array/filterMap.cjs.map +1 -1
  55. package/dist/array/filterMap.js +1 -12
  56. package/dist/array/filterMap.js.map +1 -1
  57. package/dist/array/first.cjs +1 -1
  58. package/dist/array/first.cjs.map +1 -1
  59. package/dist/array/first.js +1 -7
  60. package/dist/array/first.js.map +1 -1
  61. package/dist/array/groupBy.cjs +1 -1
  62. package/dist/array/groupBy.cjs.map +1 -1
  63. package/dist/array/groupBy.js +1 -13
  64. package/dist/array/groupBy.js.map +1 -1
  65. package/dist/array/index.js +1 -28
  66. package/dist/array/indexBy.cjs +1 -1
  67. package/dist/array/indexBy.cjs.map +1 -1
  68. package/dist/array/indexBy.js +1 -13
  69. package/dist/array/indexBy.js.map +1 -1
  70. package/dist/array/intersection.cjs +1 -1
  71. package/dist/array/intersection.cjs.map +1 -1
  72. package/dist/array/intersection.js +1 -13
  73. package/dist/array/intersection.js.map +1 -1
  74. package/dist/array/last.cjs +1 -1
  75. package/dist/array/last.cjs.map +1 -1
  76. package/dist/array/last.js +1 -7
  77. package/dist/array/last.js.map +1 -1
  78. package/dist/array/partition.cjs +1 -1
  79. package/dist/array/partition.cjs.map +1 -1
  80. package/dist/array/partition.js +1 -9
  81. package/dist/array/partition.js.map +1 -1
  82. package/dist/array/replace.cjs +1 -1
  83. package/dist/array/replace.cjs.map +1 -1
  84. package/dist/array/replace.js +1 -12
  85. package/dist/array/replace.js.map +1 -1
  86. package/dist/array/rotate.cjs +1 -1
  87. package/dist/array/rotate.cjs.map +1 -1
  88. package/dist/array/rotate.js +1 -9
  89. package/dist/array/rotate.js.map +1 -1
  90. package/dist/array/search.cjs +1 -1
  91. package/dist/array/search.cjs.map +1 -1
  92. package/dist/array/search.js +1 -29
  93. package/dist/array/search.js.map +1 -1
  94. package/dist/array/sort.cjs +1 -1
  95. package/dist/array/sort.cjs.map +1 -1
  96. package/dist/array/sort.js +1 -14
  97. package/dist/array/sort.js.map +1 -1
  98. package/dist/array/take.cjs +1 -1
  99. package/dist/array/take.cjs.map +1 -1
  100. package/dist/array/take.js +1 -8
  101. package/dist/array/take.js.map +1 -1
  102. package/dist/array/takeLast.cjs +1 -1
  103. package/dist/array/takeLast.cjs.map +1 -1
  104. package/dist/array/takeLast.js +1 -8
  105. package/dist/array/takeLast.js.map +1 -1
  106. package/dist/array/toggle.cjs +1 -1
  107. package/dist/array/toggle.cjs.map +1 -1
  108. package/dist/array/toggle.js +1 -8
  109. package/dist/array/toggle.js.map +1 -1
  110. package/dist/array/union.cjs +1 -1
  111. package/dist/array/union.cjs.map +1 -1
  112. package/dist/array/union.js +1 -8
  113. package/dist/array/union.js.map +1 -1
  114. package/dist/array/uniq.cjs +1 -1
  115. package/dist/array/uniq.cjs.map +1 -1
  116. package/dist/array/uniq.js +1 -8
  117. package/dist/array/uniq.js.map +1 -1
  118. package/dist/array/unzip.cjs +1 -1
  119. package/dist/array/unzip.cjs.map +1 -1
  120. package/dist/array/unzip.js +1 -10
  121. package/dist/array/unzip.js.map +1 -1
  122. package/dist/array/zip.cjs +1 -1
  123. package/dist/array/zip.cjs.map +1 -1
  124. package/dist/array/zip.js +1 -10
  125. package/dist/array/zip.js.map +1 -1
  126. package/dist/arsenal.cjs +1 -1
  127. package/dist/arsenal.cjs.map +1 -1
  128. package/dist/arsenal.iife.js +1 -1
  129. package/dist/arsenal.iife.js.map +1 -1
  130. package/dist/arsenal.js +1 -1
  131. package/dist/arsenal.js.map +1 -1
  132. package/dist/async/abortError.cjs +1 -1
  133. package/dist/async/abortError.cjs.map +1 -1
  134. package/dist/async/abortError.js +1 -7
  135. package/dist/async/abortError.js.map +1 -1
  136. package/dist/async/abortable.cjs +1 -1
  137. package/dist/async/abortable.cjs.map +1 -1
  138. package/dist/async/abortable.js +1 -11
  139. package/dist/async/abortable.js.map +1 -1
  140. package/dist/async/attempt.cjs +1 -1
  141. package/dist/async/attempt.cjs.map +1 -1
  142. package/dist/async/attempt.js +1 -23
  143. package/dist/async/attempt.js.map +1 -1
  144. package/dist/async/backoff.cjs +1 -1
  145. package/dist/async/backoff.cjs.map +1 -1
  146. package/dist/async/backoff.js +1 -7
  147. package/dist/async/backoff.js.map +1 -1
  148. package/dist/async/index.js +1 -10
  149. package/dist/async/parallel.cjs +1 -1
  150. package/dist/async/parallel.cjs.map +1 -1
  151. package/dist/async/parallel.js +1 -24
  152. package/dist/async/parallel.js.map +1 -1
  153. package/dist/async/retry.cjs +1 -1
  154. package/dist/async/retry.cjs.map +1 -1
  155. package/dist/async/retry.d.ts +4 -6
  156. package/dist/async/retry.d.ts.map +1 -1
  157. package/dist/async/retry.js +1 -24
  158. package/dist/async/retry.js.map +1 -1
  159. package/dist/async/sleep.cjs +1 -1
  160. package/dist/async/sleep.cjs.map +1 -1
  161. package/dist/async/sleep.js +1 -15
  162. package/dist/async/sleep.js.map +1 -1
  163. package/dist/async/taskPool.cjs +1 -1
  164. package/dist/async/taskPool.cjs.map +1 -1
  165. package/dist/async/taskPool.js +1 -50
  166. package/dist/async/taskPool.js.map +1 -1
  167. package/dist/async/waitFor.cjs +1 -1
  168. package/dist/async/waitFor.cjs.map +1 -1
  169. package/dist/async/waitFor.js +1 -12
  170. package/dist/async/waitFor.js.map +1 -1
  171. package/dist/cache/cache.cjs +1 -1
  172. package/dist/cache/cache.cjs.map +1 -1
  173. package/dist/cache/cache.js +1 -59
  174. package/dist/cache/cache.js.map +1 -1
  175. package/dist/cache/index.js +1 -3
  176. package/dist/cache/memo.cjs +1 -1
  177. package/dist/cache/memo.cjs.map +1 -1
  178. package/dist/cache/memo.js +1 -37
  179. package/dist/cache/memo.js.map +1 -1
  180. package/dist/encoding/base64url.cjs +2 -0
  181. package/dist/encoding/base64url.cjs.map +1 -0
  182. package/dist/encoding/base64url.d.ts +9 -0
  183. package/dist/encoding/base64url.d.ts.map +1 -0
  184. package/dist/encoding/base64url.js +2 -0
  185. package/dist/encoding/base64url.js.map +1 -0
  186. package/dist/encoding/index.cjs +1 -0
  187. package/dist/encoding/index.d.ts +2 -0
  188. package/dist/encoding/index.d.ts.map +1 -0
  189. package/dist/encoding/index.js +1 -0
  190. package/dist/errors.cjs +1 -1
  191. package/dist/errors.cjs.map +1 -1
  192. package/dist/errors.js +1 -9
  193. package/dist/errors.js.map +1 -1
  194. package/dist/function/assert.cjs +1 -1
  195. package/dist/function/assert.cjs.map +1 -1
  196. package/dist/function/assert.js +1 -7
  197. package/dist/function/assert.js.map +1 -1
  198. package/dist/function/debounce.cjs +1 -1
  199. package/dist/function/debounce.cjs.map +1 -1
  200. package/dist/function/debounce.js +1 -26
  201. package/dist/function/debounce.js.map +1 -1
  202. package/dist/function/index.cjs +1 -1
  203. package/dist/function/index.d.ts +1 -0
  204. package/dist/function/index.d.ts.map +1 -1
  205. package/dist/function/index.js +1 -8
  206. package/dist/function/once.cjs +1 -1
  207. package/dist/function/once.cjs.map +1 -1
  208. package/dist/function/once.js +1 -10
  209. package/dist/function/once.js.map +1 -1
  210. package/dist/function/pipe.cjs +1 -1
  211. package/dist/function/pipe.cjs.map +1 -1
  212. package/dist/function/pipe.js +1 -9
  213. package/dist/function/pipe.js.map +1 -1
  214. package/dist/function/runAll.cjs +1 -1
  215. package/dist/function/runAll.cjs.map +1 -1
  216. package/dist/function/runAll.js +1 -18
  217. package/dist/function/runAll.js.map +1 -1
  218. package/dist/function/tap.cjs +1 -1
  219. package/dist/function/tap.cjs.map +1 -1
  220. package/dist/function/tap.js +1 -7
  221. package/dist/function/tap.js.map +1 -1
  222. package/dist/function/tapper.cjs +2 -0
  223. package/dist/function/tapper.cjs.map +1 -0
  224. package/dist/function/tapper.d.ts +27 -0
  225. package/dist/function/tapper.d.ts.map +1 -0
  226. package/dist/function/tapper.js +2 -0
  227. package/dist/function/tapper.js.map +1 -0
  228. package/dist/function/throttle.cjs +1 -1
  229. package/dist/function/throttle.cjs.map +1 -1
  230. package/dist/function/throttle.js +1 -35
  231. package/dist/function/throttle.js.map +1 -1
  232. package/dist/guards/combinators.cjs +1 -1
  233. package/dist/guards/combinators.cjs.map +1 -1
  234. package/dist/guards/combinators.js +1 -16
  235. package/dist/guards/combinators.js.map +1 -1
  236. package/dist/guards/index.js +1 -17
  237. package/dist/guards/isAbortError.cjs +1 -1
  238. package/dist/guards/isAbortError.cjs.map +1 -1
  239. package/dist/guards/isAbortError.js +1 -7
  240. package/dist/guards/isAbortError.js.map +1 -1
  241. package/dist/guards/isDate.cjs +1 -1
  242. package/dist/guards/isDate.cjs.map +1 -1
  243. package/dist/guards/isDate.js +1 -7
  244. package/dist/guards/isDate.js.map +1 -1
  245. package/dist/guards/isDefined.cjs +1 -1
  246. package/dist/guards/isDefined.cjs.map +1 -1
  247. package/dist/guards/isDefined.js +1 -7
  248. package/dist/guards/isDefined.js.map +1 -1
  249. package/dist/guards/isEmpty.cjs +1 -1
  250. package/dist/guards/isEmpty.cjs.map +1 -1
  251. package/dist/guards/isEmpty.js +1 -8
  252. package/dist/guards/isEmpty.js.map +1 -1
  253. package/dist/guards/isEqual.cjs +1 -1
  254. package/dist/guards/isEqual.cjs.map +1 -1
  255. package/dist/guards/isEqual.js +1 -33
  256. package/dist/guards/isEqual.js.map +1 -1
  257. package/dist/guards/isError.cjs +1 -1
  258. package/dist/guards/isError.cjs.map +1 -1
  259. package/dist/guards/isError.js +1 -7
  260. package/dist/guards/isError.js.map +1 -1
  261. package/dist/guards/isFunction.cjs +1 -1
  262. package/dist/guards/isFunction.cjs.map +1 -1
  263. package/dist/guards/isFunction.js +1 -7
  264. package/dist/guards/isFunction.js.map +1 -1
  265. package/dist/guards/isMatch.cjs +1 -1
  266. package/dist/guards/isMatch.cjs.map +1 -1
  267. package/dist/guards/isMatch.js +1 -22
  268. package/dist/guards/isMatch.js.map +1 -1
  269. package/dist/guards/isNil.cjs +1 -1
  270. package/dist/guards/isNil.cjs.map +1 -1
  271. package/dist/guards/isNil.js +1 -7
  272. package/dist/guards/isNil.js.map +1 -1
  273. package/dist/guards/isNumber.cjs +1 -1
  274. package/dist/guards/isNumber.cjs.map +1 -1
  275. package/dist/guards/isNumber.js +1 -7
  276. package/dist/guards/isNumber.js.map +1 -1
  277. package/dist/guards/isPlainObject.cjs +1 -1
  278. package/dist/guards/isPlainObject.cjs.map +1 -1
  279. package/dist/guards/isPlainObject.js +1 -9
  280. package/dist/guards/isPlainObject.js.map +1 -1
  281. package/dist/guards/isPrimitive.cjs +1 -1
  282. package/dist/guards/isPrimitive.cjs.map +1 -1
  283. package/dist/guards/isPrimitive.js +1 -7
  284. package/dist/guards/isPrimitive.js.map +1 -1
  285. package/dist/guards/isPromise.cjs +1 -1
  286. package/dist/guards/isPromise.cjs.map +1 -1
  287. package/dist/guards/isPromise.js +1 -7
  288. package/dist/guards/isPromise.js.map +1 -1
  289. package/dist/guards/isRegex.cjs +1 -1
  290. package/dist/guards/isRegex.cjs.map +1 -1
  291. package/dist/guards/isRegex.js +1 -7
  292. package/dist/guards/isRegex.js.map +1 -1
  293. package/dist/guards/shallowEqual.cjs +1 -1
  294. package/dist/guards/shallowEqual.cjs.map +1 -1
  295. package/dist/guards/shallowEqual.js +1 -19
  296. package/dist/guards/shallowEqual.js.map +1 -1
  297. package/dist/index.cjs +1 -1
  298. package/dist/index.d.ts +7 -0
  299. package/dist/index.d.ts.map +1 -1
  300. package/dist/index.js +1 -35
  301. package/dist/math/allocate.cjs +1 -1
  302. package/dist/math/allocate.cjs.map +1 -1
  303. package/dist/math/allocate.js +1 -18
  304. package/dist/math/allocate.js.map +1 -1
  305. package/dist/math/average.cjs +1 -1
  306. package/dist/math/average.cjs.map +1 -1
  307. package/dist/math/average.js +1 -8
  308. package/dist/math/average.js.map +1 -1
  309. package/dist/math/clamp.cjs +1 -1
  310. package/dist/math/clamp.cjs.map +1 -1
  311. package/dist/math/clamp.js +1 -7
  312. package/dist/math/clamp.js.map +1 -1
  313. package/dist/math/gcd.cjs +1 -1
  314. package/dist/math/gcd.cjs.map +1 -1
  315. package/dist/math/gcd.js +1 -13
  316. package/dist/math/gcd.js.map +1 -1
  317. package/dist/math/index.js +1 -16
  318. package/dist/math/lcm.cjs +1 -1
  319. package/dist/math/lcm.cjs.map +1 -1
  320. package/dist/math/lcm.js +1 -12
  321. package/dist/math/lcm.js.map +1 -1
  322. package/dist/math/lerp.cjs +1 -1
  323. package/dist/math/lerp.cjs.map +1 -1
  324. package/dist/math/lerp.js +1 -7
  325. package/dist/math/lerp.js.map +1 -1
  326. package/dist/math/linspace.cjs +1 -1
  327. package/dist/math/linspace.cjs.map +1 -1
  328. package/dist/math/linspace.js +1 -11
  329. package/dist/math/linspace.js.map +1 -1
  330. package/dist/math/median.cjs +1 -1
  331. package/dist/math/median.cjs.map +1 -1
  332. package/dist/math/median.js +1 -11
  333. package/dist/math/median.js.map +1 -1
  334. package/dist/math/mod.cjs +1 -1
  335. package/dist/math/mod.cjs.map +1 -1
  336. package/dist/math/mod.js +1 -8
  337. package/dist/math/mod.js.map +1 -1
  338. package/dist/math/normalize.cjs +1 -1
  339. package/dist/math/normalize.cjs.map +1 -1
  340. package/dist/math/normalize.js +1 -8
  341. package/dist/math/normalize.js.map +1 -1
  342. package/dist/math/range.cjs +1 -1
  343. package/dist/math/range.cjs.map +1 -1
  344. package/dist/math/range.js +1 -25
  345. package/dist/math/range.js.map +1 -1
  346. package/dist/math/round.cjs +1 -1
  347. package/dist/math/round.cjs.map +1 -1
  348. package/dist/math/round.js +1 -9
  349. package/dist/math/round.js.map +1 -1
  350. package/dist/math/standardDeviation.cjs +1 -1
  351. package/dist/math/standardDeviation.cjs.map +1 -1
  352. package/dist/math/standardDeviation.js +1 -8
  353. package/dist/math/standardDeviation.js.map +1 -1
  354. package/dist/math/sum.cjs +1 -1
  355. package/dist/math/sum.cjs.map +1 -1
  356. package/dist/math/sum.js +1 -11
  357. package/dist/math/sum.js.map +1 -1
  358. package/dist/math/variance.cjs +1 -1
  359. package/dist/math/variance.cjs.map +1 -1
  360. package/dist/math/variance.js +1 -10
  361. package/dist/math/variance.js.map +1 -1
  362. package/dist/object/defaults.cjs +1 -1
  363. package/dist/object/defaults.cjs.map +1 -1
  364. package/dist/object/defaults.js +1 -11
  365. package/dist/object/defaults.js.map +1 -1
  366. package/dist/object/diff.cjs +1 -1
  367. package/dist/object/diff.cjs.map +1 -1
  368. package/dist/object/diff.js +1 -26
  369. package/dist/object/diff.js.map +1 -1
  370. package/dist/object/filterValues.cjs +1 -1
  371. package/dist/object/filterValues.cjs.map +1 -1
  372. package/dist/object/filterValues.js +1 -10
  373. package/dist/object/filterValues.js.map +1 -1
  374. package/dist/object/flattenPaths.cjs +1 -1
  375. package/dist/object/flattenPaths.cjs.map +1 -1
  376. package/dist/object/flattenPaths.js +1 -30
  377. package/dist/object/flattenPaths.js.map +1 -1
  378. package/dist/object/getPath.cjs +1 -1
  379. package/dist/object/getPath.cjs.map +1 -1
  380. package/dist/object/getPath.js +1 -25
  381. package/dist/object/getPath.js.map +1 -1
  382. package/dist/object/hash.cjs +1 -1
  383. package/dist/object/hash.cjs.map +1 -1
  384. package/dist/object/hash.js +1 -27
  385. package/dist/object/hash.js.map +1 -1
  386. package/dist/object/index.js +1 -15
  387. package/dist/object/invert.cjs +1 -1
  388. package/dist/object/invert.cjs.map +1 -1
  389. package/dist/object/invert.js +1 -10
  390. package/dist/object/invert.js.map +1 -1
  391. package/dist/object/mapKeys.cjs +1 -1
  392. package/dist/object/mapKeys.cjs.map +1 -1
  393. package/dist/object/mapKeys.js +1 -14
  394. package/dist/object/mapKeys.js.map +1 -1
  395. package/dist/object/mapValues.cjs +1 -1
  396. package/dist/object/mapValues.cjs.map +1 -1
  397. package/dist/object/mapValues.js +1 -10
  398. package/dist/object/mapValues.js.map +1 -1
  399. package/dist/object/merge.cjs +1 -1
  400. package/dist/object/merge.cjs.map +1 -1
  401. package/dist/object/merge.js +1 -25
  402. package/dist/object/merge.js.map +1 -1
  403. package/dist/object/omit.cjs +1 -1
  404. package/dist/object/omit.cjs.map +1 -1
  405. package/dist/object/omit.js +1 -10
  406. package/dist/object/omit.js.map +1 -1
  407. package/dist/object/pick.cjs +1 -1
  408. package/dist/object/pick.cjs.map +1 -1
  409. package/dist/object/pick.js +1 -10
  410. package/dist/object/pick.js.map +1 -1
  411. package/dist/object/prune.cjs +1 -1
  412. package/dist/object/prune.cjs.map +1 -1
  413. package/dist/object/prune.js +1 -33
  414. package/dist/object/prune.js.map +1 -1
  415. package/dist/object/tryParseJson.cjs +1 -1
  416. package/dist/object/tryParseJson.cjs.map +1 -1
  417. package/dist/object/tryParseJson.js +1 -17
  418. package/dist/object/tryParseJson.js.map +1 -1
  419. package/dist/random/_index.cjs +1 -1
  420. package/dist/random/_index.cjs.map +1 -1
  421. package/dist/random/_index.js +1 -8
  422. package/dist/random/_index.js.map +1 -1
  423. package/dist/random/draw.cjs +1 -1
  424. package/dist/random/draw.cjs.map +1 -1
  425. package/dist/random/draw.js +1 -20
  426. package/dist/random/draw.js.map +1 -1
  427. package/dist/random/index.js +1 -5
  428. package/dist/random/random.cjs +1 -1
  429. package/dist/random/random.cjs.map +1 -1
  430. package/dist/random/random.js +1 -9
  431. package/dist/random/random.js.map +1 -1
  432. package/dist/random/shuffle.cjs +1 -1
  433. package/dist/random/shuffle.cjs.map +1 -1
  434. package/dist/random/shuffle.js +1 -13
  435. package/dist/random/shuffle.js.map +1 -1
  436. package/dist/random/source.cjs +1 -1
  437. package/dist/random/source.cjs.map +1 -1
  438. package/dist/random/source.js +1 -9
  439. package/dist/random/source.js.map +1 -1
  440. package/dist/string/_caseUtils.cjs +1 -1
  441. package/dist/string/_caseUtils.cjs.map +1 -1
  442. package/dist/string/_caseUtils.js +1 -12
  443. package/dist/string/_caseUtils.js.map +1 -1
  444. package/dist/string/camelCase.cjs +1 -1
  445. package/dist/string/camelCase.cjs.map +1 -1
  446. package/dist/string/camelCase.js +1 -8
  447. package/dist/string/camelCase.js.map +1 -1
  448. package/dist/string/escape.cjs +1 -1
  449. package/dist/string/escape.cjs.map +1 -1
  450. package/dist/string/escape.js +1 -14
  451. package/dist/string/escape.js.map +1 -1
  452. package/dist/string/index.js +1 -12
  453. package/dist/string/kebabCase.cjs +1 -1
  454. package/dist/string/kebabCase.cjs.map +1 -1
  455. package/dist/string/kebabCase.js +1 -8
  456. package/dist/string/kebabCase.js.map +1 -1
  457. package/dist/string/padCenter.cjs +1 -1
  458. package/dist/string/padCenter.cjs.map +1 -1
  459. package/dist/string/padCenter.js +1 -9
  460. package/dist/string/padCenter.js.map +1 -1
  461. package/dist/string/pascalCase.cjs +1 -1
  462. package/dist/string/pascalCase.cjs.map +1 -1
  463. package/dist/string/pascalCase.js +1 -8
  464. package/dist/string/pascalCase.js.map +1 -1
  465. package/dist/string/similarity.cjs +1 -1
  466. package/dist/string/similarity.cjs.map +1 -1
  467. package/dist/string/similarity.js +1 -22
  468. package/dist/string/similarity.js.map +1 -1
  469. package/dist/string/snakeCase.cjs +1 -1
  470. package/dist/string/snakeCase.cjs.map +1 -1
  471. package/dist/string/snakeCase.js +1 -8
  472. package/dist/string/snakeCase.js.map +1 -1
  473. package/dist/string/titleCase.cjs +1 -1
  474. package/dist/string/titleCase.cjs.map +1 -1
  475. package/dist/string/titleCase.js +1 -8
  476. package/dist/string/titleCase.js.map +1 -1
  477. package/dist/string/truncate.cjs +1 -1
  478. package/dist/string/truncate.cjs.map +1 -1
  479. package/dist/string/truncate.js +1 -15
  480. package/dist/string/truncate.js.map +1 -1
  481. package/dist/string/unescape.cjs +1 -1
  482. package/dist/string/unescape.cjs.map +1 -1
  483. package/dist/string/unescape.js +1 -14
  484. package/dist/string/unescape.js.map +1 -1
  485. package/dist/string/words.cjs +1 -1
  486. package/dist/string/words.cjs.map +1 -1
  487. package/dist/string/words.js +1 -9
  488. package/dist/string/words.js.map +1 -1
  489. package/dist/types.d.ts +10 -0
  490. package/dist/types.d.ts.map +1 -1
  491. package/package.json +13 -5
@@ -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: 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,EAAS,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
+ {"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"}
@@ -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: 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,EAAS,GAA8B,IAAO,GAAqB;CACjF,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: readonly T[]): Array<Exclude<T, Falsy>> {\n return array.filter(Boolean) as Array<Exclude<T, Falsy>>;\n}\n"],"mappings":"AAKA,SAAgB,EAAW,EAA+C,CACxE,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"}
@@ -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: readonly T[]): Array<Exclude<T, Falsy>> {\n return array.filter(Boolean) as Array<Exclude<T, Falsy>>;\n}\n"],"mappings":";AAKA,SAAgB,EAAW,GAA+C;CACxE,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: 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,EAAY,EAAqB,EAAyB,CAOxE,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"}
@@ -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: 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":";;AAkBA,SAAgB,EAAY,GAAqB,GAAyB;CAOxE,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: 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,EAAW,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"}
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"}
@@ -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: 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":";;AAQA,SAAgB,EAAW,GAAqB,GAA0D;CACxG,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 *\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,EAAc,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
+ {"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,14 +1,2 @@
1
- import { toSelectorSet as e } from "../_common/_selectorSet.js";
2
- //#region src/array/difference.ts
3
- function t(t, n, r) {
4
- if (!r) {
5
- let e = new Set(n);
6
- return t.filter((t) => !e.has(t));
7
- }
8
- let i = e(n, r);
9
- return t.filter((e) => !i.has(r(e)));
10
- }
11
- //#endregion
12
- export { t as difference };
13
-
1
+ import{toSelectorSet as e}from"../_common/_selectorSet.js";function difference(t,n,r){if(!r){let e=new Set(n);return t.filter(t=>!e.has(t))}let i=e(n,r);return t.filter(e=>!i.has(r(e)))}export{difference};
14
2
  //# sourceMappingURL=difference.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"difference.js","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":";;AAQA,SAAgB,EAAc,GAAsB,GAAqB,GAAwC;CAC/G,IAAI,CAAC,GAAU;EACb,IAAM,IAAO,IAAI,IAAI,CAAK;EAE1B,OAAO,EAAO,QAAQ,MAAS,CAAC,EAAK,IAAI,CAAI,CAAC;CAChD;CAEA,IAAM,IAAO,EAAc,GAAO,CAAQ;CAE1C,OAAO,EAAO,QAAQ,MAAS,CAAC,EAAK,IAAI,EAAS,CAAI,CAAC,CAAC;AAC1D"}
1
+ {"version":3,"file":"difference.js","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":"2DAQA,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,EAAc,EAAO,CAAQ,EAE1C,OAAO,EAAO,OAAQ,GAAS,CAAC,EAAK,IAAI,EAAS,CAAI,CAAC,CAAC,CAC1D"}
@@ -1,2 +1,2 @@
1
- function e(e,t=1){let n=Math.max(0,Math.floor(t));return e.slice(n)}exports.drop=e;
1
+ function drop(e,t=1){let n=Math.max(0,Math.floor(t));return e.slice(n)}exports.drop=drop;
2
2
  //# sourceMappingURL=drop.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"drop.cjs","names":[],"sources":["../../src/array/drop.ts"],"sourcesContent":["/**\n * Drops the first n elements from an array.\n */\nexport function drop<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(count);\n}\n"],"mappings":"AAGA,SAAgB,EAAQ,EAAqB,EAAI,EAAQ,CACvD,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAEvC,OAAO,EAAM,MAAM,CAAK,CAC1B"}
1
+ {"version":3,"file":"drop.cjs","names":[],"sources":["../../src/array/drop.ts"],"sourcesContent":["/**\n * Drops the first n elements from an array.\n */\nexport function drop<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(count);\n}\n"],"mappings":"AAGA,SAAgB,KAAQ,EAAqB,EAAI,EAAQ,CACvD,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAEvC,OAAO,EAAM,MAAM,CAAK,CAC1B"}
@@ -1,9 +1,2 @@
1
- //#region src/array/drop.ts
2
- function e(e, t = 1) {
3
- let n = Math.max(0, Math.floor(t));
4
- return e.slice(n);
5
- }
6
- //#endregion
7
- export { e as drop };
8
-
1
+ function drop(e,t=1){let n=Math.max(0,Math.floor(t));return e.slice(n)}export{drop};
9
2
  //# sourceMappingURL=drop.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drop.js","names":[],"sources":["../../src/array/drop.ts"],"sourcesContent":["/**\n * Drops the first n elements from an array.\n */\nexport function drop<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(count);\n}\n"],"mappings":";AAGA,SAAgB,EAAQ,GAAqB,IAAI,GAAQ;CACvD,IAAM,IAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,CAAC,CAAC;CAEvC,OAAO,EAAM,MAAM,CAAK;AAC1B"}
1
+ {"version":3,"file":"drop.js","names":[],"sources":["../../src/array/drop.ts"],"sourcesContent":["/**\n * Drops the first n elements from an array.\n */\nexport function drop<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(count);\n}\n"],"mappings":"AAGA,SAAgB,KAAQ,EAAqB,EAAI,EAAQ,CACvD,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAEvC,OAAO,EAAM,MAAM,CAAK,CAC1B"}
@@ -1,2 +1,2 @@
1
- function e(e,t=1){let n=Math.max(0,Math.floor(t));return n===0?[...e]:e.slice(0,Math.max(0,e.length-n))}exports.dropLast=e;
1
+ function dropLast(e,t=1){let n=Math.max(0,Math.floor(t));return n===0?[...e]:e.slice(0,Math.max(0,e.length-n))}exports.dropLast=dropLast;
2
2
  //# sourceMappingURL=dropLast.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropLast.cjs","names":[],"sources":["../../src/array/dropLast.ts"],"sourcesContent":["/**\n * Drops the last n elements from an array.\n */\nexport function dropLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [...array];\n\n return array.slice(0, Math.max(0, array.length - count));\n}\n"],"mappings":"AAGA,SAAgB,EAAY,EAAqB,EAAI,EAAQ,CAC3D,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAIvC,OAFI,IAAU,EAAU,CAAC,GAAG,CAAK,EAE1B,EAAM,MAAM,EAAG,KAAK,IAAI,EAAG,EAAM,OAAS,CAAK,CAAC,CACzD"}
1
+ {"version":3,"file":"dropLast.cjs","names":[],"sources":["../../src/array/dropLast.ts"],"sourcesContent":["/**\n * Drops the last n elements from an array.\n */\nexport function dropLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [...array];\n\n return array.slice(0, Math.max(0, array.length - count));\n}\n"],"mappings":"AAGA,SAAgB,SAAY,EAAqB,EAAI,EAAQ,CAC3D,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAIvC,OAFI,IAAU,EAAU,CAAC,GAAG,CAAK,EAE1B,EAAM,MAAM,EAAG,KAAK,IAAI,EAAG,EAAM,OAAS,CAAK,CAAC,CACzD"}
@@ -1,9 +1,2 @@
1
- //#region src/array/dropLast.ts
2
- function e(e, t = 1) {
3
- let n = Math.max(0, Math.floor(t));
4
- return n === 0 ? [...e] : e.slice(0, Math.max(0, e.length - n));
5
- }
6
- //#endregion
7
- export { e as dropLast };
8
-
1
+ function dropLast(e,t=1){let n=Math.max(0,Math.floor(t));return n===0?[...e]:e.slice(0,Math.max(0,e.length-n))}export{dropLast};
9
2
  //# sourceMappingURL=dropLast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropLast.js","names":[],"sources":["../../src/array/dropLast.ts"],"sourcesContent":["/**\n * Drops the last n elements from an array.\n */\nexport function dropLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [...array];\n\n return array.slice(0, Math.max(0, array.length - count));\n}\n"],"mappings":";AAGA,SAAgB,EAAY,GAAqB,IAAI,GAAQ;CAC3D,IAAM,IAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,CAAC,CAAC;CAIvC,OAFI,MAAU,IAAU,CAAC,GAAG,CAAK,IAE1B,EAAM,MAAM,GAAG,KAAK,IAAI,GAAG,EAAM,SAAS,CAAK,CAAC;AACzD"}
1
+ {"version":3,"file":"dropLast.js","names":[],"sources":["../../src/array/dropLast.ts"],"sourcesContent":["/**\n * Drops the last n elements from an array.\n */\nexport function dropLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [...array];\n\n return array.slice(0, Math.max(0, array.length - count));\n}\n"],"mappings":"AAGA,SAAgB,SAAY,EAAqB,EAAI,EAAQ,CAC3D,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAIvC,OAFI,IAAU,EAAU,CAAC,GAAG,CAAK,EAE1B,EAAM,MAAM,EAAG,KAAK,IAAI,EAAG,EAAM,OAAS,CAAK,CAAC,CACzD"}
@@ -1,2 +1,2 @@
1
- function e(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);i!==void 0&&n.push(i)}return n}exports.filterMap=e;
1
+ function filterMap(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);i!==void 0&&n.push(i)}return n}exports.filterMap=filterMap;
2
2
  //# sourceMappingURL=filterMap.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"filterMap.cjs","names":[],"sources":["../../src/array/filterMap.ts"],"sourcesContent":["/**\n * Maps and filters in one pass. Returning `undefined` drops an item.\n *\n * Allocates a new array for the result.\n */\nexport function filterMap<T, R>(\n array: readonly T[],\n callback: (item: T, index: number, array: readonly T[]) => R | undefined,\n): R[] {\n const result: R[] = [];\n\n for (let index = 0; index < array.length; index++) {\n const value = callback(array[index], index, array);\n\n if (value !== undefined) {\n result.push(value);\n }\n }\n\n return result;\n}\n"],"mappings":"AAKA,SAAgB,EACd,EACA,EACK,CACL,IAAM,EAAc,CAAC,EAErB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IAAS,CACjD,IAAM,EAAQ,EAAS,EAAM,GAAQ,EAAO,CAAK,EAE7C,IAAU,IAAA,IACZ,EAAO,KAAK,CAAK,CAErB,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"filterMap.cjs","names":[],"sources":["../../src/array/filterMap.ts"],"sourcesContent":["/**\n * Maps and filters in one pass. Returning `undefined` drops an item.\n *\n * Allocates a new array for the result.\n */\nexport function filterMap<T, R>(\n array: readonly T[],\n callback: (item: T, index: number, array: readonly T[]) => R | undefined,\n): R[] {\n const result: R[] = [];\n\n for (let index = 0; index < array.length; index++) {\n const value = callback(array[index], index, array);\n\n if (value !== undefined) {\n result.push(value);\n }\n }\n\n return result;\n}\n"],"mappings":"AAKA,SAAgB,UACd,EACA,EACK,CACL,IAAM,EAAc,CAAC,EAErB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IAAS,CACjD,IAAM,EAAQ,EAAS,EAAM,GAAQ,EAAO,CAAK,EAE7C,IAAU,IAAA,IACZ,EAAO,KAAK,CAAK,CAErB,CAEA,OAAO,CACT"}
@@ -1,13 +1,2 @@
1
- //#region src/array/filterMap.ts
2
- function e(e, t) {
3
- let n = [];
4
- for (let r = 0; r < e.length; r++) {
5
- let i = t(e[r], r, e);
6
- i !== void 0 && n.push(i);
7
- }
8
- return n;
9
- }
10
- //#endregion
11
- export { e as filterMap };
12
-
1
+ function filterMap(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);i!==void 0&&n.push(i)}return n}export{filterMap};
13
2
  //# sourceMappingURL=filterMap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filterMap.js","names":[],"sources":["../../src/array/filterMap.ts"],"sourcesContent":["/**\n * Maps and filters in one pass. Returning `undefined` drops an item.\n *\n * Allocates a new array for the result.\n */\nexport function filterMap<T, R>(\n array: readonly T[],\n callback: (item: T, index: number, array: readonly T[]) => R | undefined,\n): R[] {\n const result: R[] = [];\n\n for (let index = 0; index < array.length; index++) {\n const value = callback(array[index], index, array);\n\n if (value !== undefined) {\n result.push(value);\n }\n }\n\n return result;\n}\n"],"mappings":";AAKA,SAAgB,EACd,GACA,GACK;CACL,IAAM,IAAc,CAAC;CAErB,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAM,QAAQ,KAAS;EACjD,IAAM,IAAQ,EAAS,EAAM,IAAQ,GAAO,CAAK;EAEjD,AAAI,MAAU,KAAA,KACZ,EAAO,KAAK,CAAK;CAErB;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"filterMap.js","names":[],"sources":["../../src/array/filterMap.ts"],"sourcesContent":["/**\n * Maps and filters in one pass. Returning `undefined` drops an item.\n *\n * Allocates a new array for the result.\n */\nexport function filterMap<T, R>(\n array: readonly T[],\n callback: (item: T, index: number, array: readonly T[]) => R | undefined,\n): R[] {\n const result: R[] = [];\n\n for (let index = 0; index < array.length; index++) {\n const value = callback(array[index], index, array);\n\n if (value !== undefined) {\n result.push(value);\n }\n }\n\n return result;\n}\n"],"mappings":"AAKA,SAAgB,UACd,EACA,EACK,CACL,IAAM,EAAc,CAAC,EAErB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IAAS,CACjD,IAAM,EAAQ,EAAS,EAAM,GAAQ,EAAO,CAAK,EAE7C,IAAU,IAAA,IACZ,EAAO,KAAK,CAAK,CAErB,CAEA,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- function e(e,t){return e.length>0?e[0]:t}exports.first=e;
1
+ function first(e,t){return e.length>0?e[0]:t}exports.first=first;
2
2
  //# sourceMappingURL=first.cjs.map