@vielzeug/arsenal 3.0.0 → 26.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/dist/_common/_lruMap.cjs +1 -1
  2. package/dist/_common/_lruMap.cjs.map +1 -1
  3. package/dist/_common/_lruMap.js +1 -17
  4. package/dist/_common/_lruMap.js.map +1 -1
  5. package/dist/_common/_selectorSet.cjs +1 -1
  6. package/dist/_common/_selectorSet.cjs.map +1 -1
  7. package/dist/_common/_selectorSet.js +1 -15
  8. package/dist/_common/_selectorSet.js.map +1 -1
  9. package/dist/_common/unsafePaths.cjs +1 -1
  10. package/dist/_common/unsafePaths.cjs.map +1 -1
  11. package/dist/_common/unsafePaths.js +1 -12
  12. package/dist/_common/unsafePaths.js.map +1 -1
  13. package/dist/_dev.cjs +1 -1
  14. package/dist/_dev.cjs.map +1 -1
  15. package/dist/_dev.js +1 -5
  16. package/dist/_dev.js.map +1 -1
  17. package/dist/array/chunk.cjs +1 -1
  18. package/dist/array/chunk.cjs.map +1 -1
  19. package/dist/array/chunk.js +1 -9
  20. package/dist/array/chunk.js.map +1 -1
  21. package/dist/array/compact.cjs +1 -1
  22. package/dist/array/compact.cjs.map +1 -1
  23. package/dist/array/compact.js +1 -7
  24. package/dist/array/compact.js.map +1 -1
  25. package/dist/array/compare.cjs +1 -1
  26. package/dist/array/compare.cjs.map +1 -1
  27. package/dist/array/compare.js +1 -18
  28. package/dist/array/compare.js.map +1 -1
  29. package/dist/array/compareBy.cjs +1 -1
  30. package/dist/array/compareBy.cjs.map +1 -1
  31. package/dist/array/compareBy.js +1 -15
  32. package/dist/array/compareBy.js.map +1 -1
  33. package/dist/array/contains.cjs +1 -1
  34. package/dist/array/contains.cjs.map +1 -1
  35. package/dist/array/contains.js +1 -8
  36. package/dist/array/contains.js.map +1 -1
  37. package/dist/array/countBy.cjs +1 -1
  38. package/dist/array/countBy.cjs.map +1 -1
  39. package/dist/array/countBy.js +1 -13
  40. package/dist/array/countBy.js.map +1 -1
  41. package/dist/array/difference.cjs +1 -1
  42. package/dist/array/difference.cjs.map +1 -1
  43. package/dist/array/difference.js +1 -13
  44. package/dist/array/difference.js.map +1 -1
  45. package/dist/array/drop.cjs +1 -1
  46. package/dist/array/drop.cjs.map +1 -1
  47. package/dist/array/drop.js +1 -8
  48. package/dist/array/drop.js.map +1 -1
  49. package/dist/array/dropLast.cjs +1 -1
  50. package/dist/array/dropLast.cjs.map +1 -1
  51. package/dist/array/dropLast.js +1 -8
  52. package/dist/array/dropLast.js.map +1 -1
  53. package/dist/array/filterMap.cjs +1 -1
  54. package/dist/array/filterMap.cjs.map +1 -1
  55. package/dist/array/filterMap.js +1 -12
  56. package/dist/array/filterMap.js.map +1 -1
  57. package/dist/array/first.cjs +1 -1
  58. package/dist/array/first.cjs.map +1 -1
  59. package/dist/array/first.js +1 -7
  60. package/dist/array/first.js.map +1 -1
  61. package/dist/array/groupBy.cjs +1 -1
  62. package/dist/array/groupBy.cjs.map +1 -1
  63. package/dist/array/groupBy.js +1 -13
  64. package/dist/array/groupBy.js.map +1 -1
  65. package/dist/array/index.js +1 -28
  66. package/dist/array/indexBy.cjs +1 -1
  67. package/dist/array/indexBy.cjs.map +1 -1
  68. package/dist/array/indexBy.js +1 -13
  69. package/dist/array/indexBy.js.map +1 -1
  70. package/dist/array/intersection.cjs +1 -1
  71. package/dist/array/intersection.cjs.map +1 -1
  72. package/dist/array/intersection.js +1 -13
  73. package/dist/array/intersection.js.map +1 -1
  74. package/dist/array/last.cjs +1 -1
  75. package/dist/array/last.cjs.map +1 -1
  76. package/dist/array/last.js +1 -7
  77. package/dist/array/last.js.map +1 -1
  78. package/dist/array/partition.cjs +1 -1
  79. package/dist/array/partition.cjs.map +1 -1
  80. package/dist/array/partition.js +1 -9
  81. package/dist/array/partition.js.map +1 -1
  82. package/dist/array/replace.cjs +1 -1
  83. package/dist/array/replace.cjs.map +1 -1
  84. package/dist/array/replace.js +1 -12
  85. package/dist/array/replace.js.map +1 -1
  86. package/dist/array/rotate.cjs +1 -1
  87. package/dist/array/rotate.cjs.map +1 -1
  88. package/dist/array/rotate.js +1 -9
  89. package/dist/array/rotate.js.map +1 -1
  90. package/dist/array/search.cjs +1 -1
  91. package/dist/array/search.cjs.map +1 -1
  92. package/dist/array/search.js +1 -29
  93. package/dist/array/search.js.map +1 -1
  94. package/dist/array/sort.cjs +1 -1
  95. package/dist/array/sort.cjs.map +1 -1
  96. package/dist/array/sort.js +1 -14
  97. package/dist/array/sort.js.map +1 -1
  98. package/dist/array/take.cjs +1 -1
  99. package/dist/array/take.cjs.map +1 -1
  100. package/dist/array/take.js +1 -8
  101. package/dist/array/take.js.map +1 -1
  102. package/dist/array/takeLast.cjs +1 -1
  103. package/dist/array/takeLast.cjs.map +1 -1
  104. package/dist/array/takeLast.js +1 -8
  105. package/dist/array/takeLast.js.map +1 -1
  106. package/dist/array/toggle.cjs +1 -1
  107. package/dist/array/toggle.cjs.map +1 -1
  108. package/dist/array/toggle.js +1 -8
  109. package/dist/array/toggle.js.map +1 -1
  110. package/dist/array/union.cjs +1 -1
  111. package/dist/array/union.cjs.map +1 -1
  112. package/dist/array/union.js +1 -8
  113. package/dist/array/union.js.map +1 -1
  114. package/dist/array/uniq.cjs +1 -1
  115. package/dist/array/uniq.cjs.map +1 -1
  116. package/dist/array/uniq.js +1 -8
  117. package/dist/array/uniq.js.map +1 -1
  118. package/dist/array/unzip.cjs +1 -1
  119. package/dist/array/unzip.cjs.map +1 -1
  120. package/dist/array/unzip.js +1 -10
  121. package/dist/array/unzip.js.map +1 -1
  122. package/dist/array/zip.cjs +1 -1
  123. package/dist/array/zip.cjs.map +1 -1
  124. package/dist/array/zip.js +1 -10
  125. package/dist/array/zip.js.map +1 -1
  126. package/dist/arsenal.cjs +1 -1
  127. package/dist/arsenal.cjs.map +1 -1
  128. package/dist/arsenal.iife.js +1 -1
  129. package/dist/arsenal.iife.js.map +1 -1
  130. package/dist/arsenal.js +1 -1
  131. package/dist/arsenal.js.map +1 -1
  132. package/dist/async/abortError.cjs +1 -1
  133. package/dist/async/abortError.cjs.map +1 -1
  134. package/dist/async/abortError.js +1 -7
  135. package/dist/async/abortError.js.map +1 -1
  136. package/dist/async/abortable.cjs +1 -1
  137. package/dist/async/abortable.cjs.map +1 -1
  138. package/dist/async/abortable.js +1 -11
  139. package/dist/async/abortable.js.map +1 -1
  140. package/dist/async/attempt.cjs +1 -1
  141. package/dist/async/attempt.cjs.map +1 -1
  142. package/dist/async/attempt.js +1 -23
  143. package/dist/async/attempt.js.map +1 -1
  144. package/dist/async/backoff.cjs +1 -1
  145. package/dist/async/backoff.cjs.map +1 -1
  146. package/dist/async/backoff.js +1 -7
  147. package/dist/async/backoff.js.map +1 -1
  148. package/dist/async/index.js +1 -10
  149. package/dist/async/parallel.cjs +1 -1
  150. package/dist/async/parallel.cjs.map +1 -1
  151. package/dist/async/parallel.js +1 -24
  152. package/dist/async/parallel.js.map +1 -1
  153. package/dist/async/retry.cjs +1 -1
  154. package/dist/async/retry.cjs.map +1 -1
  155. package/dist/async/retry.d.ts +4 -6
  156. package/dist/async/retry.d.ts.map +1 -1
  157. package/dist/async/retry.js +1 -24
  158. package/dist/async/retry.js.map +1 -1
  159. package/dist/async/sleep.cjs +1 -1
  160. package/dist/async/sleep.cjs.map +1 -1
  161. package/dist/async/sleep.js +1 -15
  162. package/dist/async/sleep.js.map +1 -1
  163. package/dist/async/taskPool.cjs +1 -1
  164. package/dist/async/taskPool.cjs.map +1 -1
  165. package/dist/async/taskPool.js +1 -50
  166. package/dist/async/taskPool.js.map +1 -1
  167. package/dist/async/waitFor.cjs +1 -1
  168. package/dist/async/waitFor.cjs.map +1 -1
  169. package/dist/async/waitFor.js +1 -12
  170. package/dist/async/waitFor.js.map +1 -1
  171. package/dist/cache/cache.cjs +1 -1
  172. package/dist/cache/cache.cjs.map +1 -1
  173. package/dist/cache/cache.js +1 -59
  174. package/dist/cache/cache.js.map +1 -1
  175. package/dist/cache/index.js +1 -3
  176. package/dist/cache/memo.cjs +1 -1
  177. package/dist/cache/memo.cjs.map +1 -1
  178. package/dist/cache/memo.js +1 -37
  179. package/dist/cache/memo.js.map +1 -1
  180. package/dist/encoding/base64url.cjs +2 -0
  181. package/dist/encoding/base64url.cjs.map +1 -0
  182. package/dist/encoding/base64url.d.ts +9 -0
  183. package/dist/encoding/base64url.d.ts.map +1 -0
  184. package/dist/encoding/base64url.js +2 -0
  185. package/dist/encoding/base64url.js.map +1 -0
  186. package/dist/encoding/index.cjs +1 -0
  187. package/dist/encoding/index.d.ts +2 -0
  188. package/dist/encoding/index.d.ts.map +1 -0
  189. package/dist/encoding/index.js +1 -0
  190. package/dist/errors.cjs +1 -1
  191. package/dist/errors.cjs.map +1 -1
  192. package/dist/errors.js +1 -9
  193. package/dist/errors.js.map +1 -1
  194. package/dist/function/assert.cjs +1 -1
  195. package/dist/function/assert.cjs.map +1 -1
  196. package/dist/function/assert.js +1 -7
  197. package/dist/function/assert.js.map +1 -1
  198. package/dist/function/debounce.cjs +1 -1
  199. package/dist/function/debounce.cjs.map +1 -1
  200. package/dist/function/debounce.js +1 -26
  201. package/dist/function/debounce.js.map +1 -1
  202. package/dist/function/index.cjs +1 -1
  203. package/dist/function/index.d.ts +1 -0
  204. package/dist/function/index.d.ts.map +1 -1
  205. package/dist/function/index.js +1 -8
  206. package/dist/function/once.cjs +1 -1
  207. package/dist/function/once.cjs.map +1 -1
  208. package/dist/function/once.js +1 -10
  209. package/dist/function/once.js.map +1 -1
  210. package/dist/function/pipe.cjs +1 -1
  211. package/dist/function/pipe.cjs.map +1 -1
  212. package/dist/function/pipe.js +1 -9
  213. package/dist/function/pipe.js.map +1 -1
  214. package/dist/function/runAll.cjs +1 -1
  215. package/dist/function/runAll.cjs.map +1 -1
  216. package/dist/function/runAll.js +1 -18
  217. package/dist/function/runAll.js.map +1 -1
  218. package/dist/function/tap.cjs +1 -1
  219. package/dist/function/tap.cjs.map +1 -1
  220. package/dist/function/tap.js +1 -7
  221. package/dist/function/tap.js.map +1 -1
  222. package/dist/function/tapper.cjs +2 -0
  223. package/dist/function/tapper.cjs.map +1 -0
  224. package/dist/function/tapper.d.ts +27 -0
  225. package/dist/function/tapper.d.ts.map +1 -0
  226. package/dist/function/tapper.js +2 -0
  227. package/dist/function/tapper.js.map +1 -0
  228. package/dist/function/throttle.cjs +1 -1
  229. package/dist/function/throttle.cjs.map +1 -1
  230. package/dist/function/throttle.js +1 -35
  231. package/dist/function/throttle.js.map +1 -1
  232. package/dist/guards/combinators.cjs +1 -1
  233. package/dist/guards/combinators.cjs.map +1 -1
  234. package/dist/guards/combinators.js +1 -16
  235. package/dist/guards/combinators.js.map +1 -1
  236. package/dist/guards/index.js +1 -17
  237. package/dist/guards/isAbortError.cjs +1 -1
  238. package/dist/guards/isAbortError.cjs.map +1 -1
  239. package/dist/guards/isAbortError.js +1 -7
  240. package/dist/guards/isAbortError.js.map +1 -1
  241. package/dist/guards/isDate.cjs +1 -1
  242. package/dist/guards/isDate.cjs.map +1 -1
  243. package/dist/guards/isDate.js +1 -7
  244. package/dist/guards/isDate.js.map +1 -1
  245. package/dist/guards/isDefined.cjs +1 -1
  246. package/dist/guards/isDefined.cjs.map +1 -1
  247. package/dist/guards/isDefined.js +1 -7
  248. package/dist/guards/isDefined.js.map +1 -1
  249. package/dist/guards/isEmpty.cjs +1 -1
  250. package/dist/guards/isEmpty.cjs.map +1 -1
  251. package/dist/guards/isEmpty.js +1 -8
  252. package/dist/guards/isEmpty.js.map +1 -1
  253. package/dist/guards/isEqual.cjs +1 -1
  254. package/dist/guards/isEqual.cjs.map +1 -1
  255. package/dist/guards/isEqual.js +1 -33
  256. package/dist/guards/isEqual.js.map +1 -1
  257. package/dist/guards/isError.cjs +1 -1
  258. package/dist/guards/isError.cjs.map +1 -1
  259. package/dist/guards/isError.js +1 -7
  260. package/dist/guards/isError.js.map +1 -1
  261. package/dist/guards/isFunction.cjs +1 -1
  262. package/dist/guards/isFunction.cjs.map +1 -1
  263. package/dist/guards/isFunction.js +1 -7
  264. package/dist/guards/isFunction.js.map +1 -1
  265. package/dist/guards/isMatch.cjs +1 -1
  266. package/dist/guards/isMatch.cjs.map +1 -1
  267. package/dist/guards/isMatch.js +1 -22
  268. package/dist/guards/isMatch.js.map +1 -1
  269. package/dist/guards/isNil.cjs +1 -1
  270. package/dist/guards/isNil.cjs.map +1 -1
  271. package/dist/guards/isNil.js +1 -7
  272. package/dist/guards/isNil.js.map +1 -1
  273. package/dist/guards/isNumber.cjs +1 -1
  274. package/dist/guards/isNumber.cjs.map +1 -1
  275. package/dist/guards/isNumber.js +1 -7
  276. package/dist/guards/isNumber.js.map +1 -1
  277. package/dist/guards/isPlainObject.cjs +1 -1
  278. package/dist/guards/isPlainObject.cjs.map +1 -1
  279. package/dist/guards/isPlainObject.js +1 -9
  280. package/dist/guards/isPlainObject.js.map +1 -1
  281. package/dist/guards/isPrimitive.cjs +1 -1
  282. package/dist/guards/isPrimitive.cjs.map +1 -1
  283. package/dist/guards/isPrimitive.js +1 -7
  284. package/dist/guards/isPrimitive.js.map +1 -1
  285. package/dist/guards/isPromise.cjs +1 -1
  286. package/dist/guards/isPromise.cjs.map +1 -1
  287. package/dist/guards/isPromise.js +1 -7
  288. package/dist/guards/isPromise.js.map +1 -1
  289. package/dist/guards/isRegex.cjs +1 -1
  290. package/dist/guards/isRegex.cjs.map +1 -1
  291. package/dist/guards/isRegex.js +1 -7
  292. package/dist/guards/isRegex.js.map +1 -1
  293. package/dist/guards/shallowEqual.cjs +1 -1
  294. package/dist/guards/shallowEqual.cjs.map +1 -1
  295. package/dist/guards/shallowEqual.js +1 -19
  296. package/dist/guards/shallowEqual.js.map +1 -1
  297. package/dist/index.cjs +1 -1
  298. package/dist/index.d.ts +7 -0
  299. package/dist/index.d.ts.map +1 -1
  300. package/dist/index.js +1 -35
  301. package/dist/math/allocate.cjs +1 -1
  302. package/dist/math/allocate.cjs.map +1 -1
  303. package/dist/math/allocate.js +1 -18
  304. package/dist/math/allocate.js.map +1 -1
  305. package/dist/math/average.cjs +1 -1
  306. package/dist/math/average.cjs.map +1 -1
  307. package/dist/math/average.js +1 -8
  308. package/dist/math/average.js.map +1 -1
  309. package/dist/math/clamp.cjs +1 -1
  310. package/dist/math/clamp.cjs.map +1 -1
  311. package/dist/math/clamp.js +1 -7
  312. package/dist/math/clamp.js.map +1 -1
  313. package/dist/math/gcd.cjs +1 -1
  314. package/dist/math/gcd.cjs.map +1 -1
  315. package/dist/math/gcd.js +1 -13
  316. package/dist/math/gcd.js.map +1 -1
  317. package/dist/math/index.js +1 -16
  318. package/dist/math/lcm.cjs +1 -1
  319. package/dist/math/lcm.cjs.map +1 -1
  320. package/dist/math/lcm.js +1 -12
  321. package/dist/math/lcm.js.map +1 -1
  322. package/dist/math/lerp.cjs +1 -1
  323. package/dist/math/lerp.cjs.map +1 -1
  324. package/dist/math/lerp.js +1 -7
  325. package/dist/math/lerp.js.map +1 -1
  326. package/dist/math/linspace.cjs +1 -1
  327. package/dist/math/linspace.cjs.map +1 -1
  328. package/dist/math/linspace.js +1 -11
  329. package/dist/math/linspace.js.map +1 -1
  330. package/dist/math/median.cjs +1 -1
  331. package/dist/math/median.cjs.map +1 -1
  332. package/dist/math/median.js +1 -11
  333. package/dist/math/median.js.map +1 -1
  334. package/dist/math/mod.cjs +1 -1
  335. package/dist/math/mod.cjs.map +1 -1
  336. package/dist/math/mod.js +1 -8
  337. package/dist/math/mod.js.map +1 -1
  338. package/dist/math/normalize.cjs +1 -1
  339. package/dist/math/normalize.cjs.map +1 -1
  340. package/dist/math/normalize.js +1 -8
  341. package/dist/math/normalize.js.map +1 -1
  342. package/dist/math/range.cjs +1 -1
  343. package/dist/math/range.cjs.map +1 -1
  344. package/dist/math/range.js +1 -25
  345. package/dist/math/range.js.map +1 -1
  346. package/dist/math/round.cjs +1 -1
  347. package/dist/math/round.cjs.map +1 -1
  348. package/dist/math/round.js +1 -9
  349. package/dist/math/round.js.map +1 -1
  350. package/dist/math/standardDeviation.cjs +1 -1
  351. package/dist/math/standardDeviation.cjs.map +1 -1
  352. package/dist/math/standardDeviation.js +1 -8
  353. package/dist/math/standardDeviation.js.map +1 -1
  354. package/dist/math/sum.cjs +1 -1
  355. package/dist/math/sum.cjs.map +1 -1
  356. package/dist/math/sum.js +1 -11
  357. package/dist/math/sum.js.map +1 -1
  358. package/dist/math/variance.cjs +1 -1
  359. package/dist/math/variance.cjs.map +1 -1
  360. package/dist/math/variance.js +1 -10
  361. package/dist/math/variance.js.map +1 -1
  362. package/dist/object/defaults.cjs +1 -1
  363. package/dist/object/defaults.cjs.map +1 -1
  364. package/dist/object/defaults.js +1 -11
  365. package/dist/object/defaults.js.map +1 -1
  366. package/dist/object/diff.cjs +1 -1
  367. package/dist/object/diff.cjs.map +1 -1
  368. package/dist/object/diff.js +1 -26
  369. package/dist/object/diff.js.map +1 -1
  370. package/dist/object/filterValues.cjs +1 -1
  371. package/dist/object/filterValues.cjs.map +1 -1
  372. package/dist/object/filterValues.js +1 -10
  373. package/dist/object/filterValues.js.map +1 -1
  374. package/dist/object/flattenPaths.cjs +1 -1
  375. package/dist/object/flattenPaths.cjs.map +1 -1
  376. package/dist/object/flattenPaths.js +1 -30
  377. package/dist/object/flattenPaths.js.map +1 -1
  378. package/dist/object/getPath.cjs +1 -1
  379. package/dist/object/getPath.cjs.map +1 -1
  380. package/dist/object/getPath.js +1 -25
  381. package/dist/object/getPath.js.map +1 -1
  382. package/dist/object/hash.cjs +1 -1
  383. package/dist/object/hash.cjs.map +1 -1
  384. package/dist/object/hash.js +1 -27
  385. package/dist/object/hash.js.map +1 -1
  386. package/dist/object/index.js +1 -15
  387. package/dist/object/invert.cjs +1 -1
  388. package/dist/object/invert.cjs.map +1 -1
  389. package/dist/object/invert.js +1 -10
  390. package/dist/object/invert.js.map +1 -1
  391. package/dist/object/mapKeys.cjs +1 -1
  392. package/dist/object/mapKeys.cjs.map +1 -1
  393. package/dist/object/mapKeys.js +1 -14
  394. package/dist/object/mapKeys.js.map +1 -1
  395. package/dist/object/mapValues.cjs +1 -1
  396. package/dist/object/mapValues.cjs.map +1 -1
  397. package/dist/object/mapValues.js +1 -10
  398. package/dist/object/mapValues.js.map +1 -1
  399. package/dist/object/merge.cjs +1 -1
  400. package/dist/object/merge.cjs.map +1 -1
  401. package/dist/object/merge.js +1 -25
  402. package/dist/object/merge.js.map +1 -1
  403. package/dist/object/omit.cjs +1 -1
  404. package/dist/object/omit.cjs.map +1 -1
  405. package/dist/object/omit.js +1 -10
  406. package/dist/object/omit.js.map +1 -1
  407. package/dist/object/pick.cjs +1 -1
  408. package/dist/object/pick.cjs.map +1 -1
  409. package/dist/object/pick.js +1 -10
  410. package/dist/object/pick.js.map +1 -1
  411. package/dist/object/prune.cjs +1 -1
  412. package/dist/object/prune.cjs.map +1 -1
  413. package/dist/object/prune.js +1 -33
  414. package/dist/object/prune.js.map +1 -1
  415. package/dist/object/tryParseJson.cjs +1 -1
  416. package/dist/object/tryParseJson.cjs.map +1 -1
  417. package/dist/object/tryParseJson.js +1 -17
  418. package/dist/object/tryParseJson.js.map +1 -1
  419. package/dist/random/_index.cjs +1 -1
  420. package/dist/random/_index.cjs.map +1 -1
  421. package/dist/random/_index.js +1 -8
  422. package/dist/random/_index.js.map +1 -1
  423. package/dist/random/draw.cjs +1 -1
  424. package/dist/random/draw.cjs.map +1 -1
  425. package/dist/random/draw.js +1 -20
  426. package/dist/random/draw.js.map +1 -1
  427. package/dist/random/index.js +1 -5
  428. package/dist/random/random.cjs +1 -1
  429. package/dist/random/random.cjs.map +1 -1
  430. package/dist/random/random.js +1 -9
  431. package/dist/random/random.js.map +1 -1
  432. package/dist/random/shuffle.cjs +1 -1
  433. package/dist/random/shuffle.cjs.map +1 -1
  434. package/dist/random/shuffle.js +1 -13
  435. package/dist/random/shuffle.js.map +1 -1
  436. package/dist/random/source.cjs +1 -1
  437. package/dist/random/source.cjs.map +1 -1
  438. package/dist/random/source.js +1 -9
  439. package/dist/random/source.js.map +1 -1
  440. package/dist/string/_caseUtils.cjs +1 -1
  441. package/dist/string/_caseUtils.cjs.map +1 -1
  442. package/dist/string/_caseUtils.js +1 -12
  443. package/dist/string/_caseUtils.js.map +1 -1
  444. package/dist/string/camelCase.cjs +1 -1
  445. package/dist/string/camelCase.cjs.map +1 -1
  446. package/dist/string/camelCase.js +1 -8
  447. package/dist/string/camelCase.js.map +1 -1
  448. package/dist/string/escape.cjs +1 -1
  449. package/dist/string/escape.cjs.map +1 -1
  450. package/dist/string/escape.js +1 -14
  451. package/dist/string/escape.js.map +1 -1
  452. package/dist/string/index.js +1 -12
  453. package/dist/string/kebabCase.cjs +1 -1
  454. package/dist/string/kebabCase.cjs.map +1 -1
  455. package/dist/string/kebabCase.js +1 -8
  456. package/dist/string/kebabCase.js.map +1 -1
  457. package/dist/string/padCenter.cjs +1 -1
  458. package/dist/string/padCenter.cjs.map +1 -1
  459. package/dist/string/padCenter.js +1 -9
  460. package/dist/string/padCenter.js.map +1 -1
  461. package/dist/string/pascalCase.cjs +1 -1
  462. package/dist/string/pascalCase.cjs.map +1 -1
  463. package/dist/string/pascalCase.js +1 -8
  464. package/dist/string/pascalCase.js.map +1 -1
  465. package/dist/string/similarity.cjs +1 -1
  466. package/dist/string/similarity.cjs.map +1 -1
  467. package/dist/string/similarity.js +1 -22
  468. package/dist/string/similarity.js.map +1 -1
  469. package/dist/string/snakeCase.cjs +1 -1
  470. package/dist/string/snakeCase.cjs.map +1 -1
  471. package/dist/string/snakeCase.js +1 -8
  472. package/dist/string/snakeCase.js.map +1 -1
  473. package/dist/string/titleCase.cjs +1 -1
  474. package/dist/string/titleCase.cjs.map +1 -1
  475. package/dist/string/titleCase.js +1 -8
  476. package/dist/string/titleCase.js.map +1 -1
  477. package/dist/string/truncate.cjs +1 -1
  478. package/dist/string/truncate.cjs.map +1 -1
  479. package/dist/string/truncate.js +1 -15
  480. package/dist/string/truncate.js.map +1 -1
  481. package/dist/string/unescape.cjs +1 -1
  482. package/dist/string/unescape.cjs.map +1 -1
  483. package/dist/string/unescape.js +1 -14
  484. package/dist/string/unescape.js.map +1 -1
  485. package/dist/string/words.cjs +1 -1
  486. package/dist/string/words.cjs.map +1 -1
  487. package/dist/string/words.js +1 -9
  488. package/dist/string/words.js.map +1 -1
  489. package/dist/types.d.ts +10 -0
  490. package/dist/types.d.ts.map +1 -1
  491. package/package.json +13 -5
