@vielzeug/arsenal 3.0.0 → 26.10.1

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 (518) hide show
  1. package/README.md +2 -2
  2. package/dist/_common/_lruMap.cjs +1 -1
  3. package/dist/_common/_lruMap.cjs.map +1 -1
  4. package/dist/_common/_lruMap.d.ts +1 -1
  5. package/dist/_common/_lruMap.js +1 -17
  6. package/dist/_common/_lruMap.js.map +1 -1
  7. package/dist/_common/_selectorSet.cjs +1 -1
  8. package/dist/_common/_selectorSet.cjs.map +1 -1
  9. package/dist/_common/_selectorSet.js +1 -15
  10. package/dist/_common/_selectorSet.js.map +1 -1
  11. package/dist/_common/unsafePaths.cjs +1 -1
  12. package/dist/_common/unsafePaths.cjs.map +1 -1
  13. package/dist/_common/unsafePaths.d.ts +1 -1
  14. package/dist/_common/unsafePaths.js +1 -12
  15. package/dist/_common/unsafePaths.js.map +1 -1
  16. package/dist/_dev.cjs +1 -1
  17. package/dist/_dev.cjs.map +1 -1
  18. package/dist/_dev.js +1 -5
  19. package/dist/_dev.js.map +1 -1
  20. package/dist/array/chunk.cjs +1 -1
  21. package/dist/array/chunk.cjs.map +1 -1
  22. package/dist/array/chunk.js +1 -9
  23. package/dist/array/chunk.js.map +1 -1
  24. package/dist/array/compact.cjs +1 -1
  25. package/dist/array/compact.cjs.map +1 -1
  26. package/dist/array/compact.js +1 -7
  27. package/dist/array/compact.js.map +1 -1
  28. package/dist/array/compare.cjs +1 -1
  29. package/dist/array/compare.cjs.map +1 -1
  30. package/dist/array/compare.js +1 -18
  31. package/dist/array/compare.js.map +1 -1
  32. package/dist/array/compareBy.cjs +1 -1
  33. package/dist/array/compareBy.cjs.map +1 -1
  34. package/dist/array/compareBy.js +1 -15
  35. package/dist/array/compareBy.js.map +1 -1
  36. package/dist/array/contains.cjs +1 -1
  37. package/dist/array/contains.cjs.map +1 -1
  38. package/dist/array/contains.js +1 -8
  39. package/dist/array/contains.js.map +1 -1
  40. package/dist/array/countBy.cjs +1 -1
  41. package/dist/array/countBy.cjs.map +1 -1
  42. package/dist/array/countBy.js +1 -13
  43. package/dist/array/countBy.js.map +1 -1
  44. package/dist/array/difference.cjs +1 -1
  45. package/dist/array/difference.cjs.map +1 -1
  46. package/dist/array/difference.js +1 -13
  47. package/dist/array/difference.js.map +1 -1
  48. package/dist/array/drop.cjs +1 -1
  49. package/dist/array/drop.cjs.map +1 -1
  50. package/dist/array/drop.js +1 -8
  51. package/dist/array/drop.js.map +1 -1
  52. package/dist/array/dropLast.cjs +1 -1
  53. package/dist/array/dropLast.cjs.map +1 -1
  54. package/dist/array/dropLast.js +1 -8
  55. package/dist/array/dropLast.js.map +1 -1
  56. package/dist/array/filterMap.cjs +1 -1
  57. package/dist/array/filterMap.cjs.map +1 -1
  58. package/dist/array/filterMap.js +1 -12
  59. package/dist/array/filterMap.js.map +1 -1
  60. package/dist/array/first.cjs +1 -1
  61. package/dist/array/first.cjs.map +1 -1
  62. package/dist/array/first.js +1 -7
  63. package/dist/array/first.js.map +1 -1
  64. package/dist/array/groupBy.cjs +1 -1
  65. package/dist/array/groupBy.cjs.map +1 -1
  66. package/dist/array/groupBy.js +1 -13
  67. package/dist/array/groupBy.js.map +1 -1
  68. package/dist/array/index.js +1 -28
  69. package/dist/array/indexBy.cjs +1 -1
  70. package/dist/array/indexBy.cjs.map +1 -1
  71. package/dist/array/indexBy.js +1 -13
  72. package/dist/array/indexBy.js.map +1 -1
  73. package/dist/array/intersection.cjs +1 -1
  74. package/dist/array/intersection.cjs.map +1 -1
  75. package/dist/array/intersection.js +1 -13
  76. package/dist/array/intersection.js.map +1 -1
  77. package/dist/array/last.cjs +1 -1
  78. package/dist/array/last.cjs.map +1 -1
  79. package/dist/array/last.js +1 -7
  80. package/dist/array/last.js.map +1 -1
  81. package/dist/array/partition.cjs +1 -1
  82. package/dist/array/partition.cjs.map +1 -1
  83. package/dist/array/partition.js +1 -9
  84. package/dist/array/partition.js.map +1 -1
  85. package/dist/array/replace.cjs +1 -1
  86. package/dist/array/replace.cjs.map +1 -1
  87. package/dist/array/replace.js +1 -12
  88. package/dist/array/replace.js.map +1 -1
  89. package/dist/array/rotate.cjs +1 -1
  90. package/dist/array/rotate.cjs.map +1 -1
  91. package/dist/array/rotate.js +1 -9
  92. package/dist/array/rotate.js.map +1 -1
  93. package/dist/array/search.cjs +1 -1
  94. package/dist/array/search.cjs.map +1 -1
  95. package/dist/array/search.js +1 -29
  96. package/dist/array/search.js.map +1 -1
  97. package/dist/array/sort.cjs +1 -1
  98. package/dist/array/sort.cjs.map +1 -1
  99. package/dist/array/sort.d.ts +1 -1
  100. package/dist/array/sort.js +1 -14
  101. package/dist/array/sort.js.map +1 -1
  102. package/dist/array/take.cjs +1 -1
  103. package/dist/array/take.cjs.map +1 -1
  104. package/dist/array/take.js +1 -8
  105. package/dist/array/take.js.map +1 -1
  106. package/dist/array/takeLast.cjs +1 -1
  107. package/dist/array/takeLast.cjs.map +1 -1
  108. package/dist/array/takeLast.js +1 -8
  109. package/dist/array/takeLast.js.map +1 -1
  110. package/dist/array/toggle.cjs +1 -1
  111. package/dist/array/toggle.cjs.map +1 -1
  112. package/dist/array/toggle.js +1 -8
  113. package/dist/array/toggle.js.map +1 -1
  114. package/dist/array/union.cjs +1 -1
  115. package/dist/array/union.cjs.map +1 -1
  116. package/dist/array/union.js +1 -8
  117. package/dist/array/union.js.map +1 -1
  118. package/dist/array/uniq.cjs +1 -1
  119. package/dist/array/uniq.cjs.map +1 -1
  120. package/dist/array/uniq.js +1 -8
  121. package/dist/array/uniq.js.map +1 -1
  122. package/dist/array/unzip.cjs +1 -1
  123. package/dist/array/unzip.cjs.map +1 -1
  124. package/dist/array/unzip.js +1 -10
  125. package/dist/array/unzip.js.map +1 -1
  126. package/dist/array/zip.cjs +1 -1
  127. package/dist/array/zip.cjs.map +1 -1
  128. package/dist/array/zip.js +1 -10
  129. package/dist/array/zip.js.map +1 -1
  130. package/dist/arsenal.cjs +1 -1
  131. package/dist/arsenal.cjs.map +1 -1
  132. package/dist/arsenal.iife.js +1 -1
  133. package/dist/arsenal.iife.js.map +1 -1
  134. package/dist/arsenal.js +1 -1
  135. package/dist/arsenal.js.map +1 -1
  136. package/dist/async/abortError.cjs +1 -1
  137. package/dist/async/abortError.cjs.map +1 -1
  138. package/dist/async/abortError.js +1 -7
  139. package/dist/async/abortError.js.map +1 -1
  140. package/dist/async/abortable.cjs +1 -1
  141. package/dist/async/abortable.cjs.map +1 -1
  142. package/dist/async/abortable.d.ts +1 -1
  143. package/dist/async/abortable.js +1 -11
  144. package/dist/async/abortable.js.map +1 -1
  145. package/dist/async/attempt.cjs +1 -1
  146. package/dist/async/attempt.cjs.map +1 -1
  147. package/dist/async/attempt.d.ts +1 -1
  148. package/dist/async/attempt.js +1 -23
  149. package/dist/async/attempt.js.map +1 -1
  150. package/dist/async/backoff.cjs +1 -1
  151. package/dist/async/backoff.cjs.map +1 -1
  152. package/dist/async/backoff.d.ts +1 -1
  153. package/dist/async/backoff.js +1 -7
  154. package/dist/async/backoff.js.map +1 -1
  155. package/dist/async/index.js +1 -10
  156. package/dist/async/parallel.cjs +1 -1
  157. package/dist/async/parallel.cjs.map +1 -1
  158. package/dist/async/parallel.js +1 -24
  159. package/dist/async/parallel.js.map +1 -1
  160. package/dist/async/retry.cjs +1 -1
  161. package/dist/async/retry.cjs.map +1 -1
  162. package/dist/async/retry.d.ts +5 -7
  163. package/dist/async/retry.d.ts.map +1 -1
  164. package/dist/async/retry.js +1 -24
  165. package/dist/async/retry.js.map +1 -1
  166. package/dist/async/sleep.cjs +1 -1
  167. package/dist/async/sleep.cjs.map +1 -1
  168. package/dist/async/sleep.js +1 -15
  169. package/dist/async/sleep.js.map +1 -1
  170. package/dist/async/taskPool.cjs +1 -1
  171. package/dist/async/taskPool.cjs.map +1 -1
  172. package/dist/async/taskPool.js +1 -50
  173. package/dist/async/taskPool.js.map +1 -1
  174. package/dist/async/waitFor.cjs +1 -1
  175. package/dist/async/waitFor.cjs.map +1 -1
  176. package/dist/async/waitFor.js +1 -12
  177. package/dist/async/waitFor.js.map +1 -1
  178. package/dist/cache/cache.cjs +1 -1
  179. package/dist/cache/cache.cjs.map +1 -1
  180. package/dist/cache/cache.js +1 -59
  181. package/dist/cache/cache.js.map +1 -1
  182. package/dist/cache/index.js +1 -3
  183. package/dist/cache/memo.cjs +1 -1
  184. package/dist/cache/memo.cjs.map +1 -1
  185. package/dist/cache/memo.d.ts +1 -1
  186. package/dist/cache/memo.js +1 -37
  187. package/dist/cache/memo.js.map +1 -1
  188. package/dist/encoding/base64url.cjs +2 -0
  189. package/dist/encoding/base64url.cjs.map +1 -0
  190. package/dist/encoding/base64url.d.ts +9 -0
  191. package/dist/encoding/base64url.d.ts.map +1 -0
  192. package/dist/encoding/base64url.js +2 -0
  193. package/dist/encoding/base64url.js.map +1 -0
  194. package/dist/encoding/index.cjs +1 -0
  195. package/dist/encoding/index.d.ts +2 -0
  196. package/dist/encoding/index.d.ts.map +1 -0
  197. package/dist/encoding/index.js +1 -0
  198. package/dist/errors.cjs +1 -1
  199. package/dist/errors.cjs.map +1 -1
  200. package/dist/errors.d.ts +1 -1
  201. package/dist/errors.js +1 -9
  202. package/dist/errors.js.map +1 -1
  203. package/dist/function/assert.cjs +1 -1
  204. package/dist/function/assert.cjs.map +1 -1
  205. package/dist/function/assert.d.ts +1 -0
  206. package/dist/function/assert.d.ts.map +1 -1
  207. package/dist/function/assert.js +1 -7
  208. package/dist/function/assert.js.map +1 -1
  209. package/dist/function/debounce.cjs +1 -1
  210. package/dist/function/debounce.cjs.map +1 -1
  211. package/dist/function/debounce.d.ts +2 -2
  212. package/dist/function/debounce.js +1 -26
  213. package/dist/function/debounce.js.map +1 -1
  214. package/dist/function/index.cjs +1 -1
  215. package/dist/function/index.d.ts +1 -0
  216. package/dist/function/index.d.ts.map +1 -1
  217. package/dist/function/index.js +1 -8
  218. package/dist/function/once.cjs +1 -1
  219. package/dist/function/once.cjs.map +1 -1
  220. package/dist/function/once.d.ts +3 -3
  221. package/dist/function/once.js +1 -10
  222. package/dist/function/once.js.map +1 -1
  223. package/dist/function/pipe.cjs +1 -1
  224. package/dist/function/pipe.cjs.map +1 -1
  225. package/dist/function/pipe.d.ts +1 -1
  226. package/dist/function/pipe.js +1 -9
  227. package/dist/function/pipe.js.map +1 -1
  228. package/dist/function/runAll.cjs +1 -1
  229. package/dist/function/runAll.cjs.map +1 -1
  230. package/dist/function/runAll.js +1 -18
  231. package/dist/function/runAll.js.map +1 -1
  232. package/dist/function/tap.cjs +1 -1
  233. package/dist/function/tap.cjs.map +1 -1
  234. package/dist/function/tap.js +1 -7
  235. package/dist/function/tap.js.map +1 -1
  236. package/dist/function/tapper.cjs +2 -0
  237. package/dist/function/tapper.cjs.map +1 -0
  238. package/dist/function/tapper.d.ts +27 -0
  239. package/dist/function/tapper.d.ts.map +1 -0
  240. package/dist/function/tapper.js +2 -0
  241. package/dist/function/tapper.js.map +1 -0
  242. package/dist/function/throttle.cjs +1 -1
  243. package/dist/function/throttle.cjs.map +1 -1
  244. package/dist/function/throttle.js +1 -35
  245. package/dist/function/throttle.js.map +1 -1
  246. package/dist/guards/combinators.cjs +1 -1
  247. package/dist/guards/combinators.cjs.map +1 -1
  248. package/dist/guards/combinators.d.ts +1 -1
  249. package/dist/guards/combinators.js +1 -16
  250. package/dist/guards/combinators.js.map +1 -1
  251. package/dist/guards/index.js +1 -17
  252. package/dist/guards/isAbortError.cjs +1 -1
  253. package/dist/guards/isAbortError.cjs.map +1 -1
  254. package/dist/guards/isAbortError.d.ts +2 -2
  255. package/dist/guards/isAbortError.js +1 -7
  256. package/dist/guards/isAbortError.js.map +1 -1
  257. package/dist/guards/isDate.cjs +1 -1
  258. package/dist/guards/isDate.cjs.map +1 -1
  259. package/dist/guards/isDate.js +1 -7
  260. package/dist/guards/isDate.js.map +1 -1
  261. package/dist/guards/isDefined.cjs +1 -1
  262. package/dist/guards/isDefined.cjs.map +1 -1
  263. package/dist/guards/isDefined.js +1 -7
  264. package/dist/guards/isDefined.js.map +1 -1
  265. package/dist/guards/isEmpty.cjs +1 -1
  266. package/dist/guards/isEmpty.cjs.map +1 -1
  267. package/dist/guards/isEmpty.js +1 -8
  268. package/dist/guards/isEmpty.js.map +1 -1
  269. package/dist/guards/isEqual.cjs +1 -1
  270. package/dist/guards/isEqual.cjs.map +1 -1
  271. package/dist/guards/isEqual.d.ts +1 -1
  272. package/dist/guards/isEqual.js +1 -33
  273. package/dist/guards/isEqual.js.map +1 -1
  274. package/dist/guards/isError.cjs +1 -1
  275. package/dist/guards/isError.cjs.map +1 -1
  276. package/dist/guards/isError.js +1 -7
  277. package/dist/guards/isError.js.map +1 -1
  278. package/dist/guards/isFunction.cjs +1 -1
  279. package/dist/guards/isFunction.cjs.map +1 -1
  280. package/dist/guards/isFunction.js +1 -7
  281. package/dist/guards/isFunction.js.map +1 -1
  282. package/dist/guards/isMatch.cjs +1 -1
  283. package/dist/guards/isMatch.cjs.map +1 -1
  284. package/dist/guards/isMatch.js +1 -22
  285. package/dist/guards/isMatch.js.map +1 -1
  286. package/dist/guards/isNil.cjs +1 -1
  287. package/dist/guards/isNil.cjs.map +1 -1
  288. package/dist/guards/isNil.js +1 -7
  289. package/dist/guards/isNil.js.map +1 -1
  290. package/dist/guards/isNumber.cjs +1 -1
  291. package/dist/guards/isNumber.cjs.map +1 -1
  292. package/dist/guards/isNumber.js +1 -7
  293. package/dist/guards/isNumber.js.map +1 -1
  294. package/dist/guards/isPlainObject.cjs +1 -1
  295. package/dist/guards/isPlainObject.cjs.map +1 -1
  296. package/dist/guards/isPlainObject.d.ts +1 -1
  297. package/dist/guards/isPlainObject.js +1 -9
  298. package/dist/guards/isPlainObject.js.map +1 -1
  299. package/dist/guards/isPrimitive.cjs +1 -1
  300. package/dist/guards/isPrimitive.cjs.map +1 -1
  301. package/dist/guards/isPrimitive.js +1 -7
  302. package/dist/guards/isPrimitive.js.map +1 -1
  303. package/dist/guards/isPromise.cjs +1 -1
  304. package/dist/guards/isPromise.cjs.map +1 -1
  305. package/dist/guards/isPromise.js +1 -7
  306. package/dist/guards/isPromise.js.map +1 -1
  307. package/dist/guards/isRegex.cjs +1 -1
  308. package/dist/guards/isRegex.cjs.map +1 -1
  309. package/dist/guards/isRegex.js +1 -7
  310. package/dist/guards/isRegex.js.map +1 -1
  311. package/dist/guards/shallowEqual.cjs +1 -1
  312. package/dist/guards/shallowEqual.cjs.map +1 -1
  313. package/dist/guards/shallowEqual.d.ts +3 -3
  314. package/dist/guards/shallowEqual.js +1 -19
  315. package/dist/guards/shallowEqual.js.map +1 -1
  316. package/dist/index.cjs +1 -1
  317. package/dist/index.d.ts +7 -0
  318. package/dist/index.d.ts.map +1 -1
  319. package/dist/index.js +1 -35
  320. package/dist/math/allocate.cjs +1 -1
  321. package/dist/math/allocate.cjs.map +1 -1
  322. package/dist/math/allocate.js +1 -18
  323. package/dist/math/allocate.js.map +1 -1
  324. package/dist/math/average.cjs +1 -1
  325. package/dist/math/average.cjs.map +1 -1
  326. package/dist/math/average.js +1 -8
  327. package/dist/math/average.js.map +1 -1
  328. package/dist/math/clamp.cjs +1 -1
  329. package/dist/math/clamp.cjs.map +1 -1
  330. package/dist/math/clamp.d.ts +6 -6
  331. package/dist/math/clamp.js +1 -7
  332. package/dist/math/clamp.js.map +1 -1
  333. package/dist/math/gcd.cjs +1 -1
  334. package/dist/math/gcd.cjs.map +1 -1
  335. package/dist/math/gcd.d.ts +1 -1
  336. package/dist/math/gcd.js +1 -13
  337. package/dist/math/gcd.js.map +1 -1
  338. package/dist/math/index.js +1 -16
  339. package/dist/math/lcm.cjs +1 -1
  340. package/dist/math/lcm.cjs.map +1 -1
  341. package/dist/math/lcm.js +1 -12
  342. package/dist/math/lcm.js.map +1 -1
  343. package/dist/math/lerp.cjs +1 -1
  344. package/dist/math/lerp.cjs.map +1 -1
  345. package/dist/math/lerp.d.ts +1 -1
  346. package/dist/math/lerp.js +1 -7
  347. package/dist/math/lerp.js.map +1 -1
  348. package/dist/math/linspace.cjs +1 -1
  349. package/dist/math/linspace.cjs.map +1 -1
  350. package/dist/math/linspace.js +1 -11
  351. package/dist/math/linspace.js.map +1 -1
  352. package/dist/math/median.cjs +1 -1
  353. package/dist/math/median.cjs.map +1 -1
  354. package/dist/math/median.js +1 -11
  355. package/dist/math/median.js.map +1 -1
  356. package/dist/math/mod.cjs +1 -1
  357. package/dist/math/mod.cjs.map +1 -1
  358. package/dist/math/mod.d.ts +1 -1
  359. package/dist/math/mod.js +1 -8
  360. package/dist/math/mod.js.map +1 -1
  361. package/dist/math/normalize.cjs +1 -1
  362. package/dist/math/normalize.cjs.map +1 -1
  363. package/dist/math/normalize.js +1 -8
  364. package/dist/math/normalize.js.map +1 -1
  365. package/dist/math/range.cjs +1 -1
  366. package/dist/math/range.cjs.map +1 -1
  367. package/dist/math/range.js +1 -25
  368. package/dist/math/range.js.map +1 -1
  369. package/dist/math/round.cjs +1 -1
  370. package/dist/math/round.cjs.map +1 -1
  371. package/dist/math/round.js +1 -9
  372. package/dist/math/round.js.map +1 -1
  373. package/dist/math/standardDeviation.cjs +1 -1
  374. package/dist/math/standardDeviation.cjs.map +1 -1
  375. package/dist/math/standardDeviation.js +1 -8
  376. package/dist/math/standardDeviation.js.map +1 -1
  377. package/dist/math/sum.cjs +1 -1
  378. package/dist/math/sum.cjs.map +1 -1
  379. package/dist/math/sum.js +1 -11
  380. package/dist/math/sum.js.map +1 -1
  381. package/dist/math/variance.cjs +1 -1
  382. package/dist/math/variance.cjs.map +1 -1
  383. package/dist/math/variance.js +1 -10
  384. package/dist/math/variance.js.map +1 -1
  385. package/dist/object/defaults.cjs +1 -1
  386. package/dist/object/defaults.cjs.map +1 -1
  387. package/dist/object/defaults.d.ts +1 -1
  388. package/dist/object/defaults.js +1 -11
  389. package/dist/object/defaults.js.map +1 -1
  390. package/dist/object/diff.cjs +1 -1
  391. package/dist/object/diff.cjs.map +1 -1
  392. package/dist/object/diff.d.ts +1 -1
  393. package/dist/object/diff.js +1 -26
  394. package/dist/object/diff.js.map +1 -1
  395. package/dist/object/filterValues.cjs +1 -1
  396. package/dist/object/filterValues.cjs.map +1 -1
  397. package/dist/object/filterValues.js +1 -10
  398. package/dist/object/filterValues.js.map +1 -1
  399. package/dist/object/flattenPaths.cjs +1 -1
  400. package/dist/object/flattenPaths.cjs.map +1 -1
  401. package/dist/object/flattenPaths.js +1 -30
  402. package/dist/object/flattenPaths.js.map +1 -1
  403. package/dist/object/getPath.cjs +1 -1
  404. package/dist/object/getPath.cjs.map +1 -1
  405. package/dist/object/getPath.js +1 -25
  406. package/dist/object/getPath.js.map +1 -1
  407. package/dist/object/hash.cjs +1 -1
  408. package/dist/object/hash.cjs.map +1 -1
  409. package/dist/object/hash.d.ts +2 -2
  410. package/dist/object/hash.js +1 -27
  411. package/dist/object/hash.js.map +1 -1
  412. package/dist/object/index.js +1 -15
  413. package/dist/object/invert.cjs +1 -1
  414. package/dist/object/invert.cjs.map +1 -1
  415. package/dist/object/invert.js +1 -10
  416. package/dist/object/invert.js.map +1 -1
  417. package/dist/object/mapKeys.cjs +1 -1
  418. package/dist/object/mapKeys.cjs.map +1 -1
  419. package/dist/object/mapKeys.js +1 -14
  420. package/dist/object/mapKeys.js.map +1 -1
  421. package/dist/object/mapValues.cjs +1 -1
  422. package/dist/object/mapValues.cjs.map +1 -1
  423. package/dist/object/mapValues.js +1 -10
  424. package/dist/object/mapValues.js.map +1 -1
  425. package/dist/object/merge.cjs +1 -1
  426. package/dist/object/merge.cjs.map +1 -1
  427. package/dist/object/merge.js +1 -25
  428. package/dist/object/merge.js.map +1 -1
  429. package/dist/object/omit.cjs +1 -1
  430. package/dist/object/omit.cjs.map +1 -1
  431. package/dist/object/omit.js +1 -10
  432. package/dist/object/omit.js.map +1 -1
  433. package/dist/object/pick.cjs +1 -1
  434. package/dist/object/pick.cjs.map +1 -1
  435. package/dist/object/pick.d.ts +1 -1
  436. package/dist/object/pick.js +1 -10
  437. package/dist/object/pick.js.map +1 -1
  438. package/dist/object/prune.cjs +1 -1
  439. package/dist/object/prune.cjs.map +1 -1
  440. package/dist/object/prune.js +1 -33
  441. package/dist/object/prune.js.map +1 -1
  442. package/dist/object/tryParseJson.cjs +1 -1
  443. package/dist/object/tryParseJson.cjs.map +1 -1
  444. package/dist/object/tryParseJson.js +1 -17
  445. package/dist/object/tryParseJson.js.map +1 -1
  446. package/dist/random/_index.cjs +1 -1
  447. package/dist/random/_index.cjs.map +1 -1
  448. package/dist/random/_index.js +1 -8
  449. package/dist/random/_index.js.map +1 -1
  450. package/dist/random/draw.cjs +1 -1
  451. package/dist/random/draw.cjs.map +1 -1
  452. package/dist/random/draw.js +1 -20
  453. package/dist/random/draw.js.map +1 -1
  454. package/dist/random/index.js +1 -5
  455. package/dist/random/random.cjs +1 -1
  456. package/dist/random/random.cjs.map +1 -1
  457. package/dist/random/random.js +1 -9
  458. package/dist/random/random.js.map +1 -1
  459. package/dist/random/shuffle.cjs +1 -1
  460. package/dist/random/shuffle.cjs.map +1 -1
  461. package/dist/random/shuffle.js +1 -13
  462. package/dist/random/shuffle.js.map +1 -1
  463. package/dist/random/source.cjs +1 -1
  464. package/dist/random/source.cjs.map +1 -1
  465. package/dist/random/source.js +1 -9
  466. package/dist/random/source.js.map +1 -1
  467. package/dist/string/_caseUtils.cjs +1 -1
  468. package/dist/string/_caseUtils.cjs.map +1 -1
  469. package/dist/string/_caseUtils.js +1 -12
  470. package/dist/string/_caseUtils.js.map +1 -1
  471. package/dist/string/camelCase.cjs +1 -1
  472. package/dist/string/camelCase.cjs.map +1 -1
  473. package/dist/string/camelCase.js +1 -8
  474. package/dist/string/camelCase.js.map +1 -1
  475. package/dist/string/escape.cjs +1 -1
  476. package/dist/string/escape.cjs.map +1 -1
  477. package/dist/string/escape.js +1 -14
  478. package/dist/string/escape.js.map +1 -1
  479. package/dist/string/index.js +1 -12
  480. package/dist/string/kebabCase.cjs +1 -1
  481. package/dist/string/kebabCase.cjs.map +1 -1
  482. package/dist/string/kebabCase.js +1 -8
  483. package/dist/string/kebabCase.js.map +1 -1
  484. package/dist/string/padCenter.cjs +1 -1
  485. package/dist/string/padCenter.cjs.map +1 -1
  486. package/dist/string/padCenter.js +1 -9
  487. package/dist/string/padCenter.js.map +1 -1
  488. package/dist/string/pascalCase.cjs +1 -1
  489. package/dist/string/pascalCase.cjs.map +1 -1
  490. package/dist/string/pascalCase.js +1 -8
  491. package/dist/string/pascalCase.js.map +1 -1
  492. package/dist/string/similarity.cjs +1 -1
  493. package/dist/string/similarity.cjs.map +1 -1
  494. package/dist/string/similarity.js +1 -22
  495. package/dist/string/similarity.js.map +1 -1
  496. package/dist/string/snakeCase.cjs +1 -1
  497. package/dist/string/snakeCase.cjs.map +1 -1
  498. package/dist/string/snakeCase.js +1 -8
  499. package/dist/string/snakeCase.js.map +1 -1
  500. package/dist/string/titleCase.cjs +1 -1
  501. package/dist/string/titleCase.cjs.map +1 -1
  502. package/dist/string/titleCase.js +1 -8
  503. package/dist/string/titleCase.js.map +1 -1
  504. package/dist/string/truncate.cjs +1 -1
  505. package/dist/string/truncate.cjs.map +1 -1
  506. package/dist/string/truncate.js +1 -15
  507. package/dist/string/truncate.js.map +1 -1
  508. package/dist/string/unescape.cjs +1 -1
  509. package/dist/string/unescape.cjs.map +1 -1
  510. package/dist/string/unescape.js +1 -14
  511. package/dist/string/unescape.js.map +1 -1
  512. package/dist/string/words.cjs +1 -1
  513. package/dist/string/words.cjs.map +1 -1
  514. package/dist/string/words.js +1 -9
  515. package/dist/string/words.js.map +1 -1
  516. package/dist/types.d.ts +10 -0
  517. package/dist/types.d.ts.map +1 -1
  518. package/package.json +13 -5
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"first.cjs","names":[],"sources":["../../src/array/first.ts"],"sourcesContent":["/**\n * Returns the first element or fallback when array is empty.\n */\nexport function first<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[0] : fallback;\n}\n"],"mappings":"AAGA,SAAgB,EAAS,EAAqB,EAA6B,CACzE,OAAO,EAAM,OAAS,EAAI,EAAM,GAAK,CACvC"}
1
+ {"version":3,"file":"first.cjs","names":[],"sources":["../../src/array/first.ts"],"sourcesContent":["/**\n * Returns the first element or fallback when array is empty.\n */\nexport function first<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[0] : fallback;\n}\n"],"mappings":"AAGA,SAAgB,MAAS,EAAqB,EAA6B,CACzE,OAAO,EAAM,OAAS,EAAI,EAAM,GAAK,CACvC"}
@@ -1,8 +1,2 @@
1
- //#region src/array/first.ts
2
- function e(e, t) {
3
- return e.length > 0 ? e[0] : t;
4
- }
5
- //#endregion
6
- export { e as first };
7
-
1
+ function first(e,t){return e.length>0?e[0]:t}export{first};
8
2
  //# sourceMappingURL=first.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"first.js","names":[],"sources":["../../src/array/first.ts"],"sourcesContent":["/**\n * Returns the first element or fallback when array is empty.\n */\nexport function first<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[0] : fallback;\n}\n"],"mappings":";AAGA,SAAgB,EAAS,GAAqB,GAA6B;CACzE,OAAO,EAAM,SAAS,IAAI,EAAM,KAAK;AACvC"}