@@ -1 +1 @@
1
- {"version":3,"file":"isMatch.cjs","names":[],"sources":["../../src/guards/isMatch.ts"],"sourcesContent":["/**\n * Performs a partial deep comparison between object and source to determine if object contains equivalent property values.\n *\n * @example\n * ```ts\n * const object = { a: 1, b: 2, c: { d: 3 } };\n *\n * isMatch(object, { a: 1, c: { d: 3 } }); // true\n * isMatch(object, { a: 1, b: 2 }); // true\n * isMatch(object, { a: 1, c: { d: 4 } }); // false\n *\n * isMatch([1, 2, 3], [1, 2]); // true\n * isMatch([1, 2, 3], [1, 2, 3]); // true\n * isMatch([1, 2, 3], [1, 2, 4]); // false\n * ```\n *\n * @param object - The object to inspect.\n * @param source - The object of property values to match.\n *\n * @returns `true` if the object is a match, else `false`.\n */\nexport function isMatch(object: unknown, source: unknown): boolean {\n if (object === source) return true;\n\n if (object == null || source == null) return false;\n\n const isObjArray = Array.isArray(object);\n const isSrcArray = Array.isArray(source);\n\n if (isObjArray !== isSrcArray) return false;\n\n if (isObjArray && isSrcArray) {\n const objArr = object as unknown[];\n const srcArr = source as unknown[];\n\n if (srcArr.length > objArr.length) return false;\n\n return srcArr.every((item, i) => isMatch(objArr[i], item));\n }\n\n if (typeof source === 'object' && typeof object === 'object') {\n // Date has no own enumerable properties — compare by timestamp instead of falling through\n // to the empty Object.keys() loop below (which would vacuously return true).\n if (source instanceof Date || object instanceof Date) {\n return source instanceof Date && object instanceof Date && source.getTime() === object.getTime();\n }\n\n // Same reasoning for RegExp — compare by source pattern and flags.\n if (source instanceof RegExp || object instanceof RegExp) {\n return (\n source instanceof RegExp &&\n object instanceof RegExp &&\n source.source === object.source &&\n source.flags === object.flags\n );\n }\n\n // Map and Set are not structurally matched by key iteration — treat as opaque\n if (source instanceof Map || source instanceof Set || object instanceof Map || object instanceof Set) {\n return false;\n }\n\n for (const key of Object.keys(source as Record<string, unknown>)) {\n if (!isMatch((object as Record<string, unknown>)?.[key], (source as Record<string, unknown>)[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return object === source;\n}\n"],"mappings":"AAqBA,SAAgB,EAAQ,EAAiB,EAA0B,CACjE,GAAI,IAAW,EAAQ,MAAO,GAE9B,GAAI,GAAU,MAAQ,GAAU,KAAM,MAAO,GAE7C,IAAM,EAAa,MAAM,QAAQ,CAAM,EACjC,EAAa,MAAM,QAAQ,CAAM,EAEvC,GAAI,IAAe,EAAY,MAAO,GAEtC,GAAI,GAAc,EAAY,CAC5B,IAAM,EAAS,EACT,EAAS,EAIf,OAFI,EAAO,OAAS,EAAO,OAAe,GAEnC,EAAO,OAAO,EAAM,IAAM,EAAQ,EAAO,GAAI,CAAI,CAAC,CAC3D,CAEA,GAAI,OAAO,GAAW,UAAY,OAAO,GAAW,SAAU,CAG5D,GAAI,aAAkB,MAAQ,aAAkB,KAC9C,OAAO,aAAkB,MAAQ,aAAkB,MAAQ,EAAO,QAAQ,IAAM,EAAO,QAAQ,EAIjG,GAAI,aAAkB,QAAU,aAAkB,OAChD,OACE,aAAkB,QAClB,aAAkB,QAClB,EAAO,SAAW,EAAO,QACzB,EAAO,QAAU,EAAO,MAK5B,GAAI,aAAkB,KAAO,aAAkB,KAAO,aAAkB,KAAO,aAAkB,IAC/F,MAAO,GAGT,IAAK,IAAM,KAAO,OAAO,KAAK,CAAiC,EAC7D,GAAI,CAAC,EAAS,IAAqC,GAAO,EAAmC,EAAI,EAC/F,MAAO,GAIX,MAAO,EACT,CAEA,OAAO,IAAW,CACpB"}
1
+ {"version":3,"file":"isMatch.cjs","names":[],"sources":["../../src/guards/isMatch.ts"],"sourcesContent":["/**\n * Performs a partial deep comparison between object and source to determine if object contains equivalent property values.\n *\n * @example\n * ```ts\n * const object = { a: 1, b: 2, c: { d: 3 } };\n *\n * isMatch(object, { a: 1, c: { d: 3 } }); // true\n * isMatch(object, { a: 1, b: 2 }); // true\n * isMatch(object, { a: 1, c: { d: 4 } }); // false\n *\n * isMatch([1, 2, 3], [1, 2]); // true\n * isMatch([1, 2, 3], [1, 2, 3]); // true\n * isMatch([1, 2, 3], [1, 2, 4]); // false\n * ```\n *\n * @param object - The object to inspect.\n * @param source - The object of property values to match.\n *\n * @returns `true` if the object is a match, else `false`.\n */\nexport function isMatch(object: unknown, source: unknown): boolean {\n if (object === source) return true;\n\n if (object == null || source == null) return false;\n\n const isObjArray = Array.isArray(object);\n const isSrcArray = Array.isArray(source);\n\n if (isObjArray !== isSrcArray) return false;\n\n if (isObjArray && isSrcArray) {\n const objArr = object as unknown[];\n const srcArr = source as unknown[];\n\n if (srcArr.length > objArr.length) return false;\n\n return srcArr.every((item, i) => isMatch(objArr[i], item));\n }\n\n if (typeof source === 'object' && typeof object === 'object') {\n // Date has no own enumerable properties — compare by timestamp instead of falling through\n // to the empty Object.keys() loop below (which would vacuously return true).\n if (source instanceof Date || object instanceof Date) {\n return source instanceof Date && object instanceof Date && source.getTime() === object.getTime();\n }\n\n // Same reasoning for RegExp — compare by source pattern and flags.\n if (source instanceof RegExp || object instanceof RegExp) {\n return (\n source instanceof RegExp &&\n object instanceof RegExp &&\n source.source === object.source &&\n source.flags === object.flags\n );\n }\n\n // Map and Set are not structurally matched by key iteration — treat as opaque\n if (source instanceof Map || source instanceof Set || object instanceof Map || object instanceof Set) {\n return false;\n }\n\n for (const key of Object.keys(source as Record<string, unknown>)) {\n if (!isMatch((object as Record<string, unknown>)?.[key], (source as Record<string, unknown>)[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return object === source;\n}\n"],"mappings":"AAqBA,SAAgB,QAAQ,EAAiB,EAA0B,CACjE,GAAI,IAAW,EAAQ,MAAO,GAE9B,GAAI,GAAU,MAAQ,GAAU,KAAM,MAAO,GAE7C,IAAM,EAAa,MAAM,QAAQ,CAAM,EACjC,EAAa,MAAM,QAAQ,CAAM,EAEvC,GAAI,IAAe,EAAY,MAAO,GAEtC,GAAI,GAAc,EAAY,CAC5B,IAAM,EAAS,EACT,EAAS,EAIf,OAFI,EAAO,OAAS,EAAO,OAAe,GAEnC,EAAO,OAAO,EAAM,IAAM,QAAQ,EAAO,GAAI,CAAI,CAAC,CAC3D,CAEA,GAAI,OAAO,GAAW,UAAY,OAAO,GAAW,SAAU,CAG5D,GAAI,aAAkB,MAAQ,aAAkB,KAC9C,OAAO,aAAkB,MAAQ,aAAkB,MAAQ,EAAO,QAAQ,IAAM,EAAO,QAAQ,EAIjG,GAAI,aAAkB,QAAU,aAAkB,OAChD,OACE,aAAkB,QAClB,aAAkB,QAClB,EAAO,SAAW,EAAO,QACzB,EAAO,QAAU,EAAO,MAK5B,GAAI,aAAkB,KAAO,aAAkB,KAAO,aAAkB,KAAO,aAAkB,IAC/F,MAAO,GAGT,IAAK,IAAM,KAAO,OAAO,KAAK,CAAiC,EAC7D,GAAI,CAAC,QAAS,IAAqC,GAAO,EAAmC,EAAI,EAC/F,MAAO,GAIX,MAAO,EACT,CAEA,OAAO,IAAW,CACpB"}
@@ -1,23 +1,2 @@
1
- //#region src/guards/isMatch.ts
2
- function e(t, n) {
3
- if (t === n) return !0;
4
- if (t == null || n == null) return !1;
5
- let r = Array.isArray(t), i = Array.isArray(n);
6
- if (r !== i) return !1;
7
- if (r && i) {
8
- let r = t, i = n;
9
- return i.length > r.length ? !1 : i.every((t, n) => e(r[n], t));
10
- }
11
- if (typeof n == "object" && typeof t == "object") {
12
- if (n instanceof Date || t instanceof Date) return n instanceof Date && t instanceof Date && n.getTime() === t.getTime();
13
- if (n instanceof RegExp || t instanceof RegExp) return n instanceof RegExp && t instanceof RegExp && n.source === t.source && n.flags === t.flags;
14
- if (n instanceof Map || n instanceof Set || t instanceof Map || t instanceof Set) return !1;
15
- for (let r of Object.keys(n)) if (!e(t?.[r], n[r])) return !1;
16
- return !0;
17
- }
18
- return t === n;
19
- }
20
- //#endregion
21
- export { e as isMatch };
22
-
1
+ function isMatch(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;if(n&&r){let n=e,r=t;return r.length>n.length?!1:r.every((e,t)=>isMatch(n[t],e))}if(typeof t==`object`&&typeof e==`object`){if(t instanceof Date||e instanceof Date)return t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime();if(t instanceof RegExp||e instanceof RegExp)return t instanceof RegExp&&e instanceof RegExp&&t.source===e.source&&t.flags===e.flags;if(t instanceof Map||t instanceof Set||e instanceof Map||e instanceof Set)return!1;for(let n of Object.keys(t))if(!isMatch(e?.[n],t[n]))return!1;return!0}return e===t}export{isMatch};
23
2
  //# sourceMappingURL=isMatch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isMatch.js","names":[],"sources":["../../src/guards/isMatch.ts"],"sourcesContent":["/**\n * Performs a partial deep comparison between object and source to determine if object contains equivalent property values.\n *\n * @example\n * ```ts\n * const object = { a: 1, b: 2, c: { d: 3 } };\n *\n * isMatch(object, { a: 1, c: { d: 3 } }); // true\n * isMatch(object, { a: 1, b: 2 }); // true\n * isMatch(object, { a: 1, c: { d: 4 } }); // false\n *\n * isMatch([1, 2, 3], [1, 2]); // true\n * isMatch([1, 2, 3], [1, 2, 3]); // true\n * isMatch([1, 2, 3], [1, 2, 4]); // false\n * ```\n *\n * @param object - The object to inspect.\n * @param source - The object of property values to match.\n *\n * @returns `true` if the object is a match, else `false`.\n */\nexport function isMatch(object: unknown, source: unknown): boolean {\n if (object === source) return true;\n\n if (object == null || source == null) return false;\n\n const isObjArray = Array.isArray(object);\n const isSrcArray = Array.isArray(source);\n\n if (isObjArray !== isSrcArray) return false;\n\n if (isObjArray && isSrcArray) {\n const objArr = object as unknown[];\n const srcArr = source as unknown[];\n\n if (srcArr.length > objArr.length) return false;\n\n return srcArr.every((item, i) => isMatch(objArr[i], item));\n }\n\n if (typeof source === 'object' && typeof object === 'object') {\n // Date has no own enumerable properties — compare by timestamp instead of falling through\n // to the empty Object.keys() loop below (which would vacuously return true).\n if (source instanceof Date || object instanceof Date) {\n return source instanceof Date && object instanceof Date && source.getTime() === object.getTime();\n }\n\n // Same reasoning for RegExp — compare by source pattern and flags.\n if (source instanceof RegExp || object instanceof RegExp) {\n return (\n source instanceof RegExp &&\n object instanceof RegExp &&\n source.source === object.source &&\n source.flags === object.flags\n );\n }\n\n // Map and Set are not structurally matched by key iteration — treat as opaque\n if (source instanceof Map || source instanceof Set || object instanceof Map || object instanceof Set) {\n return false;\n }\n\n for (const key of Object.keys(source as Record<string, unknown>)) {\n if (!isMatch((object as Record<string, unknown>)?.[key], (source as Record<string, unknown>)[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return object === source;\n}\n"],"mappings":";AAqBA,SAAgB,EAAQ,GAAiB,GAA0B;CACjE,IAAI,MAAW,GAAQ,OAAO;CAE9B,IAAI,KAAU,QAAQ,KAAU,MAAM,OAAO;CAE7C,IAAM,IAAa,MAAM,QAAQ,CAAM,GACjC,IAAa,MAAM,QAAQ,CAAM;CAEvC,IAAI,MAAe,GAAY,OAAO;CAEtC,IAAI,KAAc,GAAY;EAC5B,IAAM,IAAS,GACT,IAAS;EAIf,OAFI,EAAO,SAAS,EAAO,SAAe,KAEnC,EAAO,OAAO,GAAM,MAAM,EAAQ,EAAO,IAAI,CAAI,CAAC;CAC3D;CAEA,IAAI,OAAO,KAAW,YAAY,OAAO,KAAW,UAAU;EAG5D,IAAI,aAAkB,QAAQ,aAAkB,MAC9C,OAAO,aAAkB,QAAQ,aAAkB,QAAQ,EAAO,QAAQ,MAAM,EAAO,QAAQ;EAIjG,IAAI,aAAkB,UAAU,aAAkB,QAChD,OACE,aAAkB,UAClB,aAAkB,UAClB,EAAO,WAAW,EAAO,UACzB,EAAO,UAAU,EAAO;EAK5B,IAAI,aAAkB,OAAO,aAAkB,OAAO,aAAkB,OAAO,aAAkB,KAC/F,OAAO;EAGT,KAAK,IAAM,KAAO,OAAO,KAAK,CAAiC,GAC7D,IAAI,CAAC,EAAS,IAAqC,IAAO,EAAmC,EAAI,GAC/F,OAAO;EAIX,OAAO;CACT;CAEA,OAAO,MAAW;AACpB"}
1
+ {"version":3,"file":"isMatch.js","names":[],"sources":["../../src/guards/isMatch.ts"],"sourcesContent":["/**\n * Performs a partial deep comparison between object and source to determine if object contains equivalent property values.\n *\n * @example\n * ```ts\n * const object = { a: 1, b: 2, c: { d: 3 } };\n *\n * isMatch(object, { a: 1, c: { d: 3 } }); // true\n * isMatch(object, { a: 1, b: 2 }); // true\n * isMatch(object, { a: 1, c: { d: 4 } }); // false\n *\n * isMatch([1, 2, 3], [1, 2]); // true\n * isMatch([1, 2, 3], [1, 2, 3]); // true\n * isMatch([1, 2, 3], [1, 2, 4]); // false\n * ```\n *\n * @param object - The object to inspect.\n * @param source - The object of property values to match.\n *\n * @returns `true` if the object is a match, else `false`.\n */\nexport function isMatch(object: unknown, source: unknown): boolean {\n if (object === source) return true;\n\n if (object == null || source == null) return false;\n\n const isObjArray = Array.isArray(object);\n const isSrcArray = Array.isArray(source);\n\n if (isObjArray !== isSrcArray) return false;\n\n if (isObjArray && isSrcArray) {\n const objArr = object as unknown[];\n const srcArr = source as unknown[];\n\n if (srcArr.length > objArr.length) return false;\n\n return srcArr.every((item, i) => isMatch(objArr[i], item));\n }\n\n if (typeof source === 'object' && typeof object === 'object') {\n // Date has no own enumerable properties — compare by timestamp instead of falling through\n // to the empty Object.keys() loop below (which would vacuously return true).\n if (source instanceof Date || object instanceof Date) {\n return source instanceof Date && object instanceof Date && source.getTime() === object.getTime();\n }\n\n // Same reasoning for RegExp — compare by source pattern and flags.\n if (source instanceof RegExp || object instanceof RegExp) {\n return (\n source instanceof RegExp &&\n object instanceof RegExp &&\n source.source === object.source &&\n source.flags === object.flags\n );\n }\n\n // Map and Set are not structurally matched by key iteration — treat as opaque\n if (source instanceof Map || source instanceof Set || object instanceof Map || object instanceof Set) {\n return false;\n }\n\n for (const key of Object.keys(source as Record<string, unknown>)) {\n if (!isMatch((object as Record<string, unknown>)?.[key], (source as Record<string, unknown>)[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return object === source;\n}\n"],"mappings":"AAqBA,SAAgB,QAAQ,EAAiB,EAA0B,CACjE,GAAI,IAAW,EAAQ,MAAO,GAE9B,GAAI,GAAU,MAAQ,GAAU,KAAM,MAAO,GAE7C,IAAM,EAAa,MAAM,QAAQ,CAAM,EACjC,EAAa,MAAM,QAAQ,CAAM,EAEvC,GAAI,IAAe,EAAY,MAAO,GAEtC,GAAI,GAAc,EAAY,CAC5B,IAAM,EAAS,EACT,EAAS,EAIf,OAFI,EAAO,OAAS,EAAO,OAAe,GAEnC,EAAO,OAAO,EAAM,IAAM,QAAQ,EAAO,GAAI,CAAI,CAAC,CAC3D,CAEA,GAAI,OAAO,GAAW,UAAY,OAAO,GAAW,SAAU,CAG5D,GAAI,aAAkB,MAAQ,aAAkB,KAC9C,OAAO,aAAkB,MAAQ,aAAkB,MAAQ,EAAO,QAAQ,IAAM,EAAO,QAAQ,EAIjG,GAAI,aAAkB,QAAU,aAAkB,OAChD,OACE,aAAkB,QAClB,aAAkB,QAClB,EAAO,SAAW,EAAO,QACzB,EAAO,QAAU,EAAO,MAK5B,GAAI,aAAkB,KAAO,aAAkB,KAAO,aAAkB,KAAO,aAAkB,IAC/F,MAAO,GAGT,IAAK,IAAM,KAAO,OAAO,KAAK,CAAiC,EAC7D,GAAI,CAAC,QAAS,IAAqC,GAAO,EAAmC,EAAI,EAC/F,MAAO,GAIX,MAAO,EACT,CAEA,OAAO,IAAW,CACpB"}
@@ -1,2 +1,2 @@
1
- function e(e){return e==null}exports.isNil=e;
1
+ function isNil(e){return e==null}exports.isNil=isNil;
2
2
  //# sourceMappingURL=isNil.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isNil.cjs","names":[],"sources":["../../src/guards/isNil.ts"],"sourcesContent":["/**\n * Determines if the passed value is null or undefined.\n *\n * @example\n * ```ts\n * isNil(null); // true\n * isNil(undefined); // true\n * isNil(''); // false\n * isNil(0); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is null or undefined, else `false`.\n */\nexport function isNil(arg: unknown): arg is null | undefined {\n return arg === undefined || arg === null;\n}\n"],"mappings":"AAeA,SAAgB,EAAM,EAAuC,CAC3D,OAAO,GAA6B,IACtC"}