1
+ {"version":3,"file":"first.js","names":[],"sources":["../../src/array/first.ts"],"sourcesContent":["/**\n * Returns the first element or fallback when array is empty.\n */\nexport function first<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[0] : fallback;\n}\n"],"mappings":"AAGA,SAAgB,MAAS,EAAqB,EAA6B,CACzE,OAAO,EAAM,OAAS,EAAI,EAAM,GAAK,CACvC"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t,n){let r={};for(let i of t){let t=n(i),a=t==null?`_`:String(t);e.isUnsafeKey(a)||(r[a]||(r[a]=[]),r[a].push(i))}return r}exports.groupBy=t;
1
+ const e=require("../_common/unsafePaths.cjs");function groupBy(t,n){let r={};for(let i of t){let t=n(i),a=t==null?`_`:String(t);e.isUnsafeKey(a)||(r[a]||(r[a]=[]),r[a].push(i))}return r}exports.groupBy=groupBy;
2
2
  //# sourceMappingURL=groupBy.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"groupBy.cjs","names":[],"sources":["../../src/array/groupBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Groups elements by a selector function. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are skipped.\n */\nexport function groupBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T[]> {\n const result: Record<string, T[]> = {};\n\n for (const item of array) {\n const rawKey = selector(item);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n if (!result[key]) {\n result[key] = [];\n }\n\n result[key].push(item);\n }\n\n return result;\n}\n"],"mappings":"8CAOA,SAAgB,EAAW,EAAqB,EAAuD,CACrG,IAAM,EAA8B,CAAC,EAErC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAS,EAAS,CAAI,EACtB,EAAM,GAAmC,KAAO,IAAM,OAAO,CAAM,EAErE,EAAA,YAAY,CAAG,IAEd,EAAO,KACV,EAAO,GAAO,CAAC,GAGjB,EAAO,EAAI,CAAC,KAAK,CAAI,EACvB,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"groupBy.cjs","names":[],"sources":["../../src/array/groupBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Groups elements by a selector function. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are skipped.\n */\nexport function groupBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T[]> {\n const result: Record<string, T[]> = {};\n\n for (const item of array) {\n const rawKey = selector(item);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n if (!result[key]) {\n result[key] = [];\n }\n\n result[key].push(item);\n }\n\n return result;\n}\n"],"mappings":"8CAOA,SAAgB,QAAW,EAAqB,EAAuD,CACrG,IAAM,EAA8B,CAAC,EAErC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAS,EAAS,CAAI,EACtB,EAAM,GAAmC,KAAO,IAAM,OAAO,CAAM,EAErE,EAAA,YAAY,CAAG,IAEd,EAAO,KACV,EAAO,GAAO,CAAC,GAGjB,EAAO,EAAI,CAAC,KAAK,CAAI,EACvB,CAEA,OAAO,CACT"}