1
+ {"version":3,"file":"isNil.cjs","names":[],"sources":["../../src/guards/isNil.ts"],"sourcesContent":["/**\n * Determines if the passed value is null or undefined.\n *\n * @example\n * ```ts\n * isNil(null); // true\n * isNil(undefined); // true\n * isNil(''); // false\n * isNil(0); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is null or undefined, else `false`.\n */\nexport function isNil(arg: unknown): arg is null | undefined {\n return arg === undefined || arg === null;\n}\n"],"mappings":"AAeA,SAAgB,MAAM,EAAuC,CAC3D,OAAO,GAA6B,IACtC"}
@@ -1,8 +1,2 @@
1
- //#region src/guards/isNil.ts
2
- function e(e) {
3
- return e == null;
4
- }
5
- //#endregion
6
- export { e as isNil };
7
-
1
+ function isNil(e){return e==null}export{isNil};
8
2
  //# sourceMappingURL=isNil.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isNil.js","names":[],"sources":["../../src/guards/isNil.ts"],"sourcesContent":["/**\n * Determines if the passed value is null or undefined.\n *\n * @example\n * ```ts\n * isNil(null); // true\n * isNil(undefined); // true\n * isNil(''); // false\n * isNil(0); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is null or undefined, else `false`.\n */\nexport function isNil(arg: unknown): arg is null | undefined {\n return arg === undefined || arg === null;\n}\n"],"mappings":";AAeA,SAAgB,EAAM,GAAuC;CAC3D,OAAO,KAA6B;AACtC"}
1
+ {"version":3,"file":"isNil.js","names":[],"sources":["../../src/guards/isNil.ts"],"sourcesContent":["/**\n * Determines if the passed value is null or undefined.\n *\n * @example\n * ```ts\n * isNil(null); // true\n * isNil(undefined); // true\n * isNil(''); // false\n * isNil(0); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is null or undefined, else `false`.\n */\nexport function isNil(arg: unknown): arg is null | undefined {\n return arg === undefined || arg === null;\n}\n"],"mappings":"AAeA,SAAgB,MAAM,EAAuC,CAC3D,OAAO,GAA6B,IACtC"}
@@ -1,2 +1,2 @@
1
- function e(e){return typeof e==`number`&&!Number.isNaN(e)}exports.isNumber=e;
1
+ function isNumber(e){return typeof e==`number`&&!Number.isNaN(e)}exports.isNumber=isNumber;
2
2
  //# sourceMappingURL=isNumber.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isNumber.cjs","names":[],"sources":["../../src/guards/isNumber.ts"],"sourcesContent":["/**\n * Determines if the passed value is a number.\n *\n * @example\n * ```ts\n * isNumber(123); // true\n * isNumber('hello world'); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a number, else `false`.\n */\nexport function isNumber(arg: unknown): arg is number {\n return typeof arg === 'number' && !Number.isNaN(arg);\n}\n"],"mappings":"AAaA,SAAgB,EAAS,EAA6B,CACpD,OAAO,OAAO,GAAQ,UAAY,CAAC,OAAO,MAAM,CAAG,CACrD"}
1
+ {"version":3,"file":"isNumber.cjs","names":[],"sources":["../../src/guards/isNumber.ts"],"sourcesContent":["/**\n * Determines if the passed value is a number.\n *\n * @example\n * ```ts\n * isNumber(123); // true\n * isNumber('hello world'); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a number, else `false`.\n */\nexport function isNumber(arg: unknown): arg is number {\n return typeof arg === 'number' && !Number.isNaN(arg);\n}\n"],"mappings":"AAaA,SAAgB,SAAS,EAA6B,CACpD,OAAO,OAAO,GAAQ,UAAY,CAAC,OAAO,MAAM,CAAG,CACrD"}
@@ -1,8 +1,2 @@
1
- //#region src/guards/isNumber.ts
2
- function e(e) {
3
- return typeof e == "number" && !Number.isNaN(e);
4
- }
5
- //#endregion
6
- export { e as isNumber };
7
-
1
+ function isNumber(e){return typeof e==`number`&&!Number.isNaN(e)}export{isNumber};
8
2
  //# sourceMappingURL=isNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isNumber.js","names":[],"sources":["../../src/guards/isNumber.ts"],"sourcesContent":["/**\n * Determines if the passed value is a number.\n *\n * @example\n * ```ts\n * isNumber(123); // true\n * isNumber('hello world'); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a number, else `false`.\n */\nexport function isNumber(arg: unknown): arg is number {\n return typeof arg === 'number' && !Number.isNaN(arg);\n}\n"],"mappings":";AAaA,SAAgB,EAAS,GAA6B;CACpD,OAAO,OAAO,KAAQ,YAAY,CAAC,OAAO,MAAM,CAAG;AACrD"}
1
+ {"version":3,"file":"isNumber.js","names":[],"sources":["../../src/guards/isNumber.ts"],"sourcesContent":["/**\n * Determines if the passed value is a number.\n *\n * @example\n * ```ts\n * isNumber(123); // true\n * isNumber('hello world'); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a number, else `false`.\n */\nexport function isNumber(arg: unknown): arg is number {\n return typeof arg === 'number' && !Number.isNaN(arg);\n}\n"],"mappings":"AAaA,SAAgB,SAAS,EAA6B,CACpD,OAAO,OAAO,GAAQ,UAAY,CAAC,OAAO,MAAM,CAAG,CACrD"}
@@ -1,2 +1,2 @@
1
- function e(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}exports.isPlainObject=e;
1
+ function isPlainObject(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}exports.isPlainObject=isPlainObject;
2
2
  //# sourceMappingURL=isPlainObject.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPlainObject.cjs","names":[],"sources":["../../src/guards/isPlainObject.ts"],"sourcesContent":["/**\n * Returns `true` if `value` is a plain object — one with `Object.prototype` or `null` as its\n * prototype. Class instances, `Map`, `Set`, `Array` and other built-ins all return `false`.\n *\n * @example\n * ```ts\n * isPlainObject({}) // true\n * isPlainObject({ a: 1 }) // true\n * isPlainObject(Object.create(null)) // true\n * isPlainObject(new Map()) // false\n * isPlainObject([]) // false\n * isPlainObject(null) // false\n * ```\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value == null || typeof value !== 'object') return false;\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n"],"mappings":"AAcA,SAAgB,EAAc,EAAkD,CAC9E,GAAqB,OAAO,GAAU,WAAlC,EAA4C,MAAO,GAEvD,IAAM,EAAY,OAAO,eAAe,CAAK,EAE7C,OAAO,IAAc,OAAO,WAAa,IAAc,IACzD"}
1
+ {"version":3,"file":"isPlainObject.cjs","names":[],"sources":["../../src/guards/isPlainObject.ts"],"sourcesContent":["/**\n * Returns `true` if `value` is a plain object — one with `Object.prototype` or `null` as its\n * prototype. Class instances, `Map`, `Set`, `Array` and other built-ins all return `false`.\n *\n * @example\n * ```ts\n * isPlainObject({}) // true\n * isPlainObject({ a: 1 }) // true\n * isPlainObject(Object.create(null)) // true\n * isPlainObject(new Map()) // false\n * isPlainObject([]) // false\n * isPlainObject(null) // false\n * ```\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value == null || typeof value !== 'object') return false;\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n"],"mappings":"AAcA,SAAgB,cAAc,EAAkD,CAC9E,GAAqB,OAAO,GAAU,WAAlC,EAA4C,MAAO,GAEvD,IAAM,EAAY,OAAO,eAAe,CAAK,EAE7C,OAAO,IAAc,OAAO,WAAa,IAAc,IACzD"}
@@ -1,10 +1,2 @@
1
- //#region src/guards/isPlainObject.ts
2
- function e(e) {
3
- if (typeof e != "object" || !e) return !1;
4
- let t = Object.getPrototypeOf(e);
5
- return t === Object.prototype || t === null;
6
- }
7
- //#endregion
8
- export { e as isPlainObject };
9
-
1
+ function isPlainObject(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}export{isPlainObject};
10
2
  //# sourceMappingURL=isPlainObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPlainObject.js","names":[],"sources":["../../src/guards/isPlainObject.ts"],"sourcesContent":["/**\n * Returns `true` if `value` is a plain object — one with `Object.prototype` or `null` as its\n * prototype. Class instances, `Map`, `Set`, `Array` and other built-ins all return `false`.\n *\n * @example\n * ```ts\n * isPlainObject({}) // true\n * isPlainObject({ a: 1 }) // true\n * isPlainObject(Object.create(null)) // true\n * isPlainObject(new Map()) // false\n * isPlainObject([]) // false\n * isPlainObject(null) // false\n * ```\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value == null || typeof value !== 'object') return false;\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n"],"mappings":";AAcA,SAAgB,EAAc,GAAkD;CAC9E,IAAqB,OAAO,KAAU,aAAlC,GAA4C,OAAO;CAEvD,IAAM,IAAY,OAAO,eAAe,CAAK;CAE7C,OAAO,MAAc,OAAO,aAAa,MAAc;AACzD"}
1
+ {"version":3,"file":"isPlainObject.js","names":[],"sources":["../../src/guards/isPlainObject.ts"],"sourcesContent":["/**\n * Returns `true` if `value` is a plain object — one with `Object.prototype` or `null` as its\n * prototype. Class instances, `Map`, `Set`, `Array` and other built-ins all return `false`.\n *\n * @example\n * ```ts\n * isPlainObject({}) // true\n * isPlainObject({ a: 1 }) // true\n * isPlainObject(Object.create(null)) // true\n * isPlainObject(new Map()) // false\n * isPlainObject([]) // false\n * isPlainObject(null) // false\n * ```\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value == null || typeof value !== 'object') return false;\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n"],"mappings":"AAcA,SAAgB,cAAc,EAAkD,CAC9E,GAAqB,OAAO,GAAU,WAAlC,EAA4C,MAAO,GAEvD,IAAM,EAAY,OAAO,eAAe,CAAK,EAE7C,OAAO,IAAc,OAAO,WAAa,IAAc,IACzD"}
@@ -1,2 +1,2 @@
1
- function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}exports.isPrimitive=e;
1
+ function isPrimitive(e){return e===null||typeof e!=`object`&&typeof e!=`function`}exports.isPrimitive=isPrimitive;
2
2
  //# sourceMappingURL=isPrimitive.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPrimitive.cjs","names":[],"sources":["../../src/guards/isPrimitive.ts"],"sourcesContent":["/** JavaScript values that are not objects or functions. */\nexport type PrimitiveValue = bigint | boolean | null | number | string | symbol | undefined;\n\n/** Checks whether a value is a JavaScript primitive. */\nexport function isPrimitive(value: unknown): value is PrimitiveValue {\n return value === null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":"AAIA,SAAgB,EAAY,EAAyC,CACnE,OAAO,IAAU,MAAS,OAAO,GAAU,UAAY,OAAO,GAAU,UAC1E"}