@@ -1,14 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/array/groupBy.ts
3
- function t(t, n) {
4
- let r = {};
5
- for (let i of t) {
6
- let t = n(i), a = t == null ? "_" : String(t);
7
- e(a) || (r[a] || (r[a] = []), r[a].push(i));
8
- }
9
- return r;
10
- }
11
- //#endregion
12
- export { t as groupBy };
13
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function groupBy(t,n){let r={};for(let i of t){let t=n(i),a=t==null?`_`:String(t);e(a)||(r[a]||(r[a]=[]),r[a].push(i))}return r}export{groupBy};
14
2
  //# sourceMappingURL=groupBy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"groupBy.js","names":[],"sources":["../../src/array/groupBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Groups elements by a selector function. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are skipped.\n */\nexport function groupBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T[]> {\n const result: Record<string, T[]> = {};\n\n for (const item of array) {\n const rawKey = selector(item);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n if (!result[key]) {\n result[key] = [];\n }\n\n result[key].push(item);\n }\n\n return result;\n}\n"],"mappings":";;AAOA,SAAgB,EAAW,GAAqB,GAAuD;CACrG,IAAM,IAA8B,CAAC;CAErC,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAS,EAAS,CAAI,GACtB,IAAM,KAAmC,OAAO,MAAM,OAAO,CAAM;EAErE,EAAY,CAAG,MAEd,EAAO,OACV,EAAO,KAAO,CAAC,IAGjB,EAAO,EAAI,CAAC,KAAK,CAAI;CACvB;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"groupBy.js","names":[],"sources":["../../src/array/groupBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Groups elements by a selector function. Dangerous keys (`__proto__`, `constructor`,\n * `prototype`) are skipped.\n */\nexport function groupBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T[]> {\n const result: Record<string, T[]> = {};\n\n for (const item of array) {\n const rawKey = selector(item);\n const key = rawKey === undefined || rawKey === null ? '_' : String(rawKey);\n\n if (isUnsafeKey(key)) continue;\n\n if (!result[key]) {\n result[key] = [];\n }\n\n result[key].push(item);\n }\n\n return result;\n}\n"],"mappings":"wDAOA,SAAgB,QAAW,EAAqB,EAAuD,CACrG,IAAM,EAA8B,CAAC,EAErC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAS,EAAS,CAAI,EACtB,EAAM,GAAmC,KAAO,IAAM,OAAO,CAAM,EAErE,EAAY,CAAG,IAEd,EAAO,KACV,EAAO,GAAO,CAAC,GAGjB,EAAO,EAAI,CAAC,KAAK,CAAI,EACvB,CAEA,OAAO,CACT"}
@@ -1,28 +1 @@
1
- import { chunk as e } from "./chunk.js";
2
- import { compact as t } from "./compact.js";
3
- import { compare as n } from "./compare.js";
4
- import { compareBy as r } from "./compareBy.js";
5
- import { contains as i } from "./contains.js";
6
- import { countBy as a } from "./countBy.js";
7
- import { difference as o } from "./difference.js";
8
- import { drop as s } from "./drop.js";
9
- import { dropLast as c } from "./dropLast.js";
10
- import { filterMap as l } from "./filterMap.js";
11
- import { first as u } from "./first.js";
12
- import { groupBy as d } from "./groupBy.js";
13
- import { indexBy as f } from "./indexBy.js";
14
- import { intersection as p } from "./intersection.js";
15
- import { last as m } from "./last.js";
16
- import { partition as h } from "./partition.js";
17
- import { replace as g } from "./replace.js";
18
- import { rotate as _ } from "./rotate.js";
19
- import { fuzzyFilter as v, fuzzyScore as y } from "./search.js";
20
- import { sort as b } from "./sort.js";
21
- import { take as x } from "./take.js";
22
- import { takeLast as S } from "./takeLast.js";
23
- import { toggle as C } from "./toggle.js";
24
- import { union as w } from "./union.js";
25
- import { uniq as T } from "./uniq.js";
26
- import { unzip as E } from "./unzip.js";
27
- import { zip as D } from "./zip.js";
28
- export { e as chunk, t as compact, n as compare, r as compareBy, i as contains, a as countBy, o as difference, s as drop, c as dropLast, l as filterMap, u as first, v as fuzzyFilter, y as fuzzyScore, d as groupBy, f as indexBy, p as intersection, m as last, h as partition, g as replace, _ as rotate, b as sort, x as take, S as takeLast, C as toggle, w as union, T as uniq, E as unzip, D as zip };
1
+ import{chunk as e}from"./chunk.js";import{compact as t}from"./compact.js";import{compare as n}from"./compare.js";import{compareBy as r}from"./compareBy.js";import{contains as i}from"./contains.js";import{countBy as a}from"./countBy.js";import{difference as o}from"./difference.js";import{drop as s}from"./drop.js";import{dropLast as c}from"./dropLast.js";import{filterMap as l}from"./filterMap.js";import{first as u}from"./first.js";import{groupBy as d}from"./groupBy.js";import{indexBy as f}from"./indexBy.js";import{intersection as p}from"./intersection.js";import{last as m}from"./last.js";import{partition as h}from"./partition.js";import{replace as g}from"./replace.js";import{rotate as _}from"./rotate.js";import{fuzzyFilter as v,fuzzyScore as y}from"./search.js";import{sort as b}from"./sort.js";import{take as x}from"./take.js";import{takeLast as S}from"./takeLast.js";import{toggle as C}from"./toggle.js";import{union as w}from"./union.js";import{uniq as T}from"./uniq.js";import{unzip as E}from"./unzip.js";import{zip as D}from"./zip.js";export{e as chunk,t as compact,n as compare,r as compareBy,i as contains,a as countBy,o as difference,s as drop,c as dropLast,l as filterMap,u as first,v as fuzzyFilter,y as fuzzyScore,d as groupBy,f as indexBy,p as intersection,m as last,h as partition,g as replace,_ as rotate,b as sort,x as take,S as takeLast,C as toggle,w as union,T as uniq,E as unzip,D as zip};
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs");function t(t,n){let r={};for(let i of t){let t=String(n(i));e.isUnsafeKey(t)||(r[t]=i)}return r}exports.indexBy=t;
1
+ const e=require("../_common/unsafePaths.cjs");function indexBy(t,n){let r={};for(let i of t){let t=String(n(i));e.isUnsafeKey(t)||(r[t]=i)}return r}exports.indexBy=indexBy;
2
2
  //# sourceMappingURL=indexBy.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexBy.cjs","names":[],"sources":["../../src/array/indexBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Creates an object keyed by selector result. Last item wins on collisions. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are skipped.\n */\nexport function indexBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T> {\n const result: Record<string, T> = {};\n\n for (const item of array) {\n const key = String(selector(item));\n\n if (isUnsafeKey(key)) continue;\n\n result[key] = item;\n }\n\n return result;\n}\n"],"mappings":"8CAOA,SAAgB,EAAW,EAAqB,EAAqD,CACnG,IAAM,EAA4B,CAAC,EAEnC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,OAAO,EAAS,CAAI,CAAC,EAE7B,EAAA,YAAY,CAAG,IAEnB,EAAO,GAAO,EAChB,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"indexBy.cjs","names":[],"sources":["../../src/array/indexBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Creates an object keyed by selector result. Last item wins on collisions. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are skipped.\n */\nexport function indexBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T> {\n const result: Record<string, T> = {};\n\n for (const item of array) {\n const key = String(selector(item));\n\n if (isUnsafeKey(key)) continue;\n\n result[key] = item;\n }\n\n return result;\n}\n"],"mappings":"8CAOA,SAAgB,QAAW,EAAqB,EAAqD,CACnG,IAAM,EAA4B,CAAC,EAEnC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,OAAO,EAAS,CAAI,CAAC,EAE7B,EAAA,YAAY,CAAG,IAEnB,EAAO,GAAO,EAChB,CAEA,OAAO,CACT"}
@@ -1,14 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- //#region src/array/indexBy.ts
3
- function t(t, n) {
4
- let r = {};
5
- for (let i of t) {
6
- let t = String(n(i));
7
- e(t) || (r[t] = i);
8
- }
9
- return r;
10
- }
11
- //#endregion
12
- export { t as indexBy };
13
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";function indexBy(t,n){let r={};for(let i of t){let t=String(n(i));e(t)||(r[t]=i)}return r}export{indexBy};
14
2
  //# sourceMappingURL=indexBy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexBy.js","names":[],"sources":["../../src/array/indexBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Creates an object keyed by selector result. Last item wins on collisions. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are skipped.\n */\nexport function indexBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T> {\n const result: Record<string, T> = {};\n\n for (const item of array) {\n const key = String(selector(item));\n\n if (isUnsafeKey(key)) continue;\n\n result[key] = item;\n }\n\n return result;\n}\n"],"mappings":";;AAOA,SAAgB,EAAW,GAAqB,GAAqD;CACnG,IAAM,IAA4B,CAAC;CAEnC,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAM,OAAO,EAAS,CAAI,CAAC;EAE7B,EAAY,CAAG,MAEnB,EAAO,KAAO;CAChB;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"indexBy.js","names":[],"sources":["../../src/array/indexBy.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport type { Primitive } from '../types';\n\n/**\n * Creates an object keyed by selector result. Last item wins on collisions. Dangerous keys\n * (`__proto__`, `constructor`, `prototype`) are skipped.\n */\nexport function indexBy<T>(array: readonly T[], selector: (item: T) => Primitive): Record<string, T> {\n const result: Record<string, T> = {};\n\n for (const item of array) {\n const key = String(selector(item));\n\n if (isUnsafeKey(key)) continue;\n\n result[key] = item;\n }\n\n return result;\n}\n"],"mappings":"wDAOA,SAAgB,QAAW,EAAqB,EAAqD,CACnG,IAAM,EAA4B,CAAC,EAEnC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,OAAO,EAAS,CAAI,CAAC,EAE7B,EAAY,CAAG,IAEnB,EAAO,GAAO,EAChB,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.intersection=t;
1
+ const e=require("../_common/_selectorSet.cjs");function intersection(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.intersection=intersection;
2
2
  //# sourceMappingURL=intersection.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"intersection.cjs","names":[],"sources":["../../src/array/intersection.ts"],"sourcesContent":["import { toSelectorSet } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns elements that are present in both `source` and `other`.\n *\n * Allocates a `Set` from `other` for O(1) membership checks, plus a new array for the result.\n */\nexport function intersection<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n const allow = new Set(other);\n\n return source.filter((item) => allow.has(item));\n }\n\n const allow = toSelectorSet(other, selector);\n\n return source.filter((item) => allow.has(selector(item)));\n}\n"],"mappings":"+CAQA,SAAgB,EAAgB,EAAsB,EAAqB,EAAwC,CACjH,GAAI,CAAC,EAAU,CACb,IAAM,EAAQ,IAAI,IAAI,CAAK,EAE3B,OAAO,EAAO,OAAQ,GAAS,EAAM,IAAI,CAAI,CAAC,CAChD,CAEA,IAAM,EAAQ,EAAA,cAAc,EAAO,CAAQ,EAE3C,OAAO,EAAO,OAAQ,GAAS,EAAM,IAAI,EAAS,CAAI,CAAC,CAAC,CAC1D"}
1
+ {"version":3,"file":"intersection.cjs","names":[],"sources":["../../src/array/intersection.ts"],"sourcesContent":["import { toSelectorSet } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns elements that are present in both `source` and `other`.\n *\n * Allocates a `Set` from `other` for O(1) membership checks, plus a new array for the result.\n */\nexport function intersection<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n const allow = new Set(other);\n\n return source.filter((item) => allow.has(item));\n }\n\n const allow = toSelectorSet(other, selector);\n\n return source.filter((item) => allow.has(selector(item)));\n}\n"],"mappings":"+CAQA,SAAgB,aAAgB,EAAsB,EAAqB,EAAwC,CACjH,GAAI,CAAC,EAAU,CACb,IAAM,EAAQ,IAAI,IAAI,CAAK,EAE3B,OAAO,EAAO,OAAQ,GAAS,EAAM,IAAI,CAAI,CAAC,CAChD,CAEA,IAAM,EAAQ,EAAA,cAAc,EAAO,CAAQ,EAE3C,OAAO,EAAO,OAAQ,GAAS,EAAM,IAAI,EAAS,CAAI,CAAC,CAAC,CAC1D"}
@@ -1,14 +1,2 @@
1
- import { toSelectorSet as e } from "../_common/_selectorSet.js";
2
- //#region src/array/intersection.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 intersection };
13
-
1
+ import{toSelectorSet as e}from"../_common/_selectorSet.js";function intersection(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{intersection};
14
2
  //# sourceMappingURL=intersection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"intersection.js","names":[],"sources":["../../src/array/intersection.ts"],"sourcesContent":["import { toSelectorSet } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns elements that are present in both `source` and `other`.\n *\n * Allocates a `Set` from `other` for O(1) membership checks, plus a new array for the result.\n */\nexport function intersection<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n const allow = new Set(other);\n\n return source.filter((item) => allow.has(item));\n }\n\n const allow = toSelectorSet(other, selector);\n\n return source.filter((item) => allow.has(selector(item)));\n}\n"],"mappings":";;AAQA,SAAgB,EAAgB,GAAsB,GAAqB,GAAwC;CACjH,IAAI,CAAC,GAAU;EACb,IAAM,IAAQ,IAAI,IAAI,CAAK;EAE3B,OAAO,EAAO,QAAQ,MAAS,EAAM,IAAI,CAAI,CAAC;CAChD;CAEA,IAAM,IAAQ,EAAc,GAAO,CAAQ;CAE3C,OAAO,EAAO,QAAQ,MAAS,EAAM,IAAI,EAAS,CAAI,CAAC,CAAC;AAC1D"}
1
+ {"version":3,"file":"intersection.js","names":[],"sources":["../../src/array/intersection.ts"],"sourcesContent":["import { toSelectorSet } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns elements that are present in both `source` and `other`.\n *\n * Allocates a `Set` from `other` for O(1) membership checks, plus a new array for the result.\n */\nexport function intersection<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n const allow = new Set(other);\n\n return source.filter((item) => allow.has(item));\n }\n\n const allow = toSelectorSet(other, selector);\n\n return source.filter((item) => allow.has(selector(item)));\n}\n"],"mappings":"2DAQA,SAAgB,aAAgB,EAAsB,EAAqB,EAAwC,CACjH,GAAI,CAAC,EAAU,CACb,IAAM,EAAQ,IAAI,IAAI,CAAK,EAE3B,OAAO,EAAO,OAAQ,GAAS,EAAM,IAAI,CAAI,CAAC,CAChD,CAEA,IAAM,EAAQ,EAAc,EAAO,CAAQ,EAE3C,OAAO,EAAO,OAAQ,GAAS,EAAM,IAAI,EAAS,CAAI,CAAC,CAAC,CAC1D"}
@@ -1,2 +1,2 @@
1
- function e(e,t){return e.length>0?e[e.length-1]:t}exports.last=e;
1
+ function last(e,t){return e.length>0?e[e.length-1]:t}exports.last=last;
2
2
  //# sourceMappingURL=last.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"last.cjs","names":[],"sources":["../../src/array/last.ts"],"sourcesContent":["/**\n * Returns the last element or fallback when array is empty.\n */\nexport function last<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[array.length - 1] : fallback;\n}\n"],"mappings":"AAGA,SAAgB,EAAQ,EAAqB,EAA6B,CACxE,OAAO,EAAM,OAAS,EAAI,EAAM,EAAM,OAAS,GAAK,CACtD"}
1
+ {"version":3,"file":"last.cjs","names":[],"sources":["../../src/array/last.ts"],"sourcesContent":["/**\n * Returns the last element or fallback when array is empty.\n */\nexport function last<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[array.length - 1] : fallback;\n}\n"],"mappings":"AAGA,SAAgB,KAAQ,EAAqB,EAA6B,CACxE,OAAO,EAAM,OAAS,EAAI,EAAM,EAAM,OAAS,GAAK,CACtD"}
@@ -1,8 +1,2 @@
1
- //#region src/array/last.ts
2
- function e(e, t) {
3
- return e.length > 0 ? e[e.length - 1] : t;
4
- }
5
- //#endregion
6
- export { e as last };
7
-
1
+ function last(e,t){return e.length>0?e[e.length-1]:t}export{last};
8
2
  //# sourceMappingURL=last.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"last.js","names":[],"sources":["../../src/array/last.ts"],"sourcesContent":["/**\n * Returns the last element or fallback when array is empty.\n */\nexport function last<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[array.length - 1] : fallback;\n}\n"],"mappings":";AAGA,SAAgB,EAAQ,GAAqB,GAA6B;CACxE,OAAO,EAAM,SAAS,IAAI,EAAM,EAAM,SAAS,KAAK;AACtD"}
1
+ {"version":3,"file":"last.js","names":[],"sources":["../../src/array/last.ts"],"sourcesContent":["/**\n * Returns the last element or fallback when array is empty.\n */\nexport function last<T>(array: readonly T[], fallback?: T): T | undefined {\n return array.length > 0 ? array[array.length - 1] : fallback;\n}\n"],"mappings":"AAGA,SAAgB,KAAQ,EAAqB,EAA6B,CACxE,OAAO,EAAM,OAAS,EAAI,EAAM,EAAM,OAAS,GAAK,CACtD"}
@@ -1,2 +1,2 @@
1
- function e(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)t(e[i],i,e)?n.push(e[i]):r.push(e[i]);return[n,r]}exports.partition=e;
1
+ function partition(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)t(e[i],i,e)?n.push(e[i]):r.push(e[i]);return[n,r]}exports.partition=partition;
2
2
  //# sourceMappingURL=partition.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"partition.cjs","names":[],"sources":["../../src/array/partition.ts"],"sourcesContent":["/**\n * Splits an array into values that match and do not match the predicate.\n *\n * Allocates two new arrays for the accepted and rejected partitions.\n */\nexport function partition<T>(\n array: readonly T[],\n predicate: (item: T, index: number, array: readonly T[]) => boolean,\n): [T[], T[]] {\n const accepted: T[] = [];\n const rejected: T[] = [];\n\n for (let index = 0; index < array.length; index++) {\n if (predicate(array[index], index, array)) {\n accepted.push(array[index]);\n } else {\n rejected.push(array[index]);\n }\n }\n\n return [accepted, rejected];\n}\n"],"mappings":"AAKA,SAAgB,EACd,EACA,EACY,CACZ,IAAM,EAAgB,CAAC,EACjB,EAAgB,CAAC,EAEvB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IACpC,EAAU,EAAM,GAAQ,EAAO,CAAK,EACtC,EAAS,KAAK,EAAM,EAAM,EAE1B,EAAS,KAAK,EAAM,EAAM,EAI9B,MAAO,CAAC,EAAU,CAAQ,CAC5B"}
1
+ {"version":3,"file":"partition.cjs","names":[],"sources":["../../src/array/partition.ts"],"sourcesContent":["/**\n * Splits an array into values that match and do not match the predicate.\n *\n * Allocates two new arrays for the accepted and rejected partitions.\n */\nexport function partition<T>(\n array: readonly T[],\n predicate: (item: T, index: number, array: readonly T[]) => boolean,\n): [T[], T[]] {\n const accepted: T[] = [];\n const rejected: T[] = [];\n\n for (let index = 0; index < array.length; index++) {\n if (predicate(array[index], index, array)) {\n accepted.push(array[index]);\n } else {\n rejected.push(array[index]);\n }\n }\n\n return [accepted, rejected];\n}\n"],"mappings":"AAKA,SAAgB,UACd,EACA,EACY,CACZ,IAAM,EAAgB,CAAC,EACjB,EAAgB,CAAC,EAEvB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IACpC,EAAU,EAAM,GAAQ,EAAO,CAAK,EACtC,EAAS,KAAK,EAAM,EAAM,EAE1B,EAAS,KAAK,EAAM,EAAM,EAI9B,MAAO,CAAC,EAAU,CAAQ,CAC5B"}
@@ -1,10 +1,2 @@
1
- //#region src/array/partition.ts
2
- function e(e, t) {
3
- let n = [], r = [];
4
- for (let i = 0; i < e.length; i++) t(e[i], i, e) ? n.push(e[i]) : r.push(e[i]);
5
- return [n, r];
6
- }
7
- //#endregion
8
- export { e as partition };
9
-
1
+ function partition(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)t(e[i],i,e)?n.push(e[i]):r.push(e[i]);return[n,r]}export{partition};
10
2
  //# sourceMappingURL=partition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"partition.js","names":[],"sources":["../../src/array/partition.ts"],"sourcesContent":["/**\n * Splits an array into values that match and do not match the predicate.\n *\n * Allocates two new arrays for the accepted and rejected partitions.\n */\nexport function partition<T>(\n array: readonly T[],\n predicate: (item: T, index: number, array: readonly T[]) => boolean,\n): [T[], T[]] {\n const accepted: T[] = [];\n const rejected: T[] = [];\n\n for (let index = 0; index < array.length; index++) {\n if (predicate(array[index], index, array)) {\n accepted.push(array[index]);\n } else {\n rejected.push(array[index]);\n }\n }\n\n return [accepted, rejected];\n}\n"],"mappings":";AAKA,SAAgB,EACd,GACA,GACY;CACZ,IAAM,IAAgB,CAAC,GACjB,IAAgB,CAAC;CAEvB,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAM,QAAQ,KACxC,AAAI,EAAU,EAAM,IAAQ,GAAO,CAAK,IACtC,EAAS,KAAK,EAAM,EAAM,IAE1B,EAAS,KAAK,EAAM,EAAM;CAI9B,OAAO,CAAC,GAAU,CAAQ;AAC5B"}