1
+ {"version":3,"file":"isPrimitive.cjs","names":[],"sources":["../../src/guards/isPrimitive.ts"],"sourcesContent":["/** JavaScript values that are not objects or functions. */\nexport type PrimitiveValue = bigint | boolean | null | number | string | symbol | undefined;\n\n/** Checks whether a value is a JavaScript primitive. */\nexport function isPrimitive(value: unknown): value is PrimitiveValue {\n return value === null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":"AAIA,SAAgB,YAAY,EAAyC,CACnE,OAAO,IAAU,MAAS,OAAO,GAAU,UAAY,OAAO,GAAU,UAC1E"}
@@ -1,8 +1,2 @@
1
- //#region src/guards/isPrimitive.ts
2
- function e(e) {
3
- return e === null || typeof e != "object" && typeof e != "function";
4
- }
5
- //#endregion
6
- export { e as isPrimitive };
7
-
1
+ function isPrimitive(e){return e===null||typeof e!=`object`&&typeof e!=`function`}export{isPrimitive};
8
2
  //# sourceMappingURL=isPrimitive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPrimitive.js","names":[],"sources":["../../src/guards/isPrimitive.ts"],"sourcesContent":["/** JavaScript values that are not objects or functions. */\nexport type PrimitiveValue = bigint | boolean | null | number | string | symbol | undefined;\n\n/** Checks whether a value is a JavaScript primitive. */\nexport function isPrimitive(value: unknown): value is PrimitiveValue {\n return value === null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":";AAIA,SAAgB,EAAY,GAAyC;CACnE,OAAO,MAAU,QAAS,OAAO,KAAU,YAAY,OAAO,KAAU;AAC1E"}
1
+ {"version":3,"file":"isPrimitive.js","names":[],"sources":["../../src/guards/isPrimitive.ts"],"sourcesContent":["/** JavaScript values that are not objects or functions. */\nexport type PrimitiveValue = bigint | boolean | null | number | string | symbol | undefined;\n\n/** Checks whether a value is a JavaScript primitive. */\nexport function isPrimitive(value: unknown): value is PrimitiveValue {\n return value === null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":"AAIA,SAAgB,YAAY,EAAyC,CACnE,OAAO,IAAU,MAAS,OAAO,GAAU,UAAY,OAAO,GAAU,UAC1E"}
@@ -1,2 +1,2 @@
1
- function e(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}exports.isPromise=e;
1
+ function isPromise(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}exports.isPromise=isPromise;
2
2
  //# sourceMappingURL=isPromise.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPromise.cjs","names":[],"sources":["../../src/guards/isPromise.ts"],"sourcesContent":["/**\n * Determines if the passed value is a Promise (or any thenable).\n *\n * @example\n * ```ts\n * isPromise(new Promise((resolve) => resolve(1))); // true\n * isPromise(asyncFn()); // true (calling it returns a Promise)\n * isPromise(async () => {}); // false (the function itself is not a Promise)\n * isPromise(() => {}); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a thenable, else `false`.\n */\nexport function isPromise(arg: unknown): arg is Promise<unknown> {\n return typeof arg === 'object' && arg !== null && typeof (arg as { then?: unknown }).then === 'function';\n}\n"],"mappings":"AAeA,SAAgB,EAAU,EAAuC,CAC/D,OAAO,OAAO,GAAQ,YAAY,GAAgB,OAAQ,EAA2B,MAAS,UAChG"}
1
+ {"version":3,"file":"isPromise.cjs","names":[],"sources":["../../src/guards/isPromise.ts"],"sourcesContent":["/**\n * Determines if the passed value is a Promise (or any thenable).\n *\n * @example\n * ```ts\n * isPromise(new Promise((resolve) => resolve(1))); // true\n * isPromise(asyncFn()); // true (calling it returns a Promise)\n * isPromise(async () => {}); // false (the function itself is not a Promise)\n * isPromise(() => {}); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a thenable, else `false`.\n */\nexport function isPromise(arg: unknown): arg is Promise<unknown> {\n return typeof arg === 'object' && arg !== null && typeof (arg as { then?: unknown }).then === 'function';\n}\n"],"mappings":"AAeA,SAAgB,UAAU,EAAuC,CAC/D,OAAO,OAAO,GAAQ,YAAY,GAAgB,OAAQ,EAA2B,MAAS,UAChG"}
@@ -1,8 +1,2 @@
1
- //#region src/guards/isPromise.ts
2
- function e(e) {
3
- return typeof e == "object" && !!e && typeof e.then == "function";
4
- }
5
- //#endregion
6
- export { e as isPromise };
7
-
1
+ function isPromise(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}export{isPromise};
8
2
  //# sourceMappingURL=isPromise.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPromise.js","names":[],"sources":["../../src/guards/isPromise.ts"],"sourcesContent":["/**\n * Determines if the passed value is a Promise (or any thenable).\n *\n * @example\n * ```ts\n * isPromise(new Promise((resolve) => resolve(1))); // true\n * isPromise(asyncFn()); // true (calling it returns a Promise)\n * isPromise(async () => {}); // false (the function itself is not a Promise)\n * isPromise(() => {}); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a thenable, else `false`.\n */\nexport function isPromise(arg: unknown): arg is Promise<unknown> {\n return typeof arg === 'object' && arg !== null && typeof (arg as { then?: unknown }).then === 'function';\n}\n"],"mappings":";AAeA,SAAgB,EAAU,GAAuC;CAC/D,OAAO,OAAO,KAAQ,cAAY,KAAgB,OAAQ,EAA2B,QAAS;AAChG"}
1
+ {"version":3,"file":"isPromise.js","names":[],"sources":["../../src/guards/isPromise.ts"],"sourcesContent":["/**\n * Determines if the passed value is a Promise (or any thenable).\n *\n * @example\n * ```ts\n * isPromise(new Promise((resolve) => resolve(1))); // true\n * isPromise(asyncFn()); // true (calling it returns a Promise)\n * isPromise(async () => {}); // false (the function itself is not a Promise)\n * isPromise(() => {}); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a thenable, else `false`.\n */\nexport function isPromise(arg: unknown): arg is Promise<unknown> {\n return typeof arg === 'object' && arg !== null && typeof (arg as { then?: unknown }).then === 'function';\n}\n"],"mappings":"AAeA,SAAgB,UAAU,EAAuC,CAC/D,OAAO,OAAO,GAAQ,YAAY,GAAgB,OAAQ,EAA2B,MAAS,UAChG"}
@@ -1,2 +1,2 @@
1
- function e(e){return e instanceof RegExp}exports.isRegex=e;
1
+ function isRegex(e){return e instanceof RegExp}exports.isRegex=isRegex;
2
2
  //# sourceMappingURL=isRegex.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isRegex.cjs","names":[],"sources":["../../src/guards/isRegex.ts"],"sourcesContent":["/**\n * Checks if the provided argument is a regular expression.\n *\n * @example\n * ```ts\n * isRegex(/abc/); // true\n * isRegex(new RegExp('abc')); // true\n * isRegex('abc'); // false\n * isRegex(123); // false\n * isRegex({}); // false\n * isRegex([]); // false\n * isRegex(null); // false\n * isRegex(undefined); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @return `true` if the argument is a regular expression, otherwise `false`.\n */\nexport function isRegex(arg: unknown): arg is RegExp {\n return arg instanceof RegExp;\n}\n"],"mappings":"AAmBA,SAAgB,EAAQ,EAA6B,CACnD,OAAO,aAAe,MACxB"}
1
+ {"version":3,"file":"isRegex.cjs","names":[],"sources":["../../src/guards/isRegex.ts"],"sourcesContent":["/**\n * Checks if the provided argument is a regular expression.\n *\n * @example\n * ```ts\n * isRegex(/abc/); // true\n * isRegex(new RegExp('abc')); // true\n * isRegex('abc'); // false\n * isRegex(123); // false\n * isRegex({}); // false\n * isRegex([]); // false\n * isRegex(null); // false\n * isRegex(undefined); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @return `true` if the argument is a regular expression, otherwise `false`.\n */\nexport function isRegex(arg: unknown): arg is RegExp {\n return arg instanceof RegExp;\n}\n"],"mappings":"AAmBA,SAAgB,QAAQ,EAA6B,CACnD,OAAO,aAAe,MACxB"}
@@ -1,8 +1,2 @@
1
- //#region src/guards/isRegex.ts
2
- function e(e) {
3
- return e instanceof RegExp;
4
- }
5
- //#endregion
6
- export { e as isRegex };
7
-
1
+ function isRegex(e){return e instanceof RegExp}export{isRegex};
8
2
  //# sourceMappingURL=isRegex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isRegex.js","names":[],"sources":["../../src/guards/isRegex.ts"],"sourcesContent":["/**\n * Checks if the provided argument is a regular expression.\n *\n * @example\n * ```ts\n * isRegex(/abc/); // true\n * isRegex(new RegExp('abc')); // true\n * isRegex('abc'); // false\n * isRegex(123); // false\n * isRegex({}); // false\n * isRegex([]); // false\n * isRegex(null); // false\n * isRegex(undefined); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @return `true` if the argument is a regular expression, otherwise `false`.\n */\nexport function isRegex(arg: unknown): arg is RegExp {\n return arg instanceof RegExp;\n}\n"],"mappings":";AAmBA,SAAgB,EAAQ,GAA6B;CACnD,OAAO,aAAe;AACxB"}
1
+ {"version":3,"file":"isRegex.js","names":[],"sources":["../../src/guards/isRegex.ts"],"sourcesContent":["/**\n * Checks if the provided argument is a regular expression.\n *\n * @example\n * ```ts\n * isRegex(/abc/); // true\n * isRegex(new RegExp('abc')); // true\n * isRegex('abc'); // false\n * isRegex(123); // false\n * isRegex({}); // false\n * isRegex([]); // false\n * isRegex(null); // false\n * isRegex(undefined); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @return `true` if the argument is a regular expression, otherwise `false`.\n */\nexport function isRegex(arg: unknown): arg is RegExp {\n return arg instanceof RegExp;\n}\n"],"mappings":"AAmBA,SAAgB,QAAQ,EAA6B,CACnD,OAAO,aAAe,MACxB"}
@@ -1,2 +1,2 @@
1
- function e(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!=`object`||typeof t!=`object`)return!1;let n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;if(n&&r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}let i=Object.keys(e),a=t,o=e;if(i.length!==Object.keys(a).length)return!1;for(let e of i)if(!Object.hasOwn(a,e)||!Object.is(o[e],a[e]))return!1;return!0}exports.shallowEqual=e;
1
+ function shallowEqual(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!=`object`||typeof t!=`object`)return!1;let n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;if(n&&r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}let i=Object.keys(e),a=t,o=e;if(i.length!==Object.keys(a).length)return!1;for(let e of i)if(!Object.hasOwn(a,e)||!Object.is(o[e],a[e]))return!1;return!0}exports.shallowEqual=shallowEqual;
2
2
  //# sourceMappingURL=shallowEqual.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"shallowEqual.cjs","names":[],"sources":["../../src/guards/shallowEqual.ts"],"sourcesContent":["/**\n * Compares two values for shallow equality.\n *\n * - Primitives are compared with `Object.is`.\n * - Arrays are compared element-by-element with `Object.is` (one level deep).\n * - Objects are compared key-by-key with `Object.is` on each value (one level deep).\n * - Different types (e.g. array vs object) return `false`.\n *\n * Uses `Object.is` for the primitive comparison, so `shallowEqual(NaN, NaN)` is `true` and\n * `shallowEqual(0, -0)` is `false` — the opposite of `isEqual`, which uses `===` and treats\n * `NaN` as never equal to itself and `-0` as equal to `0`.\n *\n * For recursive deep equality, use `isEqual`.\n *\n * @example\n * ```ts\n * const inner = { x: 1 };\n * shallowEqual({ a: inner }, { a: inner }); // true — same reference\n * shallowEqual({ a: { x: 1 } }, { a: { x: 1 } }); // false — different refs\n * shallowEqual([1, 2, 3], [1, 2, 3]); // true\n * shallowEqual(1, 1); // true\n * ```\n *\n * @param a - First value.\n * @param b - Second value.\n * @returns `true` if the values are shallowly equal.\n */\nexport function shallowEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false;\n\n const isArrayA = Array.isArray(a);\n const isArrayB = Array.isArray(b);\n\n if (isArrayA !== isArrayB) return false;\n\n if (isArrayA && isArrayB) {\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n const aKeys = Object.keys(a as Record<string, unknown>);\n const bObj = b as Record<string, unknown>;\n const aObj = a as Record<string, unknown>;\n\n if (aKeys.length !== Object.keys(bObj).length) return false;\n\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || !Object.is(aObj[key], bObj[key])) return false;\n }\n\n return true;\n}\n"],"mappings":"AA2BA,SAAgB,EAAa,EAAY,EAAqB,CAC5D,GAAI,OAAO,GAAG,EAAG,CAAC,EAAG,MAAO,GAE5B,GAAI,IAAM,MAAQ,IAAM,MAAQ,OAAO,GAAM,UAAY,OAAO,GAAM,SAAU,MAAO,GAEvF,IAAM,EAAW,MAAM,QAAQ,CAAC,EAC1B,EAAW,MAAM,QAAQ,CAAC,EAEhC,GAAI,IAAa,EAAU,MAAO,GAElC,GAAI,GAAY,EAAU,CACxB,GAAI,EAAE,SAAW,EAAE,OAAQ,MAAO,GAElC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAE,OAAQ,IAC5B,GAAI,CAAC,OAAO,GAAG,EAAE,GAAI,EAAE,EAAE,EAAG,MAAO,GAGrC,MAAO,EACT,CAEA,IAAM,EAAQ,OAAO,KAAK,CAA4B,EAChD,EAAO,EACP,EAAO,EAEb,GAAI,EAAM,SAAW,OAAO,KAAK,CAAI,CAAC,CAAC,OAAQ,MAAO,GAEtD,IAAK,IAAM,KAAO,EAChB,GAAI,CAAC,OAAO,OAAO,EAAM,CAAG,GAAK,CAAC,OAAO,GAAG,EAAK,GAAM,EAAK,EAAI,EAAG,MAAO,GAG5E,MAAO,EACT"}
1
+ {"version":3,"file":"shallowEqual.cjs","names":[],"sources":["../../src/guards/shallowEqual.ts"],"sourcesContent":["/**\n * Compares two values for shallow equality.\n *\n * - Primitives are compared with `Object.is`.\n * - Arrays are compared element-by-element with `Object.is` (one level deep).\n * - Objects are compared key-by-key with `Object.is` on each value (one level deep).\n * - Different types (e.g. array vs object) return `false`.\n *\n * Uses `Object.is` for the primitive comparison, so `shallowEqual(NaN, NaN)` is `true` and\n * `shallowEqual(0, -0)` is `false` — the opposite of `isEqual`, which uses `===` and treats\n * `NaN` as never equal to itself and `-0` as equal to `0`.\n *\n * For recursive deep equality, use `isEqual`.\n *\n * @example\n * ```ts\n * const inner = { x: 1 };\n * shallowEqual({ a: inner }, { a: inner }); // true — same reference\n * shallowEqual({ a: { x: 1 } }, { a: { x: 1 } }); // false — different refs\n * shallowEqual([1, 2, 3], [1, 2, 3]); // true\n * shallowEqual(1, 1); // true\n * ```\n *\n * @param a - First value.\n * @param b - Second value.\n * @returns `true` if the values are shallowly equal.\n */\nexport function shallowEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false;\n\n const isArrayA = Array.isArray(a);\n const isArrayB = Array.isArray(b);\n\n if (isArrayA !== isArrayB) return false;\n\n if (isArrayA && isArrayB) {\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n const aKeys = Object.keys(a as Record<string, unknown>);\n const bObj = b as Record<string, unknown>;\n const aObj = a as Record<string, unknown>;\n\n if (aKeys.length !== Object.keys(bObj).length) return false;\n\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || !Object.is(aObj[key], bObj[key])) return false;\n }\n\n return true;\n}\n"],"mappings":"AA2BA,SAAgB,aAAa,EAAY,EAAqB,CAC5D,GAAI,OAAO,GAAG,EAAG,CAAC,EAAG,MAAO,GAE5B,GAAI,IAAM,MAAQ,IAAM,MAAQ,OAAO,GAAM,UAAY,OAAO,GAAM,SAAU,MAAO,GAEvF,IAAM,EAAW,MAAM,QAAQ,CAAC,EAC1B,EAAW,MAAM,QAAQ,CAAC,EAEhC,GAAI,IAAa,EAAU,MAAO,GAElC,GAAI,GAAY,EAAU,CACxB,GAAI,EAAE,SAAW,EAAE,OAAQ,MAAO,GAElC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAE,OAAQ,IAC5B,GAAI,CAAC,OAAO,GAAG,EAAE,GAAI,EAAE,EAAE,EAAG,MAAO,GAGrC,MAAO,EACT,CAEA,IAAM,EAAQ,OAAO,KAAK,CAA4B,EAChD,EAAO,EACP,EAAO,EAEb,GAAI,EAAM,SAAW,OAAO,KAAK,CAAI,CAAC,CAAC,OAAQ,MAAO,GAEtD,IAAK,IAAM,KAAO,EAChB,GAAI,CAAC,OAAO,OAAO,EAAM,CAAG,GAAK,CAAC,OAAO,GAAG,EAAK,GAAM,EAAK,EAAI,EAAG,MAAO,GAG5E,MAAO,EACT"}
@@ -1,20 +1,2 @@
1
- //#region src/guards/shallowEqual.ts
2
- function e(e, t) {
3
- if (Object.is(e, t)) return !0;
4
- if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
5
- let n = Array.isArray(e), r = Array.isArray(t);
6
- if (n !== r) return !1;
7
- if (n && r) {
8
- if (e.length !== t.length) return !1;
9
- for (let n = 0; n < e.length; n++) if (!Object.is(e[n], t[n])) return !1;
10
- return !0;
11
- }
12
- let i = Object.keys(e), a = t, o = e;
13
- if (i.length !== Object.keys(a).length) return !1;
14
- for (let e of i) if (!Object.hasOwn(a, e) || !Object.is(o[e], a[e])) return !1;
15
- return !0;
16
- }
17
- //#endregion
18
- export { e as shallowEqual };
19
-
1
+ function shallowEqual(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!=`object`||typeof t!=`object`)return!1;let n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;if(n&&r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}let i=Object.keys(e),a=t,o=e;if(i.length!==Object.keys(a).length)return!1;for(let e of i)if(!Object.hasOwn(a,e)||!Object.is(o[e],a[e]))return!1;return!0}export{shallowEqual};
20
2
  //# sourceMappingURL=shallowEqual.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shallowEqual.js","names":[],"sources":["../../src/guards/shallowEqual.ts"],"sourcesContent":["/**\n * Compares two values for shallow equality.\n *\n * - Primitives are compared with `Object.is`.\n * - Arrays are compared element-by-element with `Object.is` (one level deep).\n * - Objects are compared key-by-key with `Object.is` on each value (one level deep).\n * - Different types (e.g. array vs object) return `false`.\n *\n * Uses `Object.is` for the primitive comparison, so `shallowEqual(NaN, NaN)` is `true` and\n * `shallowEqual(0, -0)` is `false` — the opposite of `isEqual`, which uses `===` and treats\n * `NaN` as never equal to itself and `-0` as equal to `0`.\n *\n * For recursive deep equality, use `isEqual`.\n *\n * @example\n * ```ts\n * const inner = { x: 1 };\n * shallowEqual({ a: inner }, { a: inner }); // true — same reference\n * shallowEqual({ a: { x: 1 } }, { a: { x: 1 } }); // false — different refs\n * shallowEqual([1, 2, 3], [1, 2, 3]); // true\n * shallowEqual(1, 1); // true\n * ```\n *\n * @param a - First value.\n * @param b - Second value.\n * @returns `true` if the values are shallowly equal.\n */\nexport function shallowEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false;\n\n const isArrayA = Array.isArray(a);\n const isArrayB = Array.isArray(b);\n\n if (isArrayA !== isArrayB) return false;\n\n if (isArrayA && isArrayB) {\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n const aKeys = Object.keys(a as Record<string, unknown>);\n const bObj = b as Record<string, unknown>;\n const aObj = a as Record<string, unknown>;\n\n if (aKeys.length !== Object.keys(bObj).length) return false;\n\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || !Object.is(aObj[key], bObj[key])) return false;\n }\n\n return true;\n}\n"],"mappings":";AA2BA,SAAgB,EAAa,GAAY,GAAqB;CAC5D,IAAI,OAAO,GAAG,GAAG,CAAC,GAAG,OAAO;CAE5B,IAAI,MAAM,QAAQ,MAAM,QAAQ,OAAO,KAAM,YAAY,OAAO,KAAM,UAAU,OAAO;CAEvF,IAAM,IAAW,MAAM,QAAQ,CAAC,GAC1B,IAAW,MAAM,QAAQ,CAAC;CAEhC,IAAI,MAAa,GAAU,OAAO;CAElC,IAAI,KAAY,GAAU;EACxB,IAAI,EAAE,WAAW,EAAE,QAAQ,OAAO;EAElC,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAC5B,IAAI,CAAC,OAAO,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO;EAGrC,OAAO;CACT;CAEA,IAAM,IAAQ,OAAO,KAAK,CAA4B,GAChD,IAAO,GACP,IAAO;CAEb,IAAI,EAAM,WAAW,OAAO,KAAK,CAAI,CAAC,CAAC,QAAQ,OAAO;CAEtD,KAAK,IAAM,KAAO,GAChB,IAAI,CAAC,OAAO,OAAO,GAAM,CAAG,KAAK,CAAC,OAAO,GAAG,EAAK,IAAM,EAAK,EAAI,GAAG,OAAO;CAG5E,OAAO;AACT"}