1
+ {"version":3,"file":"partition.js","names":[],"sources":["../../src/array/partition.ts"],"sourcesContent":["/**\n * Splits an array into values that match and do not match the predicate.\n *\n * Allocates two new arrays for the accepted and rejected partitions.\n */\nexport function partition<T>(\n array: readonly T[],\n predicate: (item: T, index: number, array: readonly T[]) => boolean,\n): [T[], T[]] {\n const accepted: T[] = [];\n const rejected: T[] = [];\n\n for (let index = 0; index < array.length; index++) {\n if (predicate(array[index], index, array)) {\n accepted.push(array[index]);\n } else {\n rejected.push(array[index]);\n }\n }\n\n return [accepted, rejected];\n}\n"],"mappings":"AAKA,SAAgB,UACd,EACA,EACY,CACZ,IAAM,EAAgB,CAAC,EACjB,EAAgB,CAAC,EAEvB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,IACpC,EAAU,EAAM,GAAQ,EAAO,CAAK,EACtC,EAAS,KAAK,EAAM,EAAM,EAE1B,EAAS,KAAK,EAAM,EAAM,EAI9B,MAAO,CAAC,EAAU,CAAQ,CAC5B"}
@@ -1,2 +1,2 @@
1
- function e(e,t,n){let r=e.findIndex(t);return r===-1?e:[...e.slice(0,r),n,...e.slice(r+1)]}exports.replace=e;
1
+ function replace(e,t,n){let r=e.findIndex(t);return r===-1?e:[...e.slice(0,r),n,...e.slice(r+1)]}exports.replace=replace;
2
2
  //# sourceMappingURL=replace.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"replace.cjs","names":[],"sources":["../../src/array/replace.ts"],"sourcesContent":["import type { Predicate } from '../types';\n\n/** Replaces the first matching item without mutating the input. */\nexport function replace<T>(array: T[], predicate: Predicate<T>, value: T): T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[] {\n const index = array.findIndex(predicate);\n\n if (index === -1) return array;\n\n return [...array.slice(0, index), value, ...array.slice(index + 1)];\n}\n"],"mappings":"AAKA,SAAgB,EAAW,EAAqB,EAAyB,EAAwB,CAC/F,IAAM,EAAQ,EAAM,UAAU,CAAS,EAIvC,OAFI,IAAU,GAAW,EAElB,CAAC,GAAG,EAAM,MAAM,EAAG,CAAK,EAAG,EAAO,GAAG,EAAM,MAAM,EAAQ,CAAC,CAAC,CACpE"}
1
+ {"version":3,"file":"replace.cjs","names":[],"sources":["../../src/array/replace.ts"],"sourcesContent":["import type { Predicate } from '../types';\n\n/** Replaces the first matching item without mutating the input. */\nexport function replace<T>(array: T[], predicate: Predicate<T>, value: T): T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[] {\n const index = array.findIndex(predicate);\n\n if (index === -1) return array;\n\n return [...array.slice(0, index), value, ...array.slice(index + 1)];\n}\n"],"mappings":"AAKA,SAAgB,QAAW,EAAqB,EAAyB,EAAwB,CAC/F,IAAM,EAAQ,EAAM,UAAU,CAAS,EAIvC,OAFI,IAAU,GAAW,EAElB,CAAC,GAAG,EAAM,MAAM,EAAG,CAAK,EAAG,EAAO,GAAG,EAAM,MAAM,EAAQ,CAAC,CAAC,CACpE"}
@@ -1,13 +1,2 @@
1
- //#region src/array/replace.ts
2
- function e(e, t, n) {
3
- let r = e.findIndex(t);
4
- return r === -1 ? e : [
5
- ...e.slice(0, r),
6
- n,
7
- ...e.slice(r + 1)
8
- ];
9
- }
10
- //#endregion
11
- export { e as replace };
12
-
1
+ function replace(e,t,n){let r=e.findIndex(t);return r===-1?e:[...e.slice(0,r),n,...e.slice(r+1)]}export{replace};
13
2
  //# sourceMappingURL=replace.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"replace.js","names":[],"sources":["../../src/array/replace.ts"],"sourcesContent":["import type { Predicate } from '../types';\n\n/** Replaces the first matching item without mutating the input. */\nexport function replace<T>(array: T[], predicate: Predicate<T>, value: T): T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[] {\n const index = array.findIndex(predicate);\n\n if (index === -1) return array;\n\n return [...array.slice(0, index), value, ...array.slice(index + 1)];\n}\n"],"mappings":";AAKA,SAAgB,EAAW,GAAqB,GAAyB,GAAwB;CAC/F,IAAM,IAAQ,EAAM,UAAU,CAAS;CAIvC,OAFI,MAAU,KAAW,IAElB;EAAC,GAAG,EAAM,MAAM,GAAG,CAAK;EAAG;EAAO,GAAG,EAAM,MAAM,IAAQ,CAAC;CAAC;AACpE"}
1
+ {"version":3,"file":"replace.js","names":[],"sources":["../../src/array/replace.ts"],"sourcesContent":["import type { Predicate } from '../types';\n\n/** Replaces the first matching item without mutating the input. */\nexport function replace<T>(array: T[], predicate: Predicate<T>, value: T): T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[];\nexport function replace<T>(array: readonly T[], predicate: Predicate<T>, value: T): readonly T[] {\n const index = array.findIndex(predicate);\n\n if (index === -1) return array;\n\n return [...array.slice(0, index), value, ...array.slice(index + 1)];\n}\n"],"mappings":"AAKA,SAAgB,QAAW,EAAqB,EAAyB,EAAwB,CAC/F,IAAM,EAAQ,EAAM,UAAU,CAAS,EAIvC,OAFI,IAAU,GAAW,EAElB,CAAC,GAAG,EAAM,MAAM,EAAG,CAAK,EAAG,EAAO,GAAG,EAAM,MAAM,EAAQ,CAAC,CAAC,CACpE"}
@@ -1,2 +1,2 @@
1
- function e(e,t,{wrap:n=!1}={}){if(e.length===0)return e;let r=(t%e.length+e.length)%e.length,i=e.slice(r);return n?[...i,...e.slice(0,r)]:i}exports.rotate=e;
1
+ function rotate(e,t,{wrap:n=!1}={}){if(e.length===0)return e;let r=(t%e.length+e.length)%e.length,i=e.slice(r);return n?[...i,...e.slice(0,r)]:i}exports.rotate=rotate;
2
2
  //# sourceMappingURL=rotate.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rotate.cjs","names":[],"sources":["../../src/array/rotate.ts"],"sourcesContent":["/** Rotates or drops leading items without mutating the input. */\nexport function rotate<T>(array: T[], positions: number, options?: { wrap?: boolean }): T[];\nexport function rotate<T>(array: readonly T[], positions: number, options?: { wrap?: boolean }): readonly T[];\nexport function rotate<T>(\n array: readonly T[],\n positions: number,\n { wrap = false }: { wrap?: boolean } = {},\n): readonly T[] {\n if (array.length === 0) return array;\n\n const normalizedPosition = ((positions % array.length) + array.length) % array.length;\n const rotated = array.slice(normalizedPosition);\n\n return wrap ? [...rotated, ...array.slice(0, normalizedPosition)] : rotated;\n}\n"],"mappings":"AAGA,SAAgB,EACd,EACA,EACA,CAAE,OAAO,IAA8B,CAAC,EAC1B,CACd,GAAI,EAAM,SAAW,EAAG,OAAO,EAE/B,IAAM,GAAuB,EAAY,EAAM,OAAU,EAAM,QAAU,EAAM,OACzE,EAAU,EAAM,MAAM,CAAkB,EAE9C,OAAO,EAAO,CAAC,GAAG,EAAS,GAAG,EAAM,MAAM,EAAG,CAAkB,CAAC,EAAI,CACtE"}
1
+ {"version":3,"file":"rotate.cjs","names":[],"sources":["../../src/array/rotate.ts"],"sourcesContent":["/** Rotates or drops leading items without mutating the input. */\nexport function rotate<T>(array: T[], positions: number, options?: { wrap?: boolean }): T[];\nexport function rotate<T>(array: readonly T[], positions: number, options?: { wrap?: boolean }): readonly T[];\nexport function rotate<T>(\n array: readonly T[],\n positions: number,\n { wrap = false }: { wrap?: boolean } = {},\n): readonly T[] {\n if (array.length === 0) return array;\n\n const normalizedPosition = ((positions % array.length) + array.length) % array.length;\n const rotated = array.slice(normalizedPosition);\n\n return wrap ? [...rotated, ...array.slice(0, normalizedPosition)] : rotated;\n}\n"],"mappings":"AAGA,SAAgB,OACd,EACA,EACA,CAAE,OAAO,IAA8B,CAAC,EAC1B,CACd,GAAI,EAAM,SAAW,EAAG,OAAO,EAE/B,IAAM,GAAuB,EAAY,EAAM,OAAU,EAAM,QAAU,EAAM,OACzE,EAAU,EAAM,MAAM,CAAkB,EAE9C,OAAO,EAAO,CAAC,GAAG,EAAS,GAAG,EAAM,MAAM,EAAG,CAAkB,CAAC,EAAI,CACtE"}
@@ -1,10 +1,2 @@
1
- //#region src/array/rotate.ts
2
- function e(e, t, { wrap: n = !1 } = {}) {
3
- if (e.length === 0) return e;
4
- let r = (t % e.length + e.length) % e.length, i = e.slice(r);
5
- return n ? [...i, ...e.slice(0, r)] : i;
6
- }
7
- //#endregion
8
- export { e as rotate };
9
-
1
+ function rotate(e,t,{wrap:n=!1}={}){if(e.length===0)return e;let r=(t%e.length+e.length)%e.length,i=e.slice(r);return n?[...i,...e.slice(0,r)]:i}export{rotate};
10
2
  //# sourceMappingURL=rotate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rotate.js","names":[],"sources":["../../src/array/rotate.ts"],"sourcesContent":["/** Rotates or drops leading items without mutating the input. */\nexport function rotate<T>(array: T[], positions: number, options?: { wrap?: boolean }): T[];\nexport function rotate<T>(array: readonly T[], positions: number, options?: { wrap?: boolean }): readonly T[];\nexport function rotate<T>(\n array: readonly T[],\n positions: number,\n { wrap = false }: { wrap?: boolean } = {},\n): readonly T[] {\n if (array.length === 0) return array;\n\n const normalizedPosition = ((positions % array.length) + array.length) % array.length;\n const rotated = array.slice(normalizedPosition);\n\n return wrap ? [...rotated, ...array.slice(0, normalizedPosition)] : rotated;\n}\n"],"mappings":";AAGA,SAAgB,EACd,GACA,GACA,EAAE,UAAO,OAA8B,CAAC,GAC1B;CACd,IAAI,EAAM,WAAW,GAAG,OAAO;CAE/B,IAAM,KAAuB,IAAY,EAAM,SAAU,EAAM,UAAU,EAAM,QACzE,IAAU,EAAM,MAAM,CAAkB;CAE9C,OAAO,IAAO,CAAC,GAAG,GAAS,GAAG,EAAM,MAAM,GAAG,CAAkB,CAAC,IAAI;AACtE"}
1
+ {"version":3,"file":"rotate.js","names":[],"sources":["../../src/array/rotate.ts"],"sourcesContent":["/** Rotates or drops leading items without mutating the input. */\nexport function rotate<T>(array: T[], positions: number, options?: { wrap?: boolean }): T[];\nexport function rotate<T>(array: readonly T[], positions: number, options?: { wrap?: boolean }): readonly T[];\nexport function rotate<T>(\n array: readonly T[],\n positions: number,\n { wrap = false }: { wrap?: boolean } = {},\n): readonly T[] {\n if (array.length === 0) return array;\n\n const normalizedPosition = ((positions % array.length) + array.length) % array.length;\n const rotated = array.slice(normalizedPosition);\n\n return wrap ? [...rotated, ...array.slice(0, normalizedPosition)] : rotated;\n}\n"],"mappings":"AAGA,SAAgB,OACd,EACA,EACA,CAAE,OAAO,IAA8B,CAAC,EAC1B,CACd,GAAI,EAAM,SAAW,EAAG,OAAO,EAE/B,IAAM,GAAuB,EAAY,EAAM,OAAU,EAAM,QAAU,EAAM,OACzE,EAAU,EAAM,MAAM,CAAkB,EAE9C,OAAO,EAAO,CAAC,GAAG,EAAS,GAAG,EAAM,MAAM,EAAG,CAAkB,CAAC,EAAI,CACtE"}
@@ -1,2 +1,2 @@
1
- const e=require("../string/similarity.cjs");var t=e=>e.normalize(`NFKD`).replace(/\p{M}/gu,``),n=(e,t)=>{let n=t(e);return typeof n==`string`?[n]:n},r=(e,n)=>{let r=e.trim().toLowerCase();return n?t(r):r},i=(r,i,a,o)=>n(r,o).reduce((n,r)=>{let o=a?t(r.toLowerCase()):r.toLowerCase();return Math.max(n,e.similarity(o,i))},0),a=e=>e;function o(e,t,n={}){let{normalize:o=!1,threshold:s=.25}=n,c=`select`in n?n.select:a,l=r(t,o);return l?e.filter(e=>i(e,l,o,c)>=s):[...e]}function s(e,t,n={}){let{normalize:o=!1,threshold:s=.25}=n,c=`select`in n?n.select:a,l=r(t,o);return l?e.map(e=>({item:e,score:i(e,l,o,c)})).filter(e=>e.score>=s).sort((e,t)=>t.score-e.score):e.map(e=>({item:e,score:1}))}exports.fuzzyFilter=o,exports.fuzzyScore=s;
1
+ const e=require("../string/similarity.cjs");var normalizeText=e=>e.normalize(`NFKD`).replace(/\p{M}/gu,``),termsFor=(e,t)=>{let n=t(e);return typeof n==`string`?[n]:n},prepareQuery=(e,t)=>{let n=e.trim().toLowerCase();return t?normalizeText(n):n},score=(t,n,r,i)=>termsFor(t,i).reduce((t,i)=>{let a=r?normalizeText(i.toLowerCase()):i.toLowerCase();return Math.max(t,e.similarity(a,n))},0),stringSelection=e=>e;function fuzzyFilter(e,t,n={}){let{normalize:r=!1,threshold:i=.25}=n,a=`select`in n?n.select:stringSelection,o=prepareQuery(t,r);return o?e.filter(e=>score(e,o,r,a)>=i):[...e]}function fuzzyScore(e,t,n={}){let{normalize:r=!1,threshold:i=.25}=n,a=`select`in n?n.select:stringSelection,o=prepareQuery(t,r);return o?e.map(e=>({item:e,score:score(e,o,r,a)})).filter(e=>e.score>=i).sort((e,t)=>t.score-e.score):e.map(e=>({item:e,score:1}))}exports.fuzzyFilter=fuzzyFilter,exports.fuzzyScore=fuzzyScore;
2
2
  //# sourceMappingURL=search.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.cjs","names":[],"sources":["../../src/array/search.ts"],"sourcesContent":["import { similarity } from '../string/similarity';\n\nexport type ScoredResult<T> = { item: T; score: number };\n\nexport type FuzzyOptions = {\n normalize?: boolean;\n threshold?: number;\n};\n\nexport type FuzzySelection<T> = FuzzyOptions & {\n select: (item: T) => string | readonly string[];\n};\n\nconst normalizeText = (value: string): string => value.normalize('NFKD').replace(/\\p{M}/gu, '');\n\nconst termsFor = <T>(item: T, select: (item: T) => string | readonly string[]): readonly string[] => {\n const selected = select(item);\n\n return typeof selected === 'string' ? [selected] : selected;\n};\n\nconst prepareQuery = (query: string, normalize: boolean): string => {\n const trimmed = query.trim().toLowerCase();\n\n return normalize ? normalizeText(trimmed) : trimmed;\n};\n\nconst score = <T>(\n item: T,\n query: string,\n normalize: boolean,\n select: (item: T) => string | readonly string[],\n): number => {\n return termsFor(item, select).reduce((best, term) => {\n const value = normalize ? normalizeText(term.toLowerCase()) : term.toLowerCase();\n\n return Math.max(best, similarity(value, query));\n }, 0);\n};\n\nconst stringSelection = (value: string): string => value;\n\nexport function fuzzyFilter(array: readonly string[], query: string, options?: FuzzyOptions): string[];\nexport function fuzzyFilter<T>(array: readonly T[], query: string, options: FuzzySelection<T>): T[];\nexport function fuzzyFilter<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): T[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return [...array];\n\n return array.filter((item) => score(item, searchTerm, normalize, select) >= threshold);\n}\n\nexport function fuzzyScore(array: readonly string[], query: string, options?: FuzzyOptions): ScoredResult<string>[];\nexport function fuzzyScore<T>(array: readonly T[], query: string, options: FuzzySelection<T>): ScoredResult<T>[];\nexport function fuzzyScore<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): ScoredResult<T>[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return array.map((item) => ({ item, score: 1 }));\n\n return array\n .map((item) => ({ item, score: score(item, searchTerm, normalize, select) }))\n .filter((result) => result.score >= threshold)\n .sort((a, b) => b.score - a.score);\n}\n"],"mappings":"4CAaA,IAAM,EAAiB,GAA0B,EAAM,UAAU,MAAM,CAAC,CAAC,QAAQ,UAAW,EAAE,EAExF,GAAe,EAAS,IAAuE,CACnG,IAAM,EAAW,EAAO,CAAI,EAE5B,OAAO,OAAO,GAAa,SAAW,CAAC,CAAQ,EAAI,CACrD,EAEM,GAAgB,EAAe,IAA+B,CAClE,IAAM,EAAU,EAAM,KAAK,CAAC,CAAC,YAAY,EAEzC,OAAO,EAAY,EAAc,CAAO,EAAI,CAC9C,EAEM,GACJ,EACA,EACA,EACA,IAEO,EAAS,EAAM,CAAM,CAAC,CAAC,QAAQ,EAAM,IAAS,CACnD,IAAM,EAAQ,EAAY,EAAc,EAAK,YAAY,CAAC,EAAI,EAAK,YAAY,EAE/E,OAAO,KAAK,IAAI,EAAM,EAAA,WAAW,EAAO,CAAK,CAAC,CAChD,EAAG,CAAC,EAGA,EAAmB,GAA0B,EAInD,SAAgB,EACd,EACA,EACA,EAA4C,CAAC,EACxC,CACL,GAAM,CAAE,YAAY,GAAO,YAAY,KAAS,EAC1C,EAAS,WAAY,EAAU,EAAQ,OAAU,EACjD,EAAa,EAAa,EAAO,CAAS,EAIhD,OAFK,EAEE,EAAM,OAAQ,GAAS,EAAM,EAAM,EAAY,EAAW,CAAM,GAAK,CAAS,EAF7D,CAAC,GAAG,CAAK,CAGnC,CAIA,SAAgB,EACd,EACA,EACA,EAA4C,CAAC,EAC1B,CACnB,GAAM,CAAE,YAAY,GAAO,YAAY,KAAS,EAC1C,EAAS,WAAY,EAAU,EAAQ,OAAU,EACjD,EAAa,EAAa,EAAO,CAAS,EAIhD,OAFK,EAEE,EACJ,IAAK,IAAU,CAAE,OAAM,MAAO,EAAM,EAAM,EAAY,EAAW,CAAM,CAAE,EAAE,CAAC,CAC5E,OAAQ,GAAW,EAAO,OAAS,CAAS,CAAC,CAC7C,MAAM,EAAG,IAAM,EAAE,MAAQ,EAAE,KAAK,EALX,EAAM,IAAK,IAAU,CAAE,OAAM,MAAO,CAAE,EAAE,CAMlE"}
1
+ {"version":3,"file":"search.cjs","names":[],"sources":["../../src/array/search.ts"],"sourcesContent":["import { similarity } from '../string/similarity';\n\nexport type ScoredResult<T> = { item: T; score: number };\n\nexport type FuzzyOptions = {\n normalize?: boolean;\n threshold?: number;\n};\n\nexport type FuzzySelection<T> = FuzzyOptions & {\n select: (item: T) => string | readonly string[];\n};\n\nconst normalizeText = (value: string): string => value.normalize('NFKD').replace(/\\p{M}/gu, '');\n\nconst termsFor = <T>(item: T, select: (item: T) => string | readonly string[]): readonly string[] => {\n const selected = select(item);\n\n return typeof selected === 'string' ? [selected] : selected;\n};\n\nconst prepareQuery = (query: string, normalize: boolean): string => {\n const trimmed = query.trim().toLowerCase();\n\n return normalize ? normalizeText(trimmed) : trimmed;\n};\n\nconst score = <T>(\n item: T,\n query: string,\n normalize: boolean,\n select: (item: T) => string | readonly string[],\n): number => {\n return termsFor(item, select).reduce((best, term) => {\n const value = normalize ? normalizeText(term.toLowerCase()) : term.toLowerCase();\n\n return Math.max(best, similarity(value, query));\n }, 0);\n};\n\nconst stringSelection = (value: string): string => value;\n\nexport function fuzzyFilter(array: readonly string[], query: string, options?: FuzzyOptions): string[];\nexport function fuzzyFilter<T>(array: readonly T[], query: string, options: FuzzySelection<T>): T[];\nexport function fuzzyFilter<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): T[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return [...array];\n\n return array.filter((item) => score(item, searchTerm, normalize, select) >= threshold);\n}\n\nexport function fuzzyScore(array: readonly string[], query: string, options?: FuzzyOptions): ScoredResult<string>[];\nexport function fuzzyScore<T>(array: readonly T[], query: string, options: FuzzySelection<T>): ScoredResult<T>[];\nexport function fuzzyScore<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): ScoredResult<T>[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return array.map((item) => ({ item, score: 1 }));\n\n return array\n .map((item) => ({ item, score: score(item, searchTerm, normalize, select) }))\n .filter((result) => result.score >= threshold)\n .sort((a, b) => b.score - a.score);\n}\n"],"mappings":"4CAaA,IAAM,cAAiB,GAA0B,EAAM,UAAU,MAAM,CAAC,CAAC,QAAQ,UAAW,EAAE,EAExF,UAAe,EAAS,IAAuE,CACnG,IAAM,EAAW,EAAO,CAAI,EAE5B,OAAO,OAAO,GAAa,SAAW,CAAC,CAAQ,EAAI,CACrD,EAEM,cAAgB,EAAe,IAA+B,CAClE,IAAM,EAAU,EAAM,KAAK,CAAC,CAAC,YAAY,EAEzC,OAAO,EAAY,cAAc,CAAO,EAAI,CAC9C,EAEM,OACJ,EACA,EACA,EACA,IAEO,SAAS,EAAM,CAAM,CAAC,CAAC,QAAQ,EAAM,IAAS,CACnD,IAAM,EAAQ,EAAY,cAAc,EAAK,YAAY,CAAC,EAAI,EAAK,YAAY,EAE/E,OAAO,KAAK,IAAI,EAAM,EAAA,WAAW,EAAO,CAAK,CAAC,CAChD,EAAG,CAAC,EAGA,gBAAmB,GAA0B,EAInD,SAAgB,YACd,EACA,EACA,EAA4C,CAAC,EACxC,CACL,GAAM,CAAE,YAAY,GAAO,YAAY,KAAS,EAC1C,EAAS,WAAY,EAAU,EAAQ,OAAU,gBACjD,EAAa,aAAa,EAAO,CAAS,EAIhD,OAFK,EAEE,EAAM,OAAQ,GAAS,MAAM,EAAM,EAAY,EAAW,CAAM,GAAK,CAAS,EAF7D,CAAC,GAAG,CAAK,CAGnC,CAIA,SAAgB,WACd,EACA,EACA,EAA4C,CAAC,EAC1B,CACnB,GAAM,CAAE,YAAY,GAAO,YAAY,KAAS,EAC1C,EAAS,WAAY,EAAU,EAAQ,OAAU,gBACjD,EAAa,aAAa,EAAO,CAAS,EAIhD,OAFK,EAEE,EACJ,IAAK,IAAU,CAAE,OAAM,MAAO,MAAM,EAAM,EAAY,EAAW,CAAM,CAAE,EAAE,CAAC,CAC5E,OAAQ,GAAW,EAAO,OAAS,CAAS,CAAC,CAC7C,MAAM,EAAG,IAAM,EAAE,MAAQ,EAAE,KAAK,EALX,EAAM,IAAK,IAAU,CAAE,OAAM,MAAO,CAAE,EAAE,CAMlE"}
@@ -1,30 +1,2 @@
1
- import { similarity as e } from "../string/similarity.js";
2
- //#region src/array/search.ts
3
- var t = (e) => e.normalize("NFKD").replace(/\p{M}/gu, ""), n = (e, t) => {
4
- let n = t(e);
5
- return typeof n == "string" ? [n] : n;
6
- }, r = (e, n) => {
7
- let r = e.trim().toLowerCase();
8
- return n ? t(r) : r;
9
- }, i = (r, i, a, o) => n(r, o).reduce((n, r) => {
10
- let o = a ? t(r.toLowerCase()) : r.toLowerCase();
11
- return Math.max(n, e(o, i));
12
- }, 0), a = (e) => e;
13
- function o(e, t, n = {}) {
14
- let { normalize: o = !1, threshold: s = .25 } = n, c = "select" in n ? n.select : a, l = r(t, o);
15
- return l ? e.filter((e) => i(e, l, o, c) >= s) : [...e];
16
- }
17
- function s(e, t, n = {}) {
18
- let { normalize: o = !1, threshold: s = .25 } = n, c = "select" in n ? n.select : a, l = r(t, o);
19
- return l ? e.map((e) => ({
20
- item: e,
21
- score: i(e, l, o, c)
22
- })).filter((e) => e.score >= s).sort((e, t) => t.score - e.score) : e.map((e) => ({
23
- item: e,
24
- score: 1
25
- }));
26
- }
27
- //#endregion
28
- export { o as fuzzyFilter, s as fuzzyScore };
29
-
1
+ import{similarity as e}from"../string/similarity.js";var normalizeText=e=>e.normalize(`NFKD`).replace(/\p{M}/gu,``),termsFor=(e,t)=>{let n=t(e);return typeof n==`string`?[n]:n},prepareQuery=(e,t)=>{let n=e.trim().toLowerCase();return t?normalizeText(n):n},score=(t,n,r,i)=>termsFor(t,i).reduce((t,i)=>{let a=r?normalizeText(i.toLowerCase()):i.toLowerCase();return Math.max(t,e(a,n))},0),stringSelection=e=>e;function fuzzyFilter(e,t,n={}){let{normalize:r=!1,threshold:i=.25}=n,a=`select`in n?n.select:stringSelection,o=prepareQuery(t,r);return o?e.filter(e=>score(e,o,r,a)>=i):[...e]}function fuzzyScore(e,t,n={}){let{normalize:r=!1,threshold:i=.25}=n,a=`select`in n?n.select:stringSelection,o=prepareQuery(t,r);return o?e.map(e=>({item:e,score:score(e,o,r,a)})).filter(e=>e.score>=i).sort((e,t)=>t.score-e.score):e.map(e=>({item:e,score:1}))}export{fuzzyFilter,fuzzyScore};
30
2
  //# sourceMappingURL=search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","names":[],"sources":["../../src/array/search.ts"],"sourcesContent":["import { similarity } from '../string/similarity';\n\nexport type ScoredResult<T> = { item: T; score: number };\n\nexport type FuzzyOptions = {\n normalize?: boolean;\n threshold?: number;\n};\n\nexport type FuzzySelection<T> = FuzzyOptions & {\n select: (item: T) => string | readonly string[];\n};\n\nconst normalizeText = (value: string): string => value.normalize('NFKD').replace(/\\p{M}/gu, '');\n\nconst termsFor = <T>(item: T, select: (item: T) => string | readonly string[]): readonly string[] => {\n const selected = select(item);\n\n return typeof selected === 'string' ? [selected] : selected;\n};\n\nconst prepareQuery = (query: string, normalize: boolean): string => {\n const trimmed = query.trim().toLowerCase();\n\n return normalize ? normalizeText(trimmed) : trimmed;\n};\n\nconst score = <T>(\n item: T,\n query: string,\n normalize: boolean,\n select: (item: T) => string | readonly string[],\n): number => {\n return termsFor(item, select).reduce((best, term) => {\n const value = normalize ? normalizeText(term.toLowerCase()) : term.toLowerCase();\n\n return Math.max(best, similarity(value, query));\n }, 0);\n};\n\nconst stringSelection = (value: string): string => value;\n\nexport function fuzzyFilter(array: readonly string[], query: string, options?: FuzzyOptions): string[];\nexport function fuzzyFilter<T>(array: readonly T[], query: string, options: FuzzySelection<T>): T[];\nexport function fuzzyFilter<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): T[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return [...array];\n\n return array.filter((item) => score(item, searchTerm, normalize, select) >= threshold);\n}\n\nexport function fuzzyScore(array: readonly string[], query: string, options?: FuzzyOptions): ScoredResult<string>[];\nexport function fuzzyScore<T>(array: readonly T[], query: string, options: FuzzySelection<T>): ScoredResult<T>[];\nexport function fuzzyScore<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): ScoredResult<T>[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return array.map((item) => ({ item, score: 1 }));\n\n return array\n .map((item) => ({ item, score: score(item, searchTerm, normalize, select) }))\n .filter((result) => result.score >= threshold)\n .sort((a, b) => b.score - a.score);\n}\n"],"mappings":";;AAaA,IAAM,KAAiB,MAA0B,EAAM,UAAU,MAAM,CAAC,CAAC,QAAQ,WAAW,EAAE,GAExF,KAAe,GAAS,MAAuE;CACnG,IAAM,IAAW,EAAO,CAAI;CAE5B,OAAO,OAAO,KAAa,WAAW,CAAC,CAAQ,IAAI;AACrD,GAEM,KAAgB,GAAe,MAA+B;CAClE,IAAM,IAAU,EAAM,KAAK,CAAC,CAAC,YAAY;CAEzC,OAAO,IAAY,EAAc,CAAO,IAAI;AAC9C,GAEM,KACJ,GACA,GACA,GACA,MAEO,EAAS,GAAM,CAAM,CAAC,CAAC,QAAQ,GAAM,MAAS;CACnD,IAAM,IAAQ,IAAY,EAAc,EAAK,YAAY,CAAC,IAAI,EAAK,YAAY;CAE/E,OAAO,KAAK,IAAI,GAAM,EAAW,GAAO,CAAK,CAAC;AAChD,GAAG,CAAC,GAGA,KAAmB,MAA0B;AAInD,SAAgB,EACd,GACA,GACA,IAA4C,CAAC,GACxC;CACL,IAAM,EAAE,eAAY,IAAO,eAAY,QAAS,GAC1C,IAAS,YAAY,IAAU,EAAQ,SAAU,GACjD,IAAa,EAAa,GAAO,CAAS;CAIhD,OAFK,IAEE,EAAM,QAAQ,MAAS,EAAM,GAAM,GAAY,GAAW,CAAM,KAAK,CAAS,IAF7D,CAAC,GAAG,CAAK;AAGnC;AAIA,SAAgB,EACd,GACA,GACA,IAA4C,CAAC,GAC1B;CACnB,IAAM,EAAE,eAAY,IAAO,eAAY,QAAS,GAC1C,IAAS,YAAY,IAAU,EAAQ,SAAU,GACjD,IAAa,EAAa,GAAO,CAAS;CAIhD,OAFK,IAEE,EACJ,KAAK,OAAU;EAAE;EAAM,OAAO,EAAM,GAAM,GAAY,GAAW,CAAM;CAAE,EAAE,CAAC,CAC5E,QAAQ,MAAW,EAAO,SAAS,CAAS,CAAC,CAC7C,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,IALX,EAAM,KAAK,OAAU;EAAE;EAAM,OAAO;CAAE,EAAE;AAMlE"}