1
+ {"version":3,"file":"shallowEqual.js","names":[],"sources":["../../src/guards/shallowEqual.ts"],"sourcesContent":["/**\n * Compares two values for shallow equality.\n *\n * - Primitives are compared with `Object.is`.\n * - Arrays are compared element-by-element with `Object.is` (one level deep).\n * - Objects are compared key-by-key with `Object.is` on each value (one level deep).\n * - Different types (e.g. array vs object) return `false`.\n *\n * Uses `Object.is` for the primitive comparison, so `shallowEqual(NaN, NaN)` is `true` and\n * `shallowEqual(0, -0)` is `false` — the opposite of `isEqual`, which uses `===` and treats\n * `NaN` as never equal to itself and `-0` as equal to `0`.\n *\n * For recursive deep equality, use `isEqual`.\n *\n * @example\n * ```ts\n * const inner = { x: 1 };\n * shallowEqual({ a: inner }, { a: inner }); // true — same reference\n * shallowEqual({ a: { x: 1 } }, { a: { x: 1 } }); // false — different refs\n * shallowEqual([1, 2, 3], [1, 2, 3]); // true\n * shallowEqual(1, 1); // true\n * ```\n *\n * @param a - First value.\n * @param b - Second value.\n * @returns `true` if the values are shallowly equal.\n */\nexport function shallowEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n\n if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false;\n\n const isArrayA = Array.isArray(a);\n const isArrayB = Array.isArray(b);\n\n if (isArrayA !== isArrayB) return false;\n\n if (isArrayA && isArrayB) {\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n const aKeys = Object.keys(a as Record<string, unknown>);\n const bObj = b as Record<string, unknown>;\n const aObj = a as Record<string, unknown>;\n\n if (aKeys.length !== Object.keys(bObj).length) return false;\n\n for (const key of aKeys) {\n if (!Object.hasOwn(bObj, key) || !Object.is(aObj[key], bObj[key])) return false;\n }\n\n return true;\n}\n"],"mappings":"AA2BA,SAAgB,aAAa,EAAY,EAAqB,CAC5D,GAAI,OAAO,GAAG,EAAG,CAAC,EAAG,MAAO,GAE5B,GAAI,IAAM,MAAQ,IAAM,MAAQ,OAAO,GAAM,UAAY,OAAO,GAAM,SAAU,MAAO,GAEvF,IAAM,EAAW,MAAM,QAAQ,CAAC,EAC1B,EAAW,MAAM,QAAQ,CAAC,EAEhC,GAAI,IAAa,EAAU,MAAO,GAElC,GAAI,GAAY,EAAU,CACxB,GAAI,EAAE,SAAW,EAAE,OAAQ,MAAO,GAElC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAE,OAAQ,IAC5B,GAAI,CAAC,OAAO,GAAG,EAAE,GAAI,EAAE,EAAE,EAAG,MAAO,GAGrC,MAAO,EACT,CAEA,IAAM,EAAQ,OAAO,KAAK,CAA4B,EAChD,EAAO,EACP,EAAO,EAEb,GAAI,EAAM,SAAW,OAAO,KAAK,CAAI,CAAC,CAAC,OAAQ,MAAO,GAEtD,IAAK,IAAM,KAAO,EAChB,GAAI,CAAC,OAAO,OAAO,EAAM,CAAG,GAAK,CAAC,OAAO,GAAG,EAAK,GAAM,EAAK,EAAI,EAAG,MAAO,GAG5E,MAAO,EACT"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./array/chunk.cjs"),t=require("./guards/isEqual.cjs"),n=require("./array/filterMap.cjs"),r=require("./array/groupBy.cjs"),i=require("./array/indexBy.cjs"),a=require("./array/partition.cjs"),o=require("./array/sort.cjs"),s=require("./array/uniq.cjs"),c=require("./async/abortError.cjs"),l=require("./async/abortable.cjs"),u=require("./async/attempt.cjs"),d=require("./async/backoff.cjs"),f=require("./async/parallel.cjs"),p=require("./async/sleep.cjs"),m=require("./async/retry.cjs"),h=require("./errors.cjs"),g=require("./function/debounce.cjs"),_=require("./function/once.cjs"),v=require("./function/pipe.cjs"),y=require("./function/throttle.cjs"),b=require("./guards/combinators.cjs"),x=require("./guards/isDefined.cjs"),S=require("./guards/isPlainObject.cjs"),C=require("./guards/isNil.cjs"),w=require("./math/allocate.cjs"),T=require("./math/clamp.cjs"),E=require("./math/range.cjs"),D=require("./object/getPath.cjs"),O=require("./object/hash.cjs"),k=require("./object/omit.cjs"),A=require("./object/pick.cjs"),j=require("./random/source.cjs"),M=require("./random/random.cjs"),N=require("./string/camelCase.cjs");exports.ArsenalError=h.ArsenalError,exports.ArsenalSerializationError=h.ArsenalSerializationError,exports.abortError=c.abortError,exports.abortable=l.abortable,exports.allOf=b.allOf,exports.allocate=w.allocate,exports.anyOf=b.anyOf,exports.attempt=u.attempt,exports.backoff=d.backoff,exports.camelCase=N.camelCase,exports.chunk=e.chunk,exports.clamp=T.clamp,exports.debounce=g.debounce,exports.filterMap=n.filterMap,exports.getPath=D.getPath,exports.getPathOr=D.getPathOr,exports.groupBy=r.groupBy,exports.hash=O.hash,exports.indexBy=i.indexBy,exports.isDefined=x.isDefined,exports.isEqual=t.isEqual,exports.isFail=u.isFail,exports.isNil=C.isNil,exports.isOk=u.isOk,exports.isPlainObject=S.isPlainObject,exports.noneOf=b.noneOf,exports.not=b.not,exports.omit=k.omit,exports.once=_.once,exports.parallel=f.parallel,exports.partition=a.partition,exports.pick=A.pick,exports.pipe=v.pipe,exports.random=M.random,exports.randomFloat=j.randomFloat,exports.range=E.range,exports.requirePath=D.requirePath,exports.retry=m.retry,exports.sleep=p.sleep,exports.sort=o.sort,exports.throttle=y.throttle,exports.uniq=s.uniq;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./array/chunk.cjs"),t=require("./guards/isEqual.cjs"),n=require("./array/filterMap.cjs"),r=require("./array/groupBy.cjs"),i=require("./array/indexBy.cjs"),a=require("./array/partition.cjs"),o=require("./array/sort.cjs"),s=require("./array/uniq.cjs"),c=require("./async/abortError.cjs"),l=require("./async/abortable.cjs"),u=require("./async/attempt.cjs"),d=require("./async/backoff.cjs"),f=require("./async/parallel.cjs"),p=require("./async/sleep.cjs"),m=require("./async/retry.cjs"),h=require("./async/taskPool.cjs"),g=require("./async/waitFor.cjs"),_=require("./cache/cache.cjs"),v=require("./errors.cjs"),y=require("./cache/memo.cjs"),b=require("./encoding/base64url.cjs"),x=require("./function/debounce.cjs"),S=require("./function/once.cjs"),C=require("./function/pipe.cjs"),w=require("./function/tapper.cjs"),T=require("./function/throttle.cjs"),E=require("./guards/combinators.cjs"),D=require("./guards/isDefined.cjs"),O=require("./guards/isPlainObject.cjs"),k=require("./guards/isNil.cjs"),A=require("./math/allocate.cjs"),j=require("./math/clamp.cjs"),M=require("./math/range.cjs"),N=require("./object/getPath.cjs"),P=require("./object/hash.cjs"),F=require("./object/omit.cjs"),I=require("./object/pick.cjs"),L=require("./random/source.cjs"),R=require("./random/random.cjs"),z=require("./string/camelCase.cjs");exports.ArsenalError=v.ArsenalError,exports.ArsenalSerializationError=v.ArsenalSerializationError,exports.abortError=c.abortError,exports.abortable=l.abortable,exports.allOf=E.allOf,exports.allocate=A.allocate,exports.anyOf=E.anyOf,exports.attempt=u.attempt,exports.backoff=d.backoff,exports.base64UrlToBytes=b.base64UrlToBytes,exports.base64UrlToText=b.base64UrlToText,exports.bytesToBase64Url=b.bytesToBase64Url,exports.cache=_.cache,exports.camelCase=z.camelCase,exports.chunk=e.chunk,exports.clamp=j.clamp,exports.debounce=x.debounce,exports.filterMap=n.filterMap,exports.getPath=N.getPath,exports.getPathOr=N.getPathOr,exports.groupBy=r.groupBy,exports.hash=P.hash,exports.indexBy=i.indexBy,exports.isDefined=D.isDefined,exports.isEqual=t.isEqual,exports.isFail=u.isFail,exports.isNil=k.isNil,exports.isOk=u.isOk,exports.isPlainObject=O.isPlainObject,exports.memo=y.memo,exports.noneOf=E.noneOf,exports.not=E.not,exports.omit=F.omit,exports.once=S.once,exports.parallel=f.parallel,exports.partition=a.partition,exports.pick=I.pick,exports.pipe=C.pipe,exports.random=R.random,exports.randomFloat=L.randomFloat,exports.range=M.range,exports.requirePath=N.requirePath,exports.retry=m.retry,exports.sleep=p.sleep,exports.sort=o.sort,exports.tapper=w.tapper,exports.taskPool=h.taskPool,exports.textToBase64Url=b.textToBase64Url,exports.throttle=T.throttle,exports.uniq=s.uniq,exports.utf8Bytes=b.utf8Bytes,exports.waitFor=g.waitFor;
package/dist/index.d.ts CHANGED
@@ -12,10 +12,16 @@ export * from './async/backoff';
12
12
  export * from './async/parallel';
13
13
  export * from './async/retry';
14
14
  export * from './async/sleep';
15
+ export * from './async/taskPool';
16
+ export * from './async/waitFor';
17
+ export * from './cache/cache';
18
+ export * from './cache/memo';
19
+ export * from './encoding/base64url';
15
20
  export * from './errors';
16
21
  export * from './function/debounce';
17
22
  export * from './function/once';
18
23
  export * from './function/pipe';
24
+ export * from './function/tapper';
19
25
  export * from './function/throttle';
20
26
  export * from './guards/combinators';
21
27
  export * from './guards/isDefined';
@@ -32,4 +38,5 @@ export * from './object/pick';
32
38
  export * from './random/random';
33
39
  export * from './random/source';
34
40
  export * from './string/camelCase';
41
+ export * from './types';
35
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,35 +1 @@
1
- import { chunk as e } from "./array/chunk.js";
2
- import { isEqual as t } from "./guards/isEqual.js";
3
- import { filterMap as n } from "./array/filterMap.js";
4
- import { groupBy as r } from "./array/groupBy.js";
5
- import { indexBy as i } from "./array/indexBy.js";
6
- import { partition as a } from "./array/partition.js";
7
- import { sort as o } from "./array/sort.js";
8
- import { uniq as s } from "./array/uniq.js";
9
- import { abortError as c } from "./async/abortError.js";
10
- import { abortable as l } from "./async/abortable.js";
11
- import { attempt as u, isFail as d, isOk as f } from "./async/attempt.js";
12
- import { backoff as p } from "./async/backoff.js";
13
- import { parallel as m } from "./async/parallel.js";
14
- import { sleep as h } from "./async/sleep.js";
15
- import { retry as g } from "./async/retry.js";
16
- import { ArsenalError as _, ArsenalSerializationError as v } from "./errors.js";
17
- import { debounce as y } from "./function/debounce.js";
18
- import { once as b } from "./function/once.js";
19
- import { pipe as x } from "./function/pipe.js";
20
- import { throttle as S } from "./function/throttle.js";
21
- import { allOf as C, anyOf as w, noneOf as T, not as E } from "./guards/combinators.js";
22
- import { isDefined as D } from "./guards/isDefined.js";
23
- import { isPlainObject as O } from "./guards/isPlainObject.js";
24
- import { isNil as k } from "./guards/isNil.js";
25
- import { allocate as A } from "./math/allocate.js";
26
- import { clamp as j } from "./math/clamp.js";
27
- import { range as M } from "./math/range.js";
28
- import { getPath as N, getPathOr as P, requirePath as F } from "./object/getPath.js";
29
- import { hash as I } from "./object/hash.js";
30
- import { omit as L } from "./object/omit.js";
31
- import { pick as R } from "./object/pick.js";
32
- import { randomFloat as z } from "./random/source.js";
33
- import { random as B } from "./random/random.js";
34
- import { camelCase as V } from "./string/camelCase.js";
35
- export { _ as ArsenalError, v as ArsenalSerializationError, c as abortError, l as abortable, C as allOf, A as allocate, w as anyOf, u as attempt, p as backoff, V as camelCase, e as chunk, j as clamp, y as debounce, n as filterMap, N as getPath, P as getPathOr, r as groupBy, I as hash, i as indexBy, D as isDefined, t as isEqual, d as isFail, k as isNil, f as isOk, O as isPlainObject, T as noneOf, E as not, L as omit, b as once, m as parallel, a as partition, R as pick, x as pipe, B as random, z as randomFloat, M as range, F as requirePath, g as retry, h as sleep, o as sort, S as throttle, s as uniq };
1
+ import{chunk as e}from"./array/chunk.js";import{isEqual as t}from"./guards/isEqual.js";import{filterMap as n}from"./array/filterMap.js";import{groupBy as r}from"./array/groupBy.js";import{indexBy as i}from"./array/indexBy.js";import{partition as a}from"./array/partition.js";import{sort as o}from"./array/sort.js";import{uniq as s}from"./array/uniq.js";import{abortError as c}from"./async/abortError.js";import{abortable as l}from"./async/abortable.js";import{attempt as u,isFail as d,isOk as f}from"./async/attempt.js";import{backoff as p}from"./async/backoff.js";import{parallel as m}from"./async/parallel.js";import{sleep as h}from"./async/sleep.js";import{retry as g}from"./async/retry.js";import{taskPool as _}from"./async/taskPool.js";import{waitFor as v}from"./async/waitFor.js";import{cache as y}from"./cache/cache.js";import{ArsenalError as b,ArsenalSerializationError as x}from"./errors.js";import{memo as S}from"./cache/memo.js";import{base64UrlToBytes as C,base64UrlToText as w,bytesToBase64Url as T,textToBase64Url as E,utf8Bytes as D}from"./encoding/base64url.js";import{debounce as O}from"./function/debounce.js";import{once as k}from"./function/once.js";import{pipe as A}from"./function/pipe.js";import{tapper as j}from"./function/tapper.js";import{throttle as M}from"./function/throttle.js";import{allOf as N,anyOf as P,noneOf as F,not as I}from"./guards/combinators.js";import{isDefined as L}from"./guards/isDefined.js";import{isPlainObject as R}from"./guards/isPlainObject.js";import{isNil as z}from"./guards/isNil.js";import{allocate as B}from"./math/allocate.js";import{clamp as V}from"./math/clamp.js";import{range as H}from"./math/range.js";import{getPath as U,getPathOr as W,requirePath as G}from"./object/getPath.js";import{hash as K}from"./object/hash.js";import{omit as q}from"./object/omit.js";import{pick as J}from"./object/pick.js";import{randomFloat as Y}from"./random/source.js";import{random as X}from"./random/random.js";import{camelCase as Z}from"./string/camelCase.js";export{b as ArsenalError,x as ArsenalSerializationError,c as abortError,l as abortable,N as allOf,B as allocate,P as anyOf,u as attempt,p as backoff,C as base64UrlToBytes,w as base64UrlToText,T as bytesToBase64Url,y as cache,Z as camelCase,e as chunk,V as clamp,O as debounce,n as filterMap,U as getPath,W as getPathOr,r as groupBy,K as hash,i as indexBy,L as isDefined,t as isEqual,d as isFail,z as isNil,f as isOk,R as isPlainObject,S as memo,F as noneOf,I as not,q as omit,k as once,m as parallel,a as partition,J as pick,A as pipe,X as random,Y as randomFloat,H as range,G as requirePath,g as retry,h as sleep,o as sort,j as tapper,_ as taskPool,E as textToBase64Url,M as throttle,s as uniq,D as utf8Bytes,v as waitFor};
@@ -1,2 +1,2 @@
1
- function e(e,t){if(typeof t==`number`&&(!Number.isInteger(t)||t<1))throw RangeError(`allocate: parts must be a positive integer, got ${t}`);let n=Array.isArray(t)?t:Array(t).fill(1);if(n.length===0)throw RangeError(`Ratios array cannot be empty`);if(n.some(e=>e<0))throw RangeError(`Ratios must be non-negative`);let r=n.reduce((e,t)=>e+t,0);if(r===0)throw RangeError(`Total ratio cannot be zero`);if(typeof e==`bigint`){let t=BigInt(r),i=Array.from({length:n.length-1},(r,i)=>e*BigInt(n[i])/t);return i.push(e-i.reduce((e,t)=>e+t,0n)),i}let i=Array.from({length:n.length-1},(t,i)=>Math.floor(e*n[i]/r));return i.push(e-i.reduce((e,t)=>e+t,0)),i}exports.allocate=e;
1
+ function allocate(e,t){if(typeof t==`number`&&(!Number.isInteger(t)||t<1))throw RangeError(`allocate: parts must be a positive integer, got ${t}`);let n=Array.isArray(t)?t:Array(t).fill(1);if(n.length===0)throw RangeError(`Ratios array cannot be empty`);if(n.some(e=>e<0))throw RangeError(`Ratios must be non-negative`);let r=n.reduce((e,t)=>e+t,0);if(r===0)throw RangeError(`Total ratio cannot be zero`);if(typeof e==`bigint`){let t=BigInt(r),i=Array.from({length:n.length-1},(r,i)=>e*BigInt(n[i])/t);return i.push(e-i.reduce((e,t)=>e+t,0n)),i}let i=Array.from({length:n.length-1},(t,i)=>Math.floor(e*n[i]/r));return i.push(e-i.reduce((e,t)=>e+t,0)),i}exports.allocate=allocate;
2
2
  //# sourceMappingURL=allocate.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"allocate.cjs","names":[],"sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * The indivisible remainder is allocated to the last bucket.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3 (total ratio = 6)\n * allocate(100, [1, 2, 3]);\n * // [16, 33, 51] - sum is exactly 100\n *\n * // Split $100 evenly among 3 parts\n * allocate(100, 3);\n * // [33, 33, 34] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3333n, 3333n, 3334n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution or number of equal parts\n * @returns Array of allocated amounts with remainder applied to last bucket (sum equals original amount)\n * @throws {RangeError} If ratios array is empty, contains negative values, sums to zero, or parts is not a positive integer.\n */\nexport function allocate(amount: number, ratios: number[] | number): number[];\nexport function allocate(amount: bigint, ratios: number[] | number): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[] | number): (number | bigint)[] {\n // If second param is a number, validate and treat it as number of equal parts\n if (typeof ratios === 'number') {\n if (!Number.isInteger(ratios) || ratios < 1) {\n throw new RangeError(`allocate: parts must be a positive integer, got ${ratios}`);\n }\n }\n\n const actualRatios = Array.isArray(ratios) ? ratios : Array(ratios).fill(1);\n\n if (actualRatios.length === 0) {\n throw new RangeError('Ratios array cannot be empty');\n }\n\n if (actualRatios.some((r) => r < 0)) {\n throw new RangeError('Ratios must be non-negative');\n }\n\n const totalRatio = actualRatios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new RangeError('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const totalRatioBigInt = BigInt(totalRatio);\n const results = Array.from(\n { length: actualRatios.length - 1 },\n (_, i) => (amount * BigInt(actualRatios[i])) / totalRatioBigInt,\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0n));\n\n return results;\n }\n\n // For number type, use proportional allocation for all ratios uniformly\n const results = Array.from({ length: actualRatios.length - 1 }, (_, i) =>\n Math.floor((amount * actualRatios[i]) / totalRatio),\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0));\n\n return results;\n}\n"],"mappings":"AA4BA,SAAgB,EAAS,EAAyB,EAAgD,CAEhG,GAAI,OAAO,GAAW,WAChB,CAAC,OAAO,UAAU,CAAM,GAAK,EAAS,GACxC,MAAU,WAAW,mDAAmD,GAAQ,EAIpF,IAAM,EAAe,MAAM,QAAQ,CAAM,EAAI,EAAS,MAAM,CAAM,CAAC,CAAC,KAAK,CAAC,EAE1E,GAAI,EAAa,SAAW,EAC1B,MAAU,WAAW,8BAA8B,EAGrD,GAAI,EAAa,KAAM,GAAM,EAAI,CAAC,EAChC,MAAU,WAAW,6BAA6B,EAGpD,IAAM,EAAa,EAAa,QAAQ,EAAK,IAAU,EAAM,EAAO,CAAC,EAErE,GAAI,IAAe,EACjB,MAAU,WAAW,4BAA4B,EAGnD,GAAI,OAAO,GAAW,SAAU,CAC9B,IAAM,EAAmB,OAAO,CAAU,EACpC,EAAU,MAAM,KACpB,CAAE,OAAQ,EAAa,OAAS,CAAE,GACjC,EAAG,IAAO,EAAS,OAAO,EAAa,EAAE,EAAK,CACjD,EAIA,OAFA,EAAQ,KAAK,EAAS,EAAQ,QAAQ,EAAG,IAAM,EAAI,EAAG,EAAE,CAAC,EAElD,CACT,CAGA,IAAM,EAAU,MAAM,KAAK,CAAE,OAAQ,EAAa,OAAS,CAAE,GAAI,EAAG,IAClE,KAAK,MAAO,EAAS,EAAa,GAAM,CAAU,CACpD,EAIA,OAFA,EAAQ,KAAK,EAAS,EAAQ,QAAQ,EAAG,IAAM,EAAI,EAAG,CAAC,CAAC,EAEjD,CACT"}
1
+ {"version":3,"file":"allocate.cjs","names":[],"sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * The indivisible remainder is allocated to the last bucket.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3 (total ratio = 6)\n * allocate(100, [1, 2, 3]);\n * // [16, 33, 51] - sum is exactly 100\n *\n * // Split $100 evenly among 3 parts\n * allocate(100, 3);\n * // [33, 33, 34] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3333n, 3333n, 3334n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution or number of equal parts\n * @returns Array of allocated amounts with remainder applied to last bucket (sum equals original amount)\n * @throws {RangeError} If ratios array is empty, contains negative values, sums to zero, or parts is not a positive integer.\n */\nexport function allocate(amount: number, ratios: number[] | number): number[];\nexport function allocate(amount: bigint, ratios: number[] | number): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[] | number): (number | bigint)[] {\n // If second param is a number, validate and treat it as number of equal parts\n if (typeof ratios === 'number') {\n if (!Number.isInteger(ratios) || ratios < 1) {\n throw new RangeError(`allocate: parts must be a positive integer, got ${ratios}`);\n }\n }\n\n const actualRatios = Array.isArray(ratios) ? ratios : Array(ratios).fill(1);\n\n if (actualRatios.length === 0) {\n throw new RangeError('Ratios array cannot be empty');\n }\n\n if (actualRatios.some((r) => r < 0)) {\n throw new RangeError('Ratios must be non-negative');\n }\n\n const totalRatio = actualRatios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new RangeError('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const totalRatioBigInt = BigInt(totalRatio);\n const results = Array.from(\n { length: actualRatios.length - 1 },\n (_, i) => (amount * BigInt(actualRatios[i])) / totalRatioBigInt,\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0n));\n\n return results;\n }\n\n // For number type, use proportional allocation for all ratios uniformly\n const results = Array.from({ length: actualRatios.length - 1 }, (_, i) =>\n Math.floor((amount * actualRatios[i]) / totalRatio),\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0));\n\n return results;\n}\n"],"mappings":"AA4BA,SAAgB,SAAS,EAAyB,EAAgD,CAEhG,GAAI,OAAO,GAAW,WAChB,CAAC,OAAO,UAAU,CAAM,GAAK,EAAS,GACxC,MAAU,WAAW,mDAAmD,GAAQ,EAIpF,IAAM,EAAe,MAAM,QAAQ,CAAM,EAAI,EAAS,MAAM,CAAM,CAAC,CAAC,KAAK,CAAC,EAE1E,GAAI,EAAa,SAAW,EAC1B,MAAU,WAAW,8BAA8B,EAGrD,GAAI,EAAa,KAAM,GAAM,EAAI,CAAC,EAChC,MAAU,WAAW,6BAA6B,EAGpD,IAAM,EAAa,EAAa,QAAQ,EAAK,IAAU,EAAM,EAAO,CAAC,EAErE,GAAI,IAAe,EACjB,MAAU,WAAW,4BAA4B,EAGnD,GAAI,OAAO,GAAW,SAAU,CAC9B,IAAM,EAAmB,OAAO,CAAU,EACpC,EAAU,MAAM,KACpB,CAAE,OAAQ,EAAa,OAAS,CAAE,GACjC,EAAG,IAAO,EAAS,OAAO,EAAa,EAAE,EAAK,CACjD,EAIA,OAFA,EAAQ,KAAK,EAAS,EAAQ,QAAQ,EAAG,IAAM,EAAI,EAAG,EAAE,CAAC,EAElD,CACT,CAGA,IAAM,EAAU,MAAM,KAAK,CAAE,OAAQ,EAAa,OAAS,CAAE,GAAI,EAAG,IAClE,KAAK,MAAO,EAAS,EAAa,GAAM,CAAU,CACpD,EAIA,OAFA,EAAQ,KAAK,EAAS,EAAQ,QAAQ,EAAG,IAAM,EAAI,EAAG,CAAC,CAAC,EAEjD,CACT"}
@@ -1,19 +1,2 @@
1
- //#region src/math/allocate.ts
2
- function e(e, t) {
3
- if (typeof t == "number" && (!Number.isInteger(t) || t < 1)) throw RangeError(`allocate: parts must be a positive integer, got ${t}`);
4
- let n = Array.isArray(t) ? t : Array(t).fill(1);
5
- if (n.length === 0) throw RangeError("Ratios array cannot be empty");
6
- if (n.some((e) => e < 0)) throw RangeError("Ratios must be non-negative");
7
- let r = n.reduce((e, t) => e + t, 0);
8
- if (r === 0) throw RangeError("Total ratio cannot be zero");
9
- if (typeof e == "bigint") {
10
- let t = BigInt(r), i = Array.from({ length: n.length - 1 }, (r, i) => e * BigInt(n[i]) / t);
11
- return i.push(e - i.reduce((e, t) => e + t, 0n)), i;
12
- }
13
- let i = Array.from({ length: n.length - 1 }, (t, i) => Math.floor(e * n[i] / r));
14
- return i.push(e - i.reduce((e, t) => e + t, 0)), i;
15
- }
16
- //#endregion
17
- export { e as allocate };
18
-
1
+ function allocate(e,t){if(typeof t==`number`&&(!Number.isInteger(t)||t<1))throw RangeError(`allocate: parts must be a positive integer, got ${t}`);let n=Array.isArray(t)?t:Array(t).fill(1);if(n.length===0)throw RangeError(`Ratios array cannot be empty`);if(n.some(e=>e<0))throw RangeError(`Ratios must be non-negative`);let r=n.reduce((e,t)=>e+t,0);if(r===0)throw RangeError(`Total ratio cannot be zero`);if(typeof e==`bigint`){let t=BigInt(r),i=Array.from({length:n.length-1},(r,i)=>e*BigInt(n[i])/t);return i.push(e-i.reduce((e,t)=>e+t,0n)),i}let i=Array.from({length:n.length-1},(t,i)=>Math.floor(e*n[i]/r));return i.push(e-i.reduce((e,t)=>e+t,0)),i}export{allocate};
19
2
  //# sourceMappingURL=allocate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"allocate.js","names":[],"sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * The indivisible remainder is allocated to the last bucket.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3 (total ratio = 6)\n * allocate(100, [1, 2, 3]);\n * // [16, 33, 51] - sum is exactly 100\n *\n * // Split $100 evenly among 3 parts\n * allocate(100, 3);\n * // [33, 33, 34] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3333n, 3333n, 3334n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution or number of equal parts\n * @returns Array of allocated amounts with remainder applied to last bucket (sum equals original amount)\n * @throws {RangeError} If ratios array is empty, contains negative values, sums to zero, or parts is not a positive integer.\n */\nexport function allocate(amount: number, ratios: number[] | number): number[];\nexport function allocate(amount: bigint, ratios: number[] | number): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[] | number): (number | bigint)[] {\n // If second param is a number, validate and treat it as number of equal parts\n if (typeof ratios === 'number') {\n if (!Number.isInteger(ratios) || ratios < 1) {\n throw new RangeError(`allocate: parts must be a positive integer, got ${ratios}`);\n }\n }\n\n const actualRatios = Array.isArray(ratios) ? ratios : Array(ratios).fill(1);\n\n if (actualRatios.length === 0) {\n throw new RangeError('Ratios array cannot be empty');\n }\n\n if (actualRatios.some((r) => r < 0)) {\n throw new RangeError('Ratios must be non-negative');\n }\n\n const totalRatio = actualRatios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new RangeError('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const totalRatioBigInt = BigInt(totalRatio);\n const results = Array.from(\n { length: actualRatios.length - 1 },\n (_, i) => (amount * BigInt(actualRatios[i])) / totalRatioBigInt,\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0n));\n\n return results;\n }\n\n // For number type, use proportional allocation for all ratios uniformly\n const results = Array.from({ length: actualRatios.length - 1 }, (_, i) =>\n Math.floor((amount * actualRatios[i]) / totalRatio),\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0));\n\n return results;\n}\n"],"mappings":";AA4BA,SAAgB,EAAS,GAAyB,GAAgD;CAEhG,IAAI,OAAO,KAAW,aAChB,CAAC,OAAO,UAAU,CAAM,KAAK,IAAS,IACxC,MAAU,WAAW,mDAAmD,GAAQ;CAIpF,IAAM,IAAe,MAAM,QAAQ,CAAM,IAAI,IAAS,MAAM,CAAM,CAAC,CAAC,KAAK,CAAC;CAE1E,IAAI,EAAa,WAAW,GAC1B,MAAU,WAAW,8BAA8B;CAGrD,IAAI,EAAa,MAAM,MAAM,IAAI,CAAC,GAChC,MAAU,WAAW,6BAA6B;CAGpD,IAAM,IAAa,EAAa,QAAQ,GAAK,MAAU,IAAM,GAAO,CAAC;CAErE,IAAI,MAAe,GACjB,MAAU,WAAW,4BAA4B;CAGnD,IAAI,OAAO,KAAW,UAAU;EAC9B,IAAM,IAAmB,OAAO,CAAU,GACpC,IAAU,MAAM,KACpB,EAAE,QAAQ,EAAa,SAAS,EAAE,IACjC,GAAG,MAAO,IAAS,OAAO,EAAa,EAAE,IAAK,CACjD;EAIA,OAFA,EAAQ,KAAK,IAAS,EAAQ,QAAQ,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,GAElD;CACT;CAGA,IAAM,IAAU,MAAM,KAAK,EAAE,QAAQ,EAAa,SAAS,EAAE,IAAI,GAAG,MAClE,KAAK,MAAO,IAAS,EAAa,KAAM,CAAU,CACpD;CAIA,OAFA,EAAQ,KAAK,IAAS,EAAQ,QAAQ,GAAG,MAAM,IAAI,GAAG,CAAC,CAAC,GAEjD;AACT"}