1
+ {"version":3,"file":"search.js","names":[],"sources":["../../src/array/search.ts"],"sourcesContent":["import { similarity } from '../string/similarity';\n\nexport type ScoredResult<T> = { item: T; score: number };\n\nexport type FuzzyOptions = {\n normalize?: boolean;\n threshold?: number;\n};\n\nexport type FuzzySelection<T> = FuzzyOptions & {\n select: (item: T) => string | readonly string[];\n};\n\nconst normalizeText = (value: string): string => value.normalize('NFKD').replace(/\\p{M}/gu, '');\n\nconst termsFor = <T>(item: T, select: (item: T) => string | readonly string[]): readonly string[] => {\n const selected = select(item);\n\n return typeof selected === 'string' ? [selected] : selected;\n};\n\nconst prepareQuery = (query: string, normalize: boolean): string => {\n const trimmed = query.trim().toLowerCase();\n\n return normalize ? normalizeText(trimmed) : trimmed;\n};\n\nconst score = <T>(\n item: T,\n query: string,\n normalize: boolean,\n select: (item: T) => string | readonly string[],\n): number => {\n return termsFor(item, select).reduce((best, term) => {\n const value = normalize ? normalizeText(term.toLowerCase()) : term.toLowerCase();\n\n return Math.max(best, similarity(value, query));\n }, 0);\n};\n\nconst stringSelection = (value: string): string => value;\n\nexport function fuzzyFilter(array: readonly string[], query: string, options?: FuzzyOptions): string[];\nexport function fuzzyFilter<T>(array: readonly T[], query: string, options: FuzzySelection<T>): T[];\nexport function fuzzyFilter<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): T[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return [...array];\n\n return array.filter((item) => score(item, searchTerm, normalize, select) >= threshold);\n}\n\nexport function fuzzyScore(array: readonly string[], query: string, options?: FuzzyOptions): ScoredResult<string>[];\nexport function fuzzyScore<T>(array: readonly T[], query: string, options: FuzzySelection<T>): ScoredResult<T>[];\nexport function fuzzyScore<T>(\n array: readonly T[],\n query: string,\n options: FuzzyOptions | FuzzySelection<T> = {},\n): ScoredResult<T>[] {\n const { normalize = false, threshold = 0.25 } = options;\n const select = 'select' in options ? options.select : (stringSelection as (item: T) => string);\n const searchTerm = prepareQuery(query, normalize);\n\n if (!searchTerm) return array.map((item) => ({ item, score: 1 }));\n\n return array\n .map((item) => ({ item, score: score(item, searchTerm, normalize, select) }))\n .filter((result) => result.score >= threshold)\n .sort((a, b) => b.score - a.score);\n}\n"],"mappings":"qDAaA,IAAM,cAAiB,GAA0B,EAAM,UAAU,MAAM,CAAC,CAAC,QAAQ,UAAW,EAAE,EAExF,UAAe,EAAS,IAAuE,CACnG,IAAM,EAAW,EAAO,CAAI,EAE5B,OAAO,OAAO,GAAa,SAAW,CAAC,CAAQ,EAAI,CACrD,EAEM,cAAgB,EAAe,IAA+B,CAClE,IAAM,EAAU,EAAM,KAAK,CAAC,CAAC,YAAY,EAEzC,OAAO,EAAY,cAAc,CAAO,EAAI,CAC9C,EAEM,OACJ,EACA,EACA,EACA,IAEO,SAAS,EAAM,CAAM,CAAC,CAAC,QAAQ,EAAM,IAAS,CACnD,IAAM,EAAQ,EAAY,cAAc,EAAK,YAAY,CAAC,EAAI,EAAK,YAAY,EAE/E,OAAO,KAAK,IAAI,EAAM,EAAW,EAAO,CAAK,CAAC,CAChD,EAAG,CAAC,EAGA,gBAAmB,GAA0B,EAInD,SAAgB,YACd,EACA,EACA,EAA4C,CAAC,EACxC,CACL,GAAM,CAAE,YAAY,GAAO,YAAY,KAAS,EAC1C,EAAS,WAAY,EAAU,EAAQ,OAAU,gBACjD,EAAa,aAAa,EAAO,CAAS,EAIhD,OAFK,EAEE,EAAM,OAAQ,GAAS,MAAM,EAAM,EAAY,EAAW,CAAM,GAAK,CAAS,EAF7D,CAAC,GAAG,CAAK,CAGnC,CAIA,SAAgB,WACd,EACA,EACA,EAA4C,CAAC,EAC1B,CACnB,GAAM,CAAE,YAAY,GAAO,YAAY,KAAS,EAC1C,EAAS,WAAY,EAAU,EAAQ,OAAU,gBACjD,EAAa,aAAa,EAAO,CAAS,EAIhD,OAFK,EAEE,EACJ,IAAK,IAAU,CAAE,OAAM,MAAO,MAAM,EAAM,EAAY,EAAW,CAAM,CAAE,EAAE,CAAC,CAC5E,OAAQ,GAAW,EAAO,OAAS,CAAS,CAAC,CAC7C,MAAM,EAAG,IAAM,EAAE,MAAQ,EAAE,KAAK,EALX,EAAM,IAAK,IAAU,CAAE,OAAM,MAAO,CAAE,EAAE,CAMlE"}
@@ -1,2 +1,2 @@
1
- const e=require("./compare.cjs"),t=require("./compareBy.cjs");function n(n,r,i=`asc`){if(!Array.isArray(n))throw TypeError(`sort: first argument must be an array`);if(typeof r==`function`){let t=i===`desc`?-1:1;return[...n].sort((n,i)=>e.compare(r(n),r(i))*t)}return[...n].sort(t.compareBy(r))}exports.sort=n;
1
+ const e=require("./compare.cjs"),t=require("./compareBy.cjs");function sort(n,r,i=`asc`){if(!Array.isArray(n))throw TypeError(`sort: first argument must be an array`);if(typeof r==`function`){let t=i===`desc`?-1:1;return[...n].sort((n,i)=>e.compare(r(n),r(i))*t)}return[...n].sort(t.compareBy(r))}exports.sort=sort;
2
2
  //# sourceMappingURL=sort.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort.cjs","names":[],"sources":["../../src/array/sort.ts"],"sourcesContent":["import { compare } from './compare';\nimport { compareBy } from './compareBy';\n\nexport type SortDirection = 'asc' | 'desc';\nexport type SortSelectors<T> = Partial<Record<keyof T, SortDirection>>;\n\n/**\n * Sorts an array by a selector function (single-field) or by a multi-field\n * object of `{ key: 'asc' | 'desc' }` entries.\n *\n * @example\n * ```ts\n * // Single field\n * sort([{ a: 2 }, { a: 1 }], item => item.a); // [{ a:1 }, { a:2 }]\n * sort([{ a: 2 }, { a: 1 }], item => item.a, 'desc'); // [{ a:2 }, { a:1 }]\n *\n * // Multi-field\n * sort(users, { name: 'asc', age: 'desc' });\n * ```\n *\n * @param array - The array to sort.\n * @param selector - A function extracting the sort key, or a multi-field object.\n * @param direction - `'asc'` (default) or `'desc'` — only applies to single-field mode.\n * @returns A new sorted array.\n *\n * @throws {TypeError} If the first argument is not an array.\n */\nexport function sort<T>(array: readonly T[], selector: (item: T) => unknown, direction?: SortDirection): T[];\nexport function sort<T>(array: readonly T[], selectors: SortSelectors<T>): T[];\nexport function sort<T>(\n array: readonly T[],\n selectorOrSelectors: ((item: T) => unknown) | SortSelectors<T>,\n direction: SortDirection = 'asc',\n): T[] {\n if (!Array.isArray(array)) throw new TypeError('sort: first argument must be an array');\n\n if (typeof selectorOrSelectors === 'function') {\n const multiplier = direction === 'desc' ? -1 : 1;\n\n return [...array].sort((a, b) => compare(selectorOrSelectors(a), selectorOrSelectors(b)) * multiplier);\n }\n\n return [...array].sort(compareBy(selectorOrSelectors));\n}\n"],"mappings":"8DA6BA,SAAgB,EACd,EACA,EACA,EAA2B,MACtB,CACL,GAAI,CAAC,MAAM,QAAQ,CAAK,EAAG,MAAU,UAAU,uCAAuC,EAEtF,GAAI,OAAO,GAAwB,WAAY,CAC7C,IAAM,EAAa,IAAc,OAAS,GAAK,EAE/C,MAAO,CAAC,GAAG,CAAK,CAAC,CAAC,MAAM,EAAG,IAAM,EAAA,QAAQ,EAAoB,CAAC,EAAG,EAAoB,CAAC,CAAC,EAAI,CAAU,CACvG,CAEA,MAAO,CAAC,GAAG,CAAK,CAAC,CAAC,KAAK,EAAA,UAAU,CAAmB,CAAC,CACvD"}
1
+ {"version":3,"file":"sort.cjs","names":[],"sources":["../../src/array/sort.ts"],"sourcesContent":["import { compare } from './compare';\nimport { compareBy } from './compareBy';\n\nexport type SortDirection = 'asc' | 'desc';\nexport type SortSelectors<T> = Partial<Record<keyof T, SortDirection>>;\n\n/**\n * Sorts an array by a selector function (single-field) or by a multi-field\n * object of `{ key: 'asc' | 'desc' }` entries.\n *\n * @example\n * ```ts\n * // Single field\n * sort([{ a: 2 }, { a: 1 }], item => item.a); // [{ a:1 }, { a:2 }]\n * sort([{ a: 2 }, { a: 1 }], item => item.a, 'desc'); // [{ a:2 }, { a:1 }]\n *\n * // Multi-field\n * sort(users, { name: 'asc', age: 'desc' });\n * ```\n *\n * @param array - The array to sort.\n * @param selector - A function extracting the sort key, or a multi-field object.\n * @param direction - `'asc'` (default) or `'desc'`: only applies to single-field mode.\n * @returns A new sorted array.\n *\n * @throws {TypeError} If the first argument is not an array.\n */\nexport function sort<T>(array: readonly T[], selector: (item: T) => unknown, direction?: SortDirection): T[];\nexport function sort<T>(array: readonly T[], selectors: SortSelectors<T>): T[];\nexport function sort<T>(\n array: readonly T[],\n selectorOrSelectors: ((item: T) => unknown) | SortSelectors<T>,\n direction: SortDirection = 'asc',\n): T[] {\n if (!Array.isArray(array)) throw new TypeError('sort: first argument must be an array');\n\n if (typeof selectorOrSelectors === 'function') {\n const multiplier = direction === 'desc' ? -1 : 1;\n\n return [...array].sort((a, b) => compare(selectorOrSelectors(a), selectorOrSelectors(b)) * multiplier);\n }\n\n return [...array].sort(compareBy(selectorOrSelectors));\n}\n"],"mappings":"8DA6BA,SAAgB,KACd,EACA,EACA,EAA2B,MACtB,CACL,GAAI,CAAC,MAAM,QAAQ,CAAK,EAAG,MAAU,UAAU,uCAAuC,EAEtF,GAAI,OAAO,GAAwB,WAAY,CAC7C,IAAM,EAAa,IAAc,OAAS,GAAK,EAE/C,MAAO,CAAC,GAAG,CAAK,CAAC,CAAC,MAAM,EAAG,IAAM,EAAA,QAAQ,EAAoB,CAAC,EAAG,EAAoB,CAAC,CAAC,EAAI,CAAU,CACvG,CAEA,MAAO,CAAC,GAAG,CAAK,CAAC,CAAC,KAAK,EAAA,UAAU,CAAmB,CAAC,CACvD"}
@@ -16,7 +16,7 @@ export type SortSelectors<T> = Partial<Record<keyof T, SortDirection>>;
16
16
  *
17
17
  * @param array - The array to sort.
18
18
  * @param selector - A function extracting the sort key, or a multi-field object.
19
- * @param direction - `'asc'` (default) or `'desc'` — only applies to single-field mode.
19
+ * @param direction - `'asc'` (default) or `'desc'`: only applies to single-field mode.
20
20
  * @returns A new sorted array.
21
21
  *
22
22
  * @throws {TypeError} If the first argument is not an array.
@@ -1,15 +1,2 @@
1
- import { compare as e } from "./compare.js";
2
- import { compareBy as t } from "./compareBy.js";
3
- //#region src/array/sort.ts
4
- function n(n, r, i = "asc") {
5
- if (!Array.isArray(n)) throw TypeError("sort: first argument must be an array");
6
- if (typeof r == "function") {
7
- let t = i === "desc" ? -1 : 1;
8
- return [...n].sort((n, i) => e(r(n), r(i)) * t);
9
- }
10
- return [...n].sort(t(r));
11
- }
12
- //#endregion
13
- export { n as sort };
14
-
1
+ import{compare as e}from"./compare.js";import{compareBy as t}from"./compareBy.js";function sort(n,r,i=`asc`){if(!Array.isArray(n))throw TypeError(`sort: first argument must be an array`);if(typeof r==`function`){let t=i===`desc`?-1:1;return[...n].sort((n,i)=>e(r(n),r(i))*t)}return[...n].sort(t(r))}export{sort};
15
2
  //# sourceMappingURL=sort.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort.js","names":[],"sources":["../../src/array/sort.ts"],"sourcesContent":["import { compare } from './compare';\nimport { compareBy } from './compareBy';\n\nexport type SortDirection = 'asc' | 'desc';\nexport type SortSelectors<T> = Partial<Record<keyof T, SortDirection>>;\n\n/**\n * Sorts an array by a selector function (single-field) or by a multi-field\n * object of `{ key: 'asc' | 'desc' }` entries.\n *\n * @example\n * ```ts\n * // Single field\n * sort([{ a: 2 }, { a: 1 }], item => item.a); // [{ a:1 }, { a:2 }]\n * sort([{ a: 2 }, { a: 1 }], item => item.a, 'desc'); // [{ a:2 }, { a:1 }]\n *\n * // Multi-field\n * sort(users, { name: 'asc', age: 'desc' });\n * ```\n *\n * @param array - The array to sort.\n * @param selector - A function extracting the sort key, or a multi-field object.\n * @param direction - `'asc'` (default) or `'desc'` — only applies to single-field mode.\n * @returns A new sorted array.\n *\n * @throws {TypeError} If the first argument is not an array.\n */\nexport function sort<T>(array: readonly T[], selector: (item: T) => unknown, direction?: SortDirection): T[];\nexport function sort<T>(array: readonly T[], selectors: SortSelectors<T>): T[];\nexport function sort<T>(\n array: readonly T[],\n selectorOrSelectors: ((item: T) => unknown) | SortSelectors<T>,\n direction: SortDirection = 'asc',\n): T[] {\n if (!Array.isArray(array)) throw new TypeError('sort: first argument must be an array');\n\n if (typeof selectorOrSelectors === 'function') {\n const multiplier = direction === 'desc' ? -1 : 1;\n\n return [...array].sort((a, b) => compare(selectorOrSelectors(a), selectorOrSelectors(b)) * multiplier);\n }\n\n return [...array].sort(compareBy(selectorOrSelectors));\n}\n"],"mappings":";;;AA6BA,SAAgB,EACd,GACA,GACA,IAA2B,OACtB;CACL,IAAI,CAAC,MAAM,QAAQ,CAAK,GAAG,MAAU,UAAU,uCAAuC;CAEtF,IAAI,OAAO,KAAwB,YAAY;EAC7C,IAAM,IAAa,MAAc,SAAS,KAAK;EAE/C,OAAO,CAAC,GAAG,CAAK,CAAC,CAAC,MAAM,GAAG,MAAM,EAAQ,EAAoB,CAAC,GAAG,EAAoB,CAAC,CAAC,IAAI,CAAU;CACvG;CAEA,OAAO,CAAC,GAAG,CAAK,CAAC,CAAC,KAAK,EAAU,CAAmB,CAAC;AACvD"}
1
+ {"version":3,"file":"sort.js","names":[],"sources":["../../src/array/sort.ts"],"sourcesContent":["import { compare } from './compare';\nimport { compareBy } from './compareBy';\n\nexport type SortDirection = 'asc' | 'desc';\nexport type SortSelectors<T> = Partial<Record<keyof T, SortDirection>>;\n\n/**\n * Sorts an array by a selector function (single-field) or by a multi-field\n * object of `{ key: 'asc' | 'desc' }` entries.\n *\n * @example\n * ```ts\n * // Single field\n * sort([{ a: 2 }, { a: 1 }], item => item.a); // [{ a:1 }, { a:2 }]\n * sort([{ a: 2 }, { a: 1 }], item => item.a, 'desc'); // [{ a:2 }, { a:1 }]\n *\n * // Multi-field\n * sort(users, { name: 'asc', age: 'desc' });\n * ```\n *\n * @param array - The array to sort.\n * @param selector - A function extracting the sort key, or a multi-field object.\n * @param direction - `'asc'` (default) or `'desc'`: only applies to single-field mode.\n * @returns A new sorted array.\n *\n * @throws {TypeError} If the first argument is not an array.\n */\nexport function sort<T>(array: readonly T[], selector: (item: T) => unknown, direction?: SortDirection): T[];\nexport function sort<T>(array: readonly T[], selectors: SortSelectors<T>): T[];\nexport function sort<T>(\n array: readonly T[],\n selectorOrSelectors: ((item: T) => unknown) | SortSelectors<T>,\n direction: SortDirection = 'asc',\n): T[] {\n if (!Array.isArray(array)) throw new TypeError('sort: first argument must be an array');\n\n if (typeof selectorOrSelectors === 'function') {\n const multiplier = direction === 'desc' ? -1 : 1;\n\n return [...array].sort((a, b) => compare(selectorOrSelectors(a), selectorOrSelectors(b)) * multiplier);\n }\n\n return [...array].sort(compareBy(selectorOrSelectors));\n}\n"],"mappings":"kFA6BA,SAAgB,KACd,EACA,EACA,EAA2B,MACtB,CACL,GAAI,CAAC,MAAM,QAAQ,CAAK,EAAG,MAAU,UAAU,uCAAuC,EAEtF,GAAI,OAAO,GAAwB,WAAY,CAC7C,IAAM,EAAa,IAAc,OAAS,GAAK,EAE/C,MAAO,CAAC,GAAG,CAAK,CAAC,CAAC,MAAM,EAAG,IAAM,EAAQ,EAAoB,CAAC,EAAG,EAAoB,CAAC,CAAC,EAAI,CAAU,CACvG,CAEA,MAAO,CAAC,GAAG,CAAK,CAAC,CAAC,KAAK,EAAU,CAAmB,CAAC,CACvD"}
@@ -1,2 +1,2 @@
1
- function e(e,t=1){let n=Math.max(0,Math.floor(t));return e.slice(0,n)}exports.take=e;
1
+ function take(e,t=1){let n=Math.max(0,Math.floor(t));return e.slice(0,n)}exports.take=take;
2
2
  //# sourceMappingURL=take.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"take.cjs","names":[],"sources":["../../src/array/take.ts"],"sourcesContent":["/**\n * Takes the first n elements from an array.\n */\nexport function take<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(0, count);\n}\n"],"mappings":"AAGA,SAAgB,EAAQ,EAAqB,EAAI,EAAQ,CACvD,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAEvC,OAAO,EAAM,MAAM,EAAG,CAAK,CAC7B"}
1
+ {"version":3,"file":"take.cjs","names":[],"sources":["../../src/array/take.ts"],"sourcesContent":["/**\n * Takes the first n elements from an array.\n */\nexport function take<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(0, count);\n}\n"],"mappings":"AAGA,SAAgB,KAAQ,EAAqB,EAAI,EAAQ,CACvD,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAEvC,OAAO,EAAM,MAAM,EAAG,CAAK,CAC7B"}
@@ -1,9 +1,2 @@
1
- //#region src/array/take.ts
2
- function e(e, t = 1) {
3
- let n = Math.max(0, Math.floor(t));
4
- return e.slice(0, n);
5
- }
6
- //#endregion
7
- export { e as take };
8
-
1
+ function take(e,t=1){let n=Math.max(0,Math.floor(t));return e.slice(0,n)}export{take};
9
2
  //# sourceMappingURL=take.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"take.js","names":[],"sources":["../../src/array/take.ts"],"sourcesContent":["/**\n * Takes the first n elements from an array.\n */\nexport function take<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(0, count);\n}\n"],"mappings":";AAGA,SAAgB,EAAQ,GAAqB,IAAI,GAAQ;CACvD,IAAM,IAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,CAAC,CAAC;CAEvC,OAAO,EAAM,MAAM,GAAG,CAAK;AAC7B"}
1
+ {"version":3,"file":"take.js","names":[],"sources":["../../src/array/take.ts"],"sourcesContent":["/**\n * Takes the first n elements from an array.\n */\nexport function take<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n return array.slice(0, count);\n}\n"],"mappings":"AAGA,SAAgB,KAAQ,EAAqB,EAAI,EAAQ,CACvD,IAAM,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,CAAC,CAAC,EAEvC,OAAO,EAAM,MAAM,EAAG,CAAK,CAC7B"}
@@ -1,2 +1,2 @@
1
- function e(e,t=1){let n=Math.max(0,Math.floor(t));return n===0?[]:e.slice(Math.max(0,e.length-n))}exports.takeLast=e;
1
+ function takeLast(e,t=1){let n=Math.max(0,Math.floor(t));return n===0?[]:e.slice(Math.max(0,e.length-n))}exports.takeLast=takeLast;
2
2
  //# sourceMappingURL=takeLast.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"takeLast.cjs","names":[],"sources":["../../src/array/takeLast.ts"],"sourcesContent":["/**\n * Takes the last n elements from an array.\n */\nexport function takeLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [];\n\n return array.slice(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,EAElB,EAAM,MAAM,KAAK,IAAI,EAAG,EAAM,OAAS,CAAK,CAAC,CACtD"}
1
+ {"version":3,"file":"takeLast.cjs","names":[],"sources":["../../src/array/takeLast.ts"],"sourcesContent":["/**\n * Takes the last n elements from an array.\n */\nexport function takeLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [];\n\n return array.slice(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,EAElB,EAAM,MAAM,KAAK,IAAI,EAAG,EAAM,OAAS,CAAK,CAAC,CACtD"}
@@ -1,9 +1,2 @@
1
- //#region src/array/takeLast.ts
2
- function e(e, t = 1) {
3
- let n = Math.max(0, Math.floor(t));
4
- return n === 0 ? [] : e.slice(Math.max(0, e.length - n));
5
- }
6
- //#endregion
7
- export { e as takeLast };
8
-
1
+ function takeLast(e,t=1){let n=Math.max(0,Math.floor(t));return n===0?[]:e.slice(Math.max(0,e.length-n))}export{takeLast};
9
2
  //# sourceMappingURL=takeLast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"takeLast.js","names":[],"sources":["../../src/array/takeLast.ts"],"sourcesContent":["/**\n * Takes the last n elements from an array.\n */\nexport function takeLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [];\n\n return array.slice(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,IAElB,EAAM,MAAM,KAAK,IAAI,GAAG,EAAM,SAAS,CAAK,CAAC;AACtD"}
1
+ {"version":3,"file":"takeLast.js","names":[],"sources":["../../src/array/takeLast.ts"],"sourcesContent":["/**\n * Takes the last n elements from an array.\n */\nexport function takeLast<T>(array: readonly T[], n = 1): T[] {\n const count = Math.max(0, Math.floor(n));\n\n if (count === 0) return [];\n\n return array.slice(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,EAElB,EAAM,MAAM,KAAK,IAAI,EAAG,EAAM,OAAS,CAAK,CAAC,CACtD"}
@@ -1,2 +1,2 @@
1
- function e(e,t,n,r={}){let{strategy:i=`append`}=r,a=n?e=>n(e)===n(t):e=>e===t,o=e.findIndex(a);return o===-1?i===`prepend`?[t,...e]:[...e,t]:[...e.slice(0,o),...e.slice(o+1)]}exports.toggle=e;
1
+ function toggle(e,t,n,r={}){let{strategy:i=`append`}=r,a=n?e=>n(e)===n(t):e=>e===t,o=e.findIndex(a);return o===-1?i===`prepend`?[t,...e]:[...e,t]:[...e.slice(0,o),...e.slice(o+1)]}exports.toggle=toggle;
2
2
  //# sourceMappingURL=toggle.cjs.map