1
+ {"version":3,"file":"allocate.js","names":[],"sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * The indivisible remainder is allocated to the last bucket.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3 (total ratio = 6)\n * allocate(100, [1, 2, 3]);\n * // [16, 33, 51] - sum is exactly 100\n *\n * // Split $100 evenly among 3 parts\n * allocate(100, 3);\n * // [33, 33, 34] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3333n, 3333n, 3334n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution or number of equal parts\n * @returns Array of allocated amounts with remainder applied to last bucket (sum equals original amount)\n * @throws {RangeError} If ratios array is empty, contains negative values, sums to zero, or parts is not a positive integer.\n */\nexport function allocate(amount: number, ratios: number[] | number): number[];\nexport function allocate(amount: bigint, ratios: number[] | number): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[] | number): (number | bigint)[] {\n // If second param is a number, validate and treat it as number of equal parts\n if (typeof ratios === 'number') {\n if (!Number.isInteger(ratios) || ratios < 1) {\n throw new RangeError(`allocate: parts must be a positive integer, got ${ratios}`);\n }\n }\n\n const actualRatios = Array.isArray(ratios) ? ratios : Array(ratios).fill(1);\n\n if (actualRatios.length === 0) {\n throw new RangeError('Ratios array cannot be empty');\n }\n\n if (actualRatios.some((r) => r < 0)) {\n throw new RangeError('Ratios must be non-negative');\n }\n\n const totalRatio = actualRatios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new RangeError('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const totalRatioBigInt = BigInt(totalRatio);\n const results = Array.from(\n { length: actualRatios.length - 1 },\n (_, i) => (amount * BigInt(actualRatios[i])) / totalRatioBigInt,\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0n));\n\n return results;\n }\n\n // For number type, use proportional allocation for all ratios uniformly\n const results = Array.from({ length: actualRatios.length - 1 }, (_, i) =>\n Math.floor((amount * actualRatios[i]) / totalRatio),\n );\n\n results.push(amount - results.reduce((s, v) => s + v, 0));\n\n return results;\n}\n"],"mappings":"AA4BA,SAAgB,SAAS,EAAyB,EAAgD,CAEhG,GAAI,OAAO,GAAW,WAChB,CAAC,OAAO,UAAU,CAAM,GAAK,EAAS,GACxC,MAAU,WAAW,mDAAmD,GAAQ,EAIpF,IAAM,EAAe,MAAM,QAAQ,CAAM,EAAI,EAAS,MAAM,CAAM,CAAC,CAAC,KAAK,CAAC,EAE1E,GAAI,EAAa,SAAW,EAC1B,MAAU,WAAW,8BAA8B,EAGrD,GAAI,EAAa,KAAM,GAAM,EAAI,CAAC,EAChC,MAAU,WAAW,6BAA6B,EAGpD,IAAM,EAAa,EAAa,QAAQ,EAAK,IAAU,EAAM,EAAO,CAAC,EAErE,GAAI,IAAe,EACjB,MAAU,WAAW,4BAA4B,EAGnD,GAAI,OAAO,GAAW,SAAU,CAC9B,IAAM,EAAmB,OAAO,CAAU,EACpC,EAAU,MAAM,KACpB,CAAE,OAAQ,EAAa,OAAS,CAAE,GACjC,EAAG,IAAO,EAAS,OAAO,EAAa,EAAE,EAAK,CACjD,EAIA,OAFA,EAAQ,KAAK,EAAS,EAAQ,QAAQ,EAAG,IAAM,EAAI,EAAG,EAAE,CAAC,EAElD,CACT,CAGA,IAAM,EAAU,MAAM,KAAK,CAAE,OAAQ,EAAa,OAAS,CAAE,GAAI,EAAG,IAClE,KAAK,MAAO,EAAS,EAAa,GAAM,CAAU,CACpD,EAIA,OAFA,EAAQ,KAAK,EAAS,EAAQ,QAAQ,EAAG,IAAM,EAAI,EAAG,CAAC,CAAC,EAEjD,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("./sum.cjs");function t(t,n){if(t.length!==0)return e.sum(t,n)/t.length}exports.average=t;
1
+ const e=require("./sum.cjs");function average(t,n){if(t.length!==0)return e.sum(t,n)/t.length}exports.average=average;
2
2
  //# sourceMappingURL=average.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"average.cjs","names":[],"sources":["../../src/math/average.ts"],"sourcesContent":["import { sum } from './sum';\n\n/**\n * Calculates the average of an array of numbers.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4, 5];\n * average(arr); // 3\n * average(arr, (num) => num * 2); // 6\n * ```\n *\n * @param array - The array to average.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The average, or `undefined` if the array is empty.\n * @throws {TypeError} If a value is not a finite number.\n */\nexport function average<T>(array: readonly T[], callback?: (item: T) => number): number | undefined {\n if (array.length === 0) return undefined;\n\n return sum(array, callback) / array.length;\n}\n"],"mappings":"6BAiBA,SAAgB,EAAW,EAAqB,EAAoD,CAC9F,KAAM,SAAW,EAErB,OAAO,EAAA,IAAI,EAAO,CAAQ,EAAI,EAAM,MACtC"}
1
+ {"version":3,"file":"average.cjs","names":[],"sources":["../../src/math/average.ts"],"sourcesContent":["import { sum } from './sum';\n\n/**\n * Calculates the average of an array of numbers.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4, 5];\n * average(arr); // 3\n * average(arr, (num) => num * 2); // 6\n * ```\n *\n * @param array - The array to average.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The average, or `undefined` if the array is empty.\n * @throws {TypeError} If a value is not a finite number.\n */\nexport function average<T>(array: readonly T[], callback?: (item: T) => number): number | undefined {\n if (array.length === 0) return undefined;\n\n return sum(array, callback) / array.length;\n}\n"],"mappings":"6BAiBA,SAAgB,QAAW,EAAqB,EAAoD,CAC9F,KAAM,SAAW,EAErB,OAAO,EAAA,IAAI,EAAO,CAAQ,EAAI,EAAM,MACtC"}
@@ -1,9 +1,2 @@
1
- import { sum as e } from "./sum.js";
2
- //#region src/math/average.ts
3
- function t(t, n) {
4
- if (t.length !== 0) return e(t, n) / t.length;
5
- }
6
- //#endregion
7
- export { t as average };
8
-
1
+ import{sum as e}from"./sum.js";function average(t,n){if(t.length!==0)return e(t,n)/t.length}export{average};
9
2
  //# sourceMappingURL=average.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"average.js","names":[],"sources":["../../src/math/average.ts"],"sourcesContent":["import { sum } from './sum';\n\n/**\n * Calculates the average of an array of numbers.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4, 5];\n * average(arr); // 3\n * average(arr, (num) => num * 2); // 6\n * ```\n *\n * @param array - The array to average.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The average, or `undefined` if the array is empty.\n * @throws {TypeError} If a value is not a finite number.\n */\nexport function average<T>(array: readonly T[], callback?: (item: T) => number): number | undefined {\n if (array.length === 0) return undefined;\n\n return sum(array, callback) / array.length;\n}\n"],"mappings":";;AAiBA,SAAgB,EAAW,GAAqB,GAAoD;CAC9F,MAAM,WAAW,GAErB,OAAO,EAAI,GAAO,CAAQ,IAAI,EAAM;AACtC"}
1
+ {"version":3,"file":"average.js","names":[],"sources":["../../src/math/average.ts"],"sourcesContent":["import { sum } from './sum';\n\n/**\n * Calculates the average of an array of numbers.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4, 5];\n * average(arr); // 3\n * average(arr, (num) => num * 2); // 6\n * ```\n *\n * @param array - The array to average.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The average, or `undefined` if the array is empty.\n * @throws {TypeError} If a value is not a finite number.\n */\nexport function average<T>(array: readonly T[], callback?: (item: T) => number): number | undefined {\n if (array.length === 0) return undefined;\n\n return sum(array, callback) / array.length;\n}\n"],"mappings":"+BAiBA,SAAgB,QAAW,EAAqB,EAAoD,CAC9F,KAAM,SAAW,EAErB,OAAO,EAAI,EAAO,CAAQ,EAAI,EAAM,MACtC"}
@@ -1,2 +1,2 @@
1
- function e(e,t,n){return t!=null&&e<t?t:n!=null&&e>n?n:e}exports.clamp=e;
1
+ function clamp(e,t,n){return t!=null&&e<t?t:n!=null&&e>n?n:e}exports.clamp=clamp;
2
2
  //# sourceMappingURL=clamp.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"clamp.cjs","names":[],"sources":["../../src/math/clamp.ts"],"sourcesContent":["/**\n * Restricts a number to be within a specified range.\n * Both `min` and `max` are optional — omitting one leaves that end unconstrained.\n *\n * @example\n * ```ts\n * clamp(5, 1, 10) // 5 — within range\n * clamp(0, 1, 10) // 1 — below min\n * clamp(15, 1, 10) // 10 — above max\n * clamp(15, 1) // 15 — no max, above min\n * clamp(-5, undefined, 0) // -5 — no min, below max\n * ```\n *\n * @param n - The number to clamp.\n * @param min - Optional lower bound (inclusive).\n * @param max - Optional upper bound (inclusive).\n *\n * @returns The clamped number.\n */\nexport function clamp(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min;\n\n if (max != null && n > max) return max;\n\n return n;\n}\n"],"mappings":"AAmBA,SAAgB,EAAM,EAAW,EAAc,EAAsB,CAKnE,OAJI,GAAO,MAAQ,EAAI,EAAY,EAE/B,GAAO,MAAQ,EAAI,EAAY,EAE5B,CACT"}
1
+ {"version":3,"file":"clamp.cjs","names":[],"sources":["../../src/math/clamp.ts"],"sourcesContent":["/**\n * Restricts a number to be within a specified range.\n * Both `min` and `max` are optional — omitting one leaves that end unconstrained.\n *\n * @example\n * ```ts\n * clamp(5, 1, 10) // 5 — within range\n * clamp(0, 1, 10) // 1 — below min\n * clamp(15, 1, 10) // 10 — above max\n * clamp(15, 1) // 15 — no max, above min\n * clamp(-5, undefined, 0) // -5 — no min, below max\n * ```\n *\n * @param n - The number to clamp.\n * @param min - Optional lower bound (inclusive).\n * @param max - Optional upper bound (inclusive).\n *\n * @returns The clamped number.\n */\nexport function clamp(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min;\n\n if (max != null && n > max) return max;\n\n return n;\n}\n"],"mappings":"AAmBA,SAAgB,MAAM,EAAW,EAAc,EAAsB,CAKnE,OAJI,GAAO,MAAQ,EAAI,EAAY,EAE/B,GAAO,MAAQ,EAAI,EAAY,EAE5B,CACT"}
@@ -1,8 +1,2 @@
1
- //#region src/math/clamp.ts
2
- function e(e, t, n) {
3
- return t != null && e < t ? t : n != null && e > n ? n : e;
4
- }
5
- //#endregion
6
- export { e as clamp };
7
-
1
+ function clamp(e,t,n){return t!=null&&e<t?t:n!=null&&e>n?n:e}export{clamp};
8
2
  //# sourceMappingURL=clamp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clamp.js","names":[],"sources":["../../src/math/clamp.ts"],"sourcesContent":["/**\n * Restricts a number to be within a specified range.\n * Both `min` and `max` are optional — omitting one leaves that end unconstrained.\n *\n * @example\n * ```ts\n * clamp(5, 1, 10) // 5 — within range\n * clamp(0, 1, 10) // 1 — below min\n * clamp(15, 1, 10) // 10 — above max\n * clamp(15, 1) // 15 — no max, above min\n * clamp(-5, undefined, 0) // -5 — no min, below max\n * ```\n *\n * @param n - The number to clamp.\n * @param min - Optional lower bound (inclusive).\n * @param max - Optional upper bound (inclusive).\n *\n * @returns The clamped number.\n */\nexport function clamp(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min;\n\n if (max != null && n > max) return max;\n\n return n;\n}\n"],"mappings":";AAmBA,SAAgB,EAAM,GAAW,GAAc,GAAsB;CAKnE,OAJI,KAAO,QAAQ,IAAI,IAAY,IAE/B,KAAO,QAAQ,IAAI,IAAY,IAE5B;AACT"}
1
+ {"version":3,"file":"clamp.js","names":[],"sources":["../../src/math/clamp.ts"],"sourcesContent":["/**\n * Restricts a number to be within a specified range.\n * Both `min` and `max` are optional — omitting one leaves that end unconstrained.\n *\n * @example\n * ```ts\n * clamp(5, 1, 10) // 5 — within range\n * clamp(0, 1, 10) // 1 — below min\n * clamp(15, 1, 10) // 10 — above max\n * clamp(15, 1) // 15 — no max, above min\n * clamp(-5, undefined, 0) // -5 — no min, below max\n * ```\n *\n * @param n - The number to clamp.\n * @param min - Optional lower bound (inclusive).\n * @param max - Optional upper bound (inclusive).\n *\n * @returns The clamped number.\n */\nexport function clamp(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min;\n\n if (max != null && n > max) return max;\n\n return n;\n}\n"],"mappings":"AAmBA,SAAgB,MAAM,EAAW,EAAc,EAAsB,CAKnE,OAJI,GAAO,MAAQ,EAAI,EAAY,EAE/B,GAAO,MAAQ,EAAI,EAAY,EAE5B,CACT"}
package/dist/math/gcd.cjs CHANGED
@@ -1,2 +1,2 @@
1
- function e(e,t){if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t))throw RangeError(`gcd: inputs must be safe integers`);let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=r;r=n%r,n=e}return n}exports.gcd=e;
1
+ function gcd(e,t){if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t))throw RangeError(`gcd: inputs must be safe integers`);let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=r;r=n%r,n=e}return n}exports.gcd=gcd;
2
2
  //# sourceMappingURL=gcd.cjs.map