@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":"gcd.cjs","names":[],"sources":["../../src/math/gcd.ts"],"sourcesContent":["/**\n * Computes the greatest common divisor of two integers using the Euclidean algorithm.\n * The sign of the inputs is ignored — the result is always non-negative.\n *\n * @example\n * ```ts\n * gcd(12, 18); // 6\n * gcd(-12, 18); // 6\n * gcd(0, 5); // 5\n * gcd(0, 0); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The greatest common divisor of `a` and `b`.\n */\nexport function gcd(a: number, b: number): number {\n if (!Number.isSafeInteger(a) || !Number.isSafeInteger(b)) {\n throw new RangeError('gcd: inputs must be safe integers');\n }\n\n let x = Math.abs(a);\n let y = Math.abs(b);\n\n while (y !== 0) {\n const temp = y;\n\n y = x % y;\n x = temp;\n }\n\n return x;\n}\n"],"mappings":"AAgBA,SAAgB,EAAI,EAAW,EAAmB,CAChD,GAAI,CAAC,OAAO,cAAc,CAAC,GAAK,CAAC,OAAO,cAAc,CAAC,EACrD,MAAU,WAAW,mCAAmC,EAG1D,IAAI,EAAI,KAAK,IAAI,CAAC,EACd,EAAI,KAAK,IAAI,CAAC,EAElB,KAAO,IAAM,GAAG,CACd,IAAM,EAAO,EAEb,EAAI,EAAI,EACR,EAAI,CACN,CAEA,OAAO,CACT"}
1
+ {"version":3,"file":"gcd.cjs","names":[],"sources":["../../src/math/gcd.ts"],"sourcesContent":["/**\n * Computes the greatest common divisor of two integers using the Euclidean algorithm.\n * The sign of the inputs is ignored — the result is always non-negative.\n *\n * @example\n * ```ts\n * gcd(12, 18); // 6\n * gcd(-12, 18); // 6\n * gcd(0, 5); // 5\n * gcd(0, 0); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The greatest common divisor of `a` and `b`.\n */\nexport function gcd(a: number, b: number): number {\n if (!Number.isSafeInteger(a) || !Number.isSafeInteger(b)) {\n throw new RangeError('gcd: inputs must be safe integers');\n }\n\n let x = Math.abs(a);\n let y = Math.abs(b);\n\n while (y !== 0) {\n const temp = y;\n\n y = x % y;\n x = temp;\n }\n\n return x;\n}\n"],"mappings":"AAgBA,SAAgB,IAAI,EAAW,EAAmB,CAChD,GAAI,CAAC,OAAO,cAAc,CAAC,GAAK,CAAC,OAAO,cAAc,CAAC,EACrD,MAAU,WAAW,mCAAmC,EAG1D,IAAI,EAAI,KAAK,IAAI,CAAC,EACd,EAAI,KAAK,IAAI,CAAC,EAElB,KAAO,IAAM,GAAG,CACd,IAAM,EAAO,EAEb,EAAI,EAAI,EACR,EAAI,CACN,CAEA,OAAO,CACT"}
package/dist/math/gcd.js CHANGED
@@ -1,14 +1,2 @@
1
- //#region src/math/gcd.ts
2
- function e(e, t) {
3
- if (!Number.isSafeInteger(e) || !Number.isSafeInteger(t)) throw RangeError("gcd: inputs must be safe integers");
4
- let n = Math.abs(e), r = Math.abs(t);
5
- for (; r !== 0;) {
6
- let e = r;
7
- r = n % r, n = e;
8
- }
9
- return n;
10
- }
11
- //#endregion
12
- export { e as gcd };
13
-
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}export{gcd};
14
2
  //# sourceMappingURL=gcd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gcd.js","names":[],"sources":["../../src/math/gcd.ts"],"sourcesContent":["/**\n * Computes the greatest common divisor of two integers using the Euclidean algorithm.\n * The sign of the inputs is ignored — the result is always non-negative.\n *\n * @example\n * ```ts\n * gcd(12, 18); // 6\n * gcd(-12, 18); // 6\n * gcd(0, 5); // 5\n * gcd(0, 0); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The greatest common divisor of `a` and `b`.\n */\nexport function gcd(a: number, b: number): number {\n if (!Number.isSafeInteger(a) || !Number.isSafeInteger(b)) {\n throw new RangeError('gcd: inputs must be safe integers');\n }\n\n let x = Math.abs(a);\n let y = Math.abs(b);\n\n while (y !== 0) {\n const temp = y;\n\n y = x % y;\n x = temp;\n }\n\n return x;\n}\n"],"mappings":";AAgBA,SAAgB,EAAI,GAAW,GAAmB;CAChD,IAAI,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,GACrD,MAAU,WAAW,mCAAmC;CAG1D,IAAI,IAAI,KAAK,IAAI,CAAC,GACd,IAAI,KAAK,IAAI,CAAC;CAElB,OAAO,MAAM,IAAG;EACd,IAAM,IAAO;EAGb,AADA,IAAI,IAAI,GACR,IAAI;CACN;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"gcd.js","names":[],"sources":["../../src/math/gcd.ts"],"sourcesContent":["/**\n * Computes the greatest common divisor of two integers using the Euclidean algorithm.\n * The sign of the inputs is ignored — the result is always non-negative.\n *\n * @example\n * ```ts\n * gcd(12, 18); // 6\n * gcd(-12, 18); // 6\n * gcd(0, 5); // 5\n * gcd(0, 0); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The greatest common divisor of `a` and `b`.\n */\nexport function gcd(a: number, b: number): number {\n if (!Number.isSafeInteger(a) || !Number.isSafeInteger(b)) {\n throw new RangeError('gcd: inputs must be safe integers');\n }\n\n let x = Math.abs(a);\n let y = Math.abs(b);\n\n while (y !== 0) {\n const temp = y;\n\n y = x % y;\n x = temp;\n }\n\n return x;\n}\n"],"mappings":"AAgBA,SAAgB,IAAI,EAAW,EAAmB,CAChD,GAAI,CAAC,OAAO,cAAc,CAAC,GAAK,CAAC,OAAO,cAAc,CAAC,EACrD,MAAU,WAAW,mCAAmC,EAG1D,IAAI,EAAI,KAAK,IAAI,CAAC,EACd,EAAI,KAAK,IAAI,CAAC,EAElB,KAAO,IAAM,GAAG,CACd,IAAM,EAAO,EAEb,EAAI,EAAI,EACR,EAAI,CACN,CAEA,OAAO,CACT"}
@@ -1,16 +1 @@
1
- import { allocate as e } from "./allocate.js";
2
- import { clamp as t } from "./clamp.js";
3
- import { range as n } from "./range.js";
4
- import { sum as r } from "./sum.js";
5
- import { average as i } from "./average.js";
6
- import { gcd as a } from "./gcd.js";
7
- import { lcm as o } from "./lcm.js";
8
- import { lerp as s } from "./lerp.js";
9
- import { linspace as c } from "./linspace.js";
10
- import { median as l } from "./median.js";
11
- import { mod as u } from "./mod.js";
12
- import { normalize as d } from "./normalize.js";
13
- import { round as f } from "./round.js";
14
- import { variance as p } from "./variance.js";
15
- import { standardDeviation as m } from "./standardDeviation.js";
16
- export { e as allocate, i as average, t as clamp, a as gcd, o as lcm, s as lerp, c as linspace, l as median, u as mod, d as normalize, n as range, f as round, m as standardDeviation, r as sum, p as variance };
1
+ import{allocate as e}from"./allocate.js";import{clamp as t}from"./clamp.js";import{range as n}from"./range.js";import{sum as r}from"./sum.js";import{average as i}from"./average.js";import{gcd as a}from"./gcd.js";import{lcm as o}from"./lcm.js";import{lerp as s}from"./lerp.js";import{linspace as c}from"./linspace.js";import{median as l}from"./median.js";import{mod as u}from"./mod.js";import{normalize as d}from"./normalize.js";import{round as f}from"./round.js";import{variance as p}from"./variance.js";import{standardDeviation as m}from"./standardDeviation.js";export{e as allocate,i as average,t as clamp,a as gcd,o as lcm,s as lerp,c as linspace,l as median,u as mod,d as normalize,n as range,f as round,m as standardDeviation,r as sum,p as variance};
package/dist/math/lcm.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const e=require("./gcd.cjs");function t(t,n){let r=e.gcd(t,n);if(r===0)return 0;let i=Math.abs(t/r*n);if(!Number.isSafeInteger(i))throw RangeError(`lcm: result exceeds the safe integer range`);return i}exports.lcm=t;
1
+ const e=require("./gcd.cjs");function lcm(t,n){let r=e.gcd(t,n);if(r===0)return 0;let i=Math.abs(t/r*n);if(!Number.isSafeInteger(i))throw RangeError(`lcm: result exceeds the safe integer range`);return i}exports.lcm=lcm;
2
2
  //# sourceMappingURL=lcm.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"lcm.cjs","names":[],"sources":["../../src/math/lcm.ts"],"sourcesContent":["import { gcd } from './gcd';\n\n/**\n * Computes the least common multiple of two integers.\n *\n * @example\n * ```ts\n * lcm(4, 6); // 12\n * lcm(0, 5); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The least common multiple of `a` and `b`, or `0` if either is `0`.\n */\nexport function lcm(a: number, b: number): number {\n const divisor = gcd(a, b);\n\n if (divisor === 0) return 0;\n\n const result = Math.abs((a / divisor) * b);\n\n if (!Number.isSafeInteger(result)) throw new RangeError('lcm: result exceeds the safe integer range');\n\n return result;\n}\n"],"mappings":"6BAeA,SAAgB,EAAI,EAAW,EAAmB,CAChD,IAAM,EAAU,EAAA,IAAI,EAAG,CAAC,EAExB,GAAI,IAAY,EAAG,MAAO,GAE1B,IAAM,EAAS,KAAK,IAAK,EAAI,EAAW,CAAC,EAEzC,GAAI,CAAC,OAAO,cAAc,CAAM,EAAG,MAAU,WAAW,4CAA4C,EAEpG,OAAO,CACT"}
1
+ {"version":3,"file":"lcm.cjs","names":[],"sources":["../../src/math/lcm.ts"],"sourcesContent":["import { gcd } from './gcd';\n\n/**\n * Computes the least common multiple of two integers.\n *\n * @example\n * ```ts\n * lcm(4, 6); // 12\n * lcm(0, 5); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The least common multiple of `a` and `b`, or `0` if either is `0`.\n */\nexport function lcm(a: number, b: number): number {\n const divisor = gcd(a, b);\n\n if (divisor === 0) return 0;\n\n const result = Math.abs((a / divisor) * b);\n\n if (!Number.isSafeInteger(result)) throw new RangeError('lcm: result exceeds the safe integer range');\n\n return result;\n}\n"],"mappings":"6BAeA,SAAgB,IAAI,EAAW,EAAmB,CAChD,IAAM,EAAU,EAAA,IAAI,EAAG,CAAC,EAExB,GAAI,IAAY,EAAG,MAAO,GAE1B,IAAM,EAAS,KAAK,IAAK,EAAI,EAAW,CAAC,EAEzC,GAAI,CAAC,OAAO,cAAc,CAAM,EAAG,MAAU,WAAW,4CAA4C,EAEpG,OAAO,CACT"}
package/dist/math/lcm.js CHANGED
@@ -1,13 +1,2 @@
1
- import { gcd as e } from "./gcd.js";
2
- //#region src/math/lcm.ts
3
- function t(t, n) {
4
- let r = e(t, n);
5
- if (r === 0) return 0;
6
- let i = Math.abs(t / r * n);
7
- if (!Number.isSafeInteger(i)) throw RangeError("lcm: result exceeds the safe integer range");
8
- return i;
9
- }
10
- //#endregion
11
- export { t as lcm };
12
-
1
+ import{gcd as e}from"./gcd.js";function lcm(t,n){let r=e(t,n);if(r===0)return 0;let i=Math.abs(t/r*n);if(!Number.isSafeInteger(i))throw RangeError(`lcm: result exceeds the safe integer range`);return i}export{lcm};
13
2
  //# sourceMappingURL=lcm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lcm.js","names":[],"sources":["../../src/math/lcm.ts"],"sourcesContent":["import { gcd } from './gcd';\n\n/**\n * Computes the least common multiple of two integers.\n *\n * @example\n * ```ts\n * lcm(4, 6); // 12\n * lcm(0, 5); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The least common multiple of `a` and `b`, or `0` if either is `0`.\n */\nexport function lcm(a: number, b: number): number {\n const divisor = gcd(a, b);\n\n if (divisor === 0) return 0;\n\n const result = Math.abs((a / divisor) * b);\n\n if (!Number.isSafeInteger(result)) throw new RangeError('lcm: result exceeds the safe integer range');\n\n return result;\n}\n"],"mappings":";;AAeA,SAAgB,EAAI,GAAW,GAAmB;CAChD,IAAM,IAAU,EAAI,GAAG,CAAC;CAExB,IAAI,MAAY,GAAG,OAAO;CAE1B,IAAM,IAAS,KAAK,IAAK,IAAI,IAAW,CAAC;CAEzC,IAAI,CAAC,OAAO,cAAc,CAAM,GAAG,MAAU,WAAW,4CAA4C;CAEpG,OAAO;AACT"}
1
+ {"version":3,"file":"lcm.js","names":[],"sources":["../../src/math/lcm.ts"],"sourcesContent":["import { gcd } from './gcd';\n\n/**\n * Computes the least common multiple of two integers.\n *\n * @example\n * ```ts\n * lcm(4, 6); // 12\n * lcm(0, 5); // 0\n * ```\n *\n * @param a - The first integer.\n * @param b - The second integer.\n * @returns The least common multiple of `a` and `b`, or `0` if either is `0`.\n */\nexport function lcm(a: number, b: number): number {\n const divisor = gcd(a, b);\n\n if (divisor === 0) return 0;\n\n const result = Math.abs((a / divisor) * b);\n\n if (!Number.isSafeInteger(result)) throw new RangeError('lcm: result exceeds the safe integer range');\n\n return result;\n}\n"],"mappings":"+BAeA,SAAgB,IAAI,EAAW,EAAmB,CAChD,IAAM,EAAU,EAAI,EAAG,CAAC,EAExB,GAAI,IAAY,EAAG,MAAO,GAE1B,IAAM,EAAS,KAAK,IAAK,EAAI,EAAW,CAAC,EAEzC,GAAI,CAAC,OAAO,cAAc,CAAM,EAAG,MAAU,WAAW,4CAA4C,EAEpG,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- function e(e,t,n){return e+(t-e)*n}exports.lerp=e;
1
+ function lerp(e,t,n){return e+(t-e)*n}exports.lerp=lerp;
2
2
  //# sourceMappingURL=lerp.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"lerp.cjs","names":[],"sources":["../../src/math/lerp.ts"],"sourcesContent":["/**\n * Linearly interpolates between `a` and `b` by factor `t`. `t` is not clamped, so values\n * outside `[0, 1]` extrapolate beyond the `[a, b]` range.\n *\n * @example\n * ```ts\n * lerp(0, 10, 0.5); // 5\n * lerp(0, 10, 1.5); // 15 (extrapolated — t is not clamped)\n * ```\n *\n * @param a - The start value (returned when `t` is `0`).\n * @param b - The end value (returned when `t` is `1`).\n * @param t - The interpolation factor.\n * @returns The interpolated value.\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n"],"mappings":"AAeA,SAAgB,EAAK,EAAW,EAAW,EAAmB,CAC5D,OAAO,GAAK,EAAI,GAAK,CACvB"}
1
+ {"version":3,"file":"lerp.cjs","names":[],"sources":["../../src/math/lerp.ts"],"sourcesContent":["/**\n * Linearly interpolates between `a` and `b` by factor `t`. `t` is not clamped, so values\n * outside `[0, 1]` extrapolate beyond the `[a, b]` range.\n *\n * @example\n * ```ts\n * lerp(0, 10, 0.5); // 5\n * lerp(0, 10, 1.5); // 15 (extrapolated — t is not clamped)\n * ```\n *\n * @param a - The start value (returned when `t` is `0`).\n * @param b - The end value (returned when `t` is `1`).\n * @param t - The interpolation factor.\n * @returns The interpolated value.\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n"],"mappings":"AAeA,SAAgB,KAAK,EAAW,EAAW,EAAmB,CAC5D,OAAO,GAAK,EAAI,GAAK,CACvB"}
package/dist/math/lerp.js CHANGED
@@ -1,8 +1,2 @@
1
- //#region src/math/lerp.ts
2
- function e(e, t, n) {
3
- return e + (t - e) * n;
4
- }
5
- //#endregion
6
- export { e as lerp };
7
-
1
+ function lerp(e,t,n){return e+(t-e)*n}export{lerp};
8
2
  //# sourceMappingURL=lerp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lerp.js","names":[],"sources":["../../src/math/lerp.ts"],"sourcesContent":["/**\n * Linearly interpolates between `a` and `b` by factor `t`. `t` is not clamped, so values\n * outside `[0, 1]` extrapolate beyond the `[a, b]` range.\n *\n * @example\n * ```ts\n * lerp(0, 10, 0.5); // 5\n * lerp(0, 10, 1.5); // 15 (extrapolated — t is not clamped)\n * ```\n *\n * @param a - The start value (returned when `t` is `0`).\n * @param b - The end value (returned when `t` is `1`).\n * @param t - The interpolation factor.\n * @returns The interpolated value.\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n"],"mappings":";AAeA,SAAgB,EAAK,GAAW,GAAW,GAAmB;CAC5D,OAAO,KAAK,IAAI,KAAK;AACvB"}
1
+ {"version":3,"file":"lerp.js","names":[],"sources":["../../src/math/lerp.ts"],"sourcesContent":["/**\n * Linearly interpolates between `a` and `b` by factor `t`. `t` is not clamped, so values\n * outside `[0, 1]` extrapolate beyond the `[a, b]` range.\n *\n * @example\n * ```ts\n * lerp(0, 10, 0.5); // 5\n * lerp(0, 10, 1.5); // 15 (extrapolated — t is not clamped)\n * ```\n *\n * @param a - The start value (returned when `t` is `0`).\n * @param b - The end value (returned when `t` is `1`).\n * @param t - The interpolation factor.\n * @returns The interpolated value.\n */\nexport function lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n"],"mappings":"AAeA,SAAgB,KAAK,EAAW,EAAW,EAAmB,CAC5D,OAAO,GAAK,EAAI,GAAK,CACvB"}
@@ -1,2 +1,2 @@
1
- function e(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t))throw RangeError(`linspace: bounds must be finite`);if(!Number.isSafeInteger(n)||n<1)throw RangeError(`linspace: steps must be a positive integer`);if(n===1)return[e];let r=(t-e)/(n-1);return Array.from({length:n},(t,n)=>e+n*r)}exports.linspace=e;
1
+ function linspace(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t))throw RangeError(`linspace: bounds must be finite`);if(!Number.isSafeInteger(n)||n<1)throw RangeError(`linspace: steps must be a positive integer`);if(n===1)return[e];let r=(t-e)/(n-1);return Array.from({length:n},(t,n)=>e+n*r)}exports.linspace=linspace;
2
2
  //# sourceMappingURL=linspace.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"linspace.cjs","names":[],"sources":["../../src/math/linspace.ts"],"sourcesContent":["/**\n * Creates an array of evenly-spaced numbers from `start` to `end`.\n *\n * @example\n * ```ts\n * linspace(0, 10); // [0, 2.5, 5, 7.5, 10]\n * linspace(0, 10, 3); // [0, 5, 10]\n * linspace(0, 10, 1); // [0]\n * linspace(10, 0, 5); // [10, 7.5, 5, 2.5, 0]\n * ```\n *\n * @param start - The start of the range.\n * @param end - The end of the range.\n * @param steps - Number of evenly-spaced points to generate (default: 5).\n *\n * @returns An array of `steps` numbers from `start` to `end`.\n */\nexport function linspace(start: number, end: number, steps = 5): number[] {\n if (!Number.isFinite(start) || !Number.isFinite(end)) throw new RangeError('linspace: bounds must be finite');\n if (!Number.isSafeInteger(steps) || steps < 1) throw new RangeError('linspace: steps must be a positive integer');\n\n if (steps === 1) return [start];\n\n const stepSize = (end - start) / (steps - 1);\n\n return Array.from({ length: steps }, (_, i) => start + i * stepSize);\n}\n"],"mappings":"AAiBA,SAAgB,EAAS,EAAe,EAAa,EAAQ,EAAa,CACxE,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAG,EAAG,MAAU,WAAW,iCAAiC,EAC5G,GAAI,CAAC,OAAO,cAAc,CAAK,GAAK,EAAQ,EAAG,MAAU,WAAW,4CAA4C,EAEhH,GAAI,IAAU,EAAG,MAAO,CAAC,CAAK,EAE9B,IAAM,GAAY,EAAM,IAAU,EAAQ,GAE1C,OAAO,MAAM,KAAK,CAAE,OAAQ,CAAM,GAAI,EAAG,IAAM,EAAQ,EAAI,CAAQ,CACrE"}
1
+ {"version":3,"file":"linspace.cjs","names":[],"sources":["../../src/math/linspace.ts"],"sourcesContent":["/**\n * Creates an array of evenly-spaced numbers from `start` to `end`.\n *\n * @example\n * ```ts\n * linspace(0, 10); // [0, 2.5, 5, 7.5, 10]\n * linspace(0, 10, 3); // [0, 5, 10]\n * linspace(0, 10, 1); // [0]\n * linspace(10, 0, 5); // [10, 7.5, 5, 2.5, 0]\n * ```\n *\n * @param start - The start of the range.\n * @param end - The end of the range.\n * @param steps - Number of evenly-spaced points to generate (default: 5).\n *\n * @returns An array of `steps` numbers from `start` to `end`.\n */\nexport function linspace(start: number, end: number, steps = 5): number[] {\n if (!Number.isFinite(start) || !Number.isFinite(end)) throw new RangeError('linspace: bounds must be finite');\n if (!Number.isSafeInteger(steps) || steps < 1) throw new RangeError('linspace: steps must be a positive integer');\n\n if (steps === 1) return [start];\n\n const stepSize = (end - start) / (steps - 1);\n\n return Array.from({ length: steps }, (_, i) => start + i * stepSize);\n}\n"],"mappings":"AAiBA,SAAgB,SAAS,EAAe,EAAa,EAAQ,EAAa,CACxE,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAG,EAAG,MAAU,WAAW,iCAAiC,EAC5G,GAAI,CAAC,OAAO,cAAc,CAAK,GAAK,EAAQ,EAAG,MAAU,WAAW,4CAA4C,EAEhH,GAAI,IAAU,EAAG,MAAO,CAAC,CAAK,EAE9B,IAAM,GAAY,EAAM,IAAU,EAAQ,GAE1C,OAAO,MAAM,KAAK,CAAE,OAAQ,CAAM,GAAI,EAAG,IAAM,EAAQ,EAAI,CAAQ,CACrE"}
@@ -1,12 +1,2 @@
1
- //#region src/math/linspace.ts
2
- function e(e, t, n = 5) {
3
- if (!Number.isFinite(e) || !Number.isFinite(t)) throw RangeError("linspace: bounds must be finite");
4
- if (!Number.isSafeInteger(n) || n < 1) throw RangeError("linspace: steps must be a positive integer");
5
- if (n === 1) return [e];
6
- let r = (t - e) / (n - 1);
7
- return Array.from({ length: n }, (t, n) => e + n * r);
8
- }
9
- //#endregion
10
- export { e as linspace };
11
-
1
+ function linspace(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t))throw RangeError(`linspace: bounds must be finite`);if(!Number.isSafeInteger(n)||n<1)throw RangeError(`linspace: steps must be a positive integer`);if(n===1)return[e];let r=(t-e)/(n-1);return Array.from({length:n},(t,n)=>e+n*r)}export{linspace};
12
2
  //# sourceMappingURL=linspace.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"linspace.js","names":[],"sources":["../../src/math/linspace.ts"],"sourcesContent":["/**\n * Creates an array of evenly-spaced numbers from `start` to `end`.\n *\n * @example\n * ```ts\n * linspace(0, 10); // [0, 2.5, 5, 7.5, 10]\n * linspace(0, 10, 3); // [0, 5, 10]\n * linspace(0, 10, 1); // [0]\n * linspace(10, 0, 5); // [10, 7.5, 5, 2.5, 0]\n * ```\n *\n * @param start - The start of the range.\n * @param end - The end of the range.\n * @param steps - Number of evenly-spaced points to generate (default: 5).\n *\n * @returns An array of `steps` numbers from `start` to `end`.\n */\nexport function linspace(start: number, end: number, steps = 5): number[] {\n if (!Number.isFinite(start) || !Number.isFinite(end)) throw new RangeError('linspace: bounds must be finite');\n if (!Number.isSafeInteger(steps) || steps < 1) throw new RangeError('linspace: steps must be a positive integer');\n\n if (steps === 1) return [start];\n\n const stepSize = (end - start) / (steps - 1);\n\n return Array.from({ length: steps }, (_, i) => start + i * stepSize);\n}\n"],"mappings":";AAiBA,SAAgB,EAAS,GAAe,GAAa,IAAQ,GAAa;CACxE,IAAI,CAAC,OAAO,SAAS,CAAK,KAAK,CAAC,OAAO,SAAS,CAAG,GAAG,MAAU,WAAW,iCAAiC;CAC5G,IAAI,CAAC,OAAO,cAAc,CAAK,KAAK,IAAQ,GAAG,MAAU,WAAW,4CAA4C;CAEhH,IAAI,MAAU,GAAG,OAAO,CAAC,CAAK;CAE9B,IAAM,KAAY,IAAM,MAAU,IAAQ;CAE1C,OAAO,MAAM,KAAK,EAAE,QAAQ,EAAM,IAAI,GAAG,MAAM,IAAQ,IAAI,CAAQ;AACrE"}
1
+ {"version":3,"file":"linspace.js","names":[],"sources":["../../src/math/linspace.ts"],"sourcesContent":["/**\n * Creates an array of evenly-spaced numbers from `start` to `end`.\n *\n * @example\n * ```ts\n * linspace(0, 10); // [0, 2.5, 5, 7.5, 10]\n * linspace(0, 10, 3); // [0, 5, 10]\n * linspace(0, 10, 1); // [0]\n * linspace(10, 0, 5); // [10, 7.5, 5, 2.5, 0]\n * ```\n *\n * @param start - The start of the range.\n * @param end - The end of the range.\n * @param steps - Number of evenly-spaced points to generate (default: 5).\n *\n * @returns An array of `steps` numbers from `start` to `end`.\n */\nexport function linspace(start: number, end: number, steps = 5): number[] {\n if (!Number.isFinite(start) || !Number.isFinite(end)) throw new RangeError('linspace: bounds must be finite');\n if (!Number.isSafeInteger(steps) || steps < 1) throw new RangeError('linspace: steps must be a positive integer');\n\n if (steps === 1) return [start];\n\n const stepSize = (end - start) / (steps - 1);\n\n return Array.from({ length: steps }, (_, i) => start + i * stepSize);\n}\n"],"mappings":"AAiBA,SAAgB,SAAS,EAAe,EAAa,EAAQ,EAAa,CACxE,GAAI,CAAC,OAAO,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAG,EAAG,MAAU,WAAW,iCAAiC,EAC5G,GAAI,CAAC,OAAO,cAAc,CAAK,GAAK,EAAQ,EAAG,MAAU,WAAW,4CAA4C,EAEhH,GAAI,IAAU,EAAG,MAAO,CAAC,CAAK,EAE9B,IAAM,GAAY,EAAM,IAAU,EAAQ,GAE1C,OAAO,MAAM,KAAK,CAAE,OAAQ,CAAM,GAAI,EAAG,IAAM,EAAQ,EAAI,CAAQ,CACrE"}
@@ -1,2 +1,2 @@
1
- function e(e,t){if(e.length===0)return;let n=t?e.map(t):[...e];n.sort((e,t)=>e-t);let r=Math.floor(n.length/2);return n.length%2==0?(n[r-1]+n[r])/2:n[r]}exports.median=e;
1
+ function median(e,t){if(e.length===0)return;let n=t?e.map(t):[...e];n.sort((e,t)=>e-t);let r=Math.floor(n.length/2);return n.length%2==0?(n[r-1]+n[r])/2:n[r]}exports.median=median;
2
2
  //# sourceMappingURL=median.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"median.cjs","names":[],"sources":["../../src/math/median.ts"],"sourcesContent":["/**\n * Returns the median of an array of numbers.\n *\n * @example\n * ```ts\n * median([1, 2, 3, 4, 100]); // 3\n * median([1, 2, 3, 4, 5], (n) => n * 2); // 6\n * median([]); // undefined\n * median([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); // 5.5\n * ```\n *\n * @param arr - The array of numbers.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The median, or `undefined` if the array is empty.\n */\nexport function median<T>(arr: readonly T[], callback?: (item: T) => number): number | undefined {\n if (arr.length === 0) return undefined;\n\n const values = callback ? arr.map(callback) : [...(arr as unknown as number[])];\n\n values.sort((a, b) => a - b);\n\n const mid = Math.floor(values.length / 2);\n\n return values.length % 2 === 0 ? (values[mid - 1] + values[mid]) / 2 : values[mid];\n}\n"],"mappings":"AAeA,SAAgB,EAAU,EAAmB,EAAoD,CAC/F,GAAI,EAAI,SAAW,EAAG,OAEtB,IAAM,EAAS,EAAW,EAAI,IAAI,CAAQ,EAAI,CAAC,GAAI,CAA2B,EAE9E,EAAO,MAAM,EAAG,IAAM,EAAI,CAAC,EAE3B,IAAM,EAAM,KAAK,MAAM,EAAO,OAAS,CAAC,EAExC,OAAO,EAAO,OAAS,GAAM,GAAK,EAAO,EAAM,GAAK,EAAO,IAAQ,EAAI,EAAO,EAChF"}
1
+ {"version":3,"file":"median.cjs","names":[],"sources":["../../src/math/median.ts"],"sourcesContent":["/**\n * Returns the median of an array of numbers.\n *\n * @example\n * ```ts\n * median([1, 2, 3, 4, 100]); // 3\n * median([1, 2, 3, 4, 5], (n) => n * 2); // 6\n * median([]); // undefined\n * median([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); // 5.5\n * ```\n *\n * @param arr - The array of numbers.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The median, or `undefined` if the array is empty.\n */\nexport function median<T>(arr: readonly T[], callback?: (item: T) => number): number | undefined {\n if (arr.length === 0) return undefined;\n\n const values = callback ? arr.map(callback) : [...(arr as unknown as number[])];\n\n values.sort((a, b) => a - b);\n\n const mid = Math.floor(values.length / 2);\n\n return values.length % 2 === 0 ? (values[mid - 1] + values[mid]) / 2 : values[mid];\n}\n"],"mappings":"AAeA,SAAgB,OAAU,EAAmB,EAAoD,CAC/F,GAAI,EAAI,SAAW,EAAG,OAEtB,IAAM,EAAS,EAAW,EAAI,IAAI,CAAQ,EAAI,CAAC,GAAI,CAA2B,EAE9E,EAAO,MAAM,EAAG,IAAM,EAAI,CAAC,EAE3B,IAAM,EAAM,KAAK,MAAM,EAAO,OAAS,CAAC,EAExC,OAAO,EAAO,OAAS,GAAM,GAAK,EAAO,EAAM,GAAK,EAAO,IAAQ,EAAI,EAAO,EAChF"}
@@ -1,12 +1,2 @@
1
- //#region src/math/median.ts
2
- function e(e, t) {
3
- if (e.length === 0) return;
4
- let n = t ? e.map(t) : [...e];
5
- n.sort((e, t) => e - t);
6
- let r = Math.floor(n.length / 2);
7
- return n.length % 2 == 0 ? (n[r - 1] + n[r]) / 2 : n[r];
8
- }
9
- //#endregion
10
- export { e as median };
11
-
1
+ function median(e,t){if(e.length===0)return;let n=t?e.map(t):[...e];n.sort((e,t)=>e-t);let r=Math.floor(n.length/2);return n.length%2==0?(n[r-1]+n[r])/2:n[r]}export{median};
12
2
  //# sourceMappingURL=median.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"median.js","names":[],"sources":["../../src/math/median.ts"],"sourcesContent":["/**\n * Returns the median of an array of numbers.\n *\n * @example\n * ```ts\n * median([1, 2, 3, 4, 100]); // 3\n * median([1, 2, 3, 4, 5], (n) => n * 2); // 6\n * median([]); // undefined\n * median([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); // 5.5\n * ```\n *\n * @param arr - The array of numbers.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The median, or `undefined` if the array is empty.\n */\nexport function median<T>(arr: readonly T[], callback?: (item: T) => number): number | undefined {\n if (arr.length === 0) return undefined;\n\n const values = callback ? arr.map(callback) : [...(arr as unknown as number[])];\n\n values.sort((a, b) => a - b);\n\n const mid = Math.floor(values.length / 2);\n\n return values.length % 2 === 0 ? (values[mid - 1] + values[mid]) / 2 : values[mid];\n}\n"],"mappings":";AAeA,SAAgB,EAAU,GAAmB,GAAoD;CAC/F,IAAI,EAAI,WAAW,GAAG;CAEtB,IAAM,IAAS,IAAW,EAAI,IAAI,CAAQ,IAAI,CAAC,GAAI,CAA2B;CAE9E,EAAO,MAAM,GAAG,MAAM,IAAI,CAAC;CAE3B,IAAM,IAAM,KAAK,MAAM,EAAO,SAAS,CAAC;CAExC,OAAO,EAAO,SAAS,KAAM,KAAK,EAAO,IAAM,KAAK,EAAO,MAAQ,IAAI,EAAO;AAChF"}
1
+ {"version":3,"file":"median.js","names":[],"sources":["../../src/math/median.ts"],"sourcesContent":["/**\n * Returns the median of an array of numbers.\n *\n * @example\n * ```ts\n * median([1, 2, 3, 4, 100]); // 3\n * median([1, 2, 3, 4, 5], (n) => n * 2); // 6\n * median([]); // undefined\n * median([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); // 5.5\n * ```\n *\n * @param arr - The array of numbers.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The median, or `undefined` if the array is empty.\n */\nexport function median<T>(arr: readonly T[], callback?: (item: T) => number): number | undefined {\n if (arr.length === 0) return undefined;\n\n const values = callback ? arr.map(callback) : [...(arr as unknown as number[])];\n\n values.sort((a, b) => a - b);\n\n const mid = Math.floor(values.length / 2);\n\n return values.length % 2 === 0 ? (values[mid - 1] + values[mid]) / 2 : values[mid];\n}\n"],"mappings":"AAeA,SAAgB,OAAU,EAAmB,EAAoD,CAC/F,GAAI,EAAI,SAAW,EAAG,OAEtB,IAAM,EAAS,EAAW,EAAI,IAAI,CAAQ,EAAI,CAAC,GAAI,CAA2B,EAE9E,EAAO,MAAM,EAAG,IAAM,EAAI,CAAC,EAE3B,IAAM,EAAM,KAAK,MAAM,EAAO,OAAS,CAAC,EAExC,OAAO,EAAO,OAAS,GAAM,GAAK,EAAO,EAAM,GAAK,EAAO,IAAQ,EAAI,EAAO,EAChF"}
package/dist/math/mod.cjs CHANGED
@@ -1,2 +1,2 @@
1
- function e(e,t){if(t===0)throw RangeError(`mod: divisor cannot be 0`);return(e%t+t)%t}exports.mod=e;
1
+ function mod(e,t){if(t===0)throw RangeError(`mod: divisor cannot be 0`);return(e%t+t)%t}exports.mod=mod;
2
2
  //# sourceMappingURL=mod.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.cjs","names":[],"sources":["../../src/math/mod.ts"],"sourcesContent":["/**\n * Sign-correct modulo — unlike the native `%` operator, the result always has the same sign\n * as the divisor `b` (e.g. `mod(-1, 4)` is `3`, not `-1`).\n *\n * @example\n * ```ts\n * mod(-1, 4); // 3\n * mod(5, 3); // 2\n * ```\n *\n * @param a - The dividend.\n * @param b - The divisor. Must not be `0`.\n * @returns The sign-correct modulo of `a` by `b`.\n *\n * @throws {RangeError} If `b` is `0`.\n */\nexport function mod(a: number, b: number): number {\n if (b === 0) throw new RangeError('mod: divisor cannot be 0');\n\n return ((a % b) + b) % b;\n}\n"],"mappings":"AAgBA,SAAgB,EAAI,EAAW,EAAmB,CAChD,GAAI,IAAM,EAAG,MAAU,WAAW,0BAA0B,EAE5D,OAAS,EAAI,EAAK,GAAK,CACzB"}
1
+ {"version":3,"file":"mod.cjs","names":[],"sources":["../../src/math/mod.ts"],"sourcesContent":["/**\n * Sign-correct modulo — unlike the native `%` operator, the result always has the same sign\n * as the divisor `b` (e.g. `mod(-1, 4)` is `3`, not `-1`).\n *\n * @example\n * ```ts\n * mod(-1, 4); // 3\n * mod(5, 3); // 2\n * ```\n *\n * @param a - The dividend.\n * @param b - The divisor. Must not be `0`.\n * @returns The sign-correct modulo of `a` by `b`.\n *\n * @throws {RangeError} If `b` is `0`.\n */\nexport function mod(a: number, b: number): number {\n if (b === 0) throw new RangeError('mod: divisor cannot be 0');\n\n return ((a % b) + b) % b;\n}\n"],"mappings":"AAgBA,SAAgB,IAAI,EAAW,EAAmB,CAChD,GAAI,IAAM,EAAG,MAAU,WAAW,0BAA0B,EAE5D,OAAS,EAAI,EAAK,GAAK,CACzB"}
package/dist/math/mod.js CHANGED
@@ -1,9 +1,2 @@
1
- //#region src/math/mod.ts
2
- function e(e, t) {
3
- if (t === 0) throw RangeError("mod: divisor cannot be 0");
4
- return (e % t + t) % t;
5
- }
6
- //#endregion
7
- export { e as mod };
8
-
1
+ function mod(e,t){if(t===0)throw RangeError(`mod: divisor cannot be 0`);return(e%t+t)%t}export{mod};
9
2
  //# sourceMappingURL=mod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","names":[],"sources":["../../src/math/mod.ts"],"sourcesContent":["/**\n * Sign-correct modulo — unlike the native `%` operator, the result always has the same sign\n * as the divisor `b` (e.g. `mod(-1, 4)` is `3`, not `-1`).\n *\n * @example\n * ```ts\n * mod(-1, 4); // 3\n * mod(5, 3); // 2\n * ```\n *\n * @param a - The dividend.\n * @param b - The divisor. Must not be `0`.\n * @returns The sign-correct modulo of `a` by `b`.\n *\n * @throws {RangeError} If `b` is `0`.\n */\nexport function mod(a: number, b: number): number {\n if (b === 0) throw new RangeError('mod: divisor cannot be 0');\n\n return ((a % b) + b) % b;\n}\n"],"mappings":";AAgBA,SAAgB,EAAI,GAAW,GAAmB;CAChD,IAAI,MAAM,GAAG,MAAU,WAAW,0BAA0B;CAE5D,QAAS,IAAI,IAAK,KAAK;AACzB"}
1
+ {"version":3,"file":"mod.js","names":[],"sources":["../../src/math/mod.ts"],"sourcesContent":["/**\n * Sign-correct modulo — unlike the native `%` operator, the result always has the same sign\n * as the divisor `b` (e.g. `mod(-1, 4)` is `3`, not `-1`).\n *\n * @example\n * ```ts\n * mod(-1, 4); // 3\n * mod(5, 3); // 2\n * ```\n *\n * @param a - The dividend.\n * @param b - The divisor. Must not be `0`.\n * @returns The sign-correct modulo of `a` by `b`.\n *\n * @throws {RangeError} If `b` is `0`.\n */\nexport function mod(a: number, b: number): number {\n if (b === 0) throw new RangeError('mod: divisor cannot be 0');\n\n return ((a % b) + b) % b;\n}\n"],"mappings":"AAgBA,SAAgB,IAAI,EAAW,EAAmB,CAChD,GAAI,IAAM,EAAG,MAAU,WAAW,0BAA0B,EAE5D,OAAS,EAAI,EAAK,GAAK,CACzB"}
@@ -1,2 +1,2 @@
1
- const e=require("./clamp.cjs");function t(t,n,r){return n===r?0:e.clamp((t-n)/(r-n),0,1)}exports.normalize=t;
1
+ const e=require("./clamp.cjs");function normalize(t,n,r){return n===r?0:e.clamp((t-n)/(r-n),0,1)}exports.normalize=normalize;
2
2
  //# sourceMappingURL=normalize.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.cjs","names":[],"sources":["../../src/math/normalize.ts"],"sourcesContent":["import { clamp } from './clamp';\n\n/**\n * Normalizes a value from the range `[min, max]` into `[0, 1]`. The result is clamped, so\n * values outside `[min, max]` map to `0` or `1` rather than extrapolating.\n *\n * @example\n * ```ts\n * normalize(5, 0, 10); // 0.5\n * normalize(-5, 0, 10); // 0 (clamped)\n * normalize(15, 0, 10); // 1 (clamped)\n * ```\n *\n * @param value - The value to normalize.\n * @param min - The lower bound of the source range.\n * @param max - The upper bound of the source range.\n * @returns The normalized value in `[0, 1]`, or `0` if `min === max`.\n */\nexport function normalize(value: number, min: number, max: number): number {\n if (min === max) return 0;\n\n return clamp((value - min) / (max - min), 0, 1);\n}\n"],"mappings":"+BAkBA,SAAgB,EAAU,EAAe,EAAa,EAAqB,CAGzE,OAFI,IAAQ,EAAY,EAEjB,EAAA,OAAO,EAAQ,IAAQ,EAAM,GAAM,EAAG,CAAC,CAChD"}
1
+ {"version":3,"file":"normalize.cjs","names":[],"sources":["../../src/math/normalize.ts"],"sourcesContent":["import { clamp } from './clamp';\n\n/**\n * Normalizes a value from the range `[min, max]` into `[0, 1]`. The result is clamped, so\n * values outside `[min, max]` map to `0` or `1` rather than extrapolating.\n *\n * @example\n * ```ts\n * normalize(5, 0, 10); // 0.5\n * normalize(-5, 0, 10); // 0 (clamped)\n * normalize(15, 0, 10); // 1 (clamped)\n * ```\n *\n * @param value - The value to normalize.\n * @param min - The lower bound of the source range.\n * @param max - The upper bound of the source range.\n * @returns The normalized value in `[0, 1]`, or `0` if `min === max`.\n */\nexport function normalize(value: number, min: number, max: number): number {\n if (min === max) return 0;\n\n return clamp((value - min) / (max - min), 0, 1);\n}\n"],"mappings":"+BAkBA,SAAgB,UAAU,EAAe,EAAa,EAAqB,CAGzE,OAFI,IAAQ,EAAY,EAEjB,EAAA,OAAO,EAAQ,IAAQ,EAAM,GAAM,EAAG,CAAC,CAChD"}
@@ -1,9 +1,2 @@
1
- import { clamp as e } from "./clamp.js";
2
- //#region src/math/normalize.ts
3
- function t(t, n, r) {
4
- return n === r ? 0 : e((t - n) / (r - n), 0, 1);
5
- }
6
- //#endregion
7
- export { t as normalize };
8
-
1
+ import{clamp as e}from"./clamp.js";function normalize(t,n,r){return n===r?0:e((t-n)/(r-n),0,1)}export{normalize};
9
2
  //# sourceMappingURL=normalize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.js","names":[],"sources":["../../src/math/normalize.ts"],"sourcesContent":["import { clamp } from './clamp';\n\n/**\n * Normalizes a value from the range `[min, max]` into `[0, 1]`. The result is clamped, so\n * values outside `[min, max]` map to `0` or `1` rather than extrapolating.\n *\n * @example\n * ```ts\n * normalize(5, 0, 10); // 0.5\n * normalize(-5, 0, 10); // 0 (clamped)\n * normalize(15, 0, 10); // 1 (clamped)\n * ```\n *\n * @param value - The value to normalize.\n * @param min - The lower bound of the source range.\n * @param max - The upper bound of the source range.\n * @returns The normalized value in `[0, 1]`, or `0` if `min === max`.\n */\nexport function normalize(value: number, min: number, max: number): number {\n if (min === max) return 0;\n\n return clamp((value - min) / (max - min), 0, 1);\n}\n"],"mappings":";;AAkBA,SAAgB,EAAU,GAAe,GAAa,GAAqB;CAGzE,OAFI,MAAQ,IAAY,IAEjB,GAAO,IAAQ,MAAQ,IAAM,IAAM,GAAG,CAAC;AAChD"}
1
+ {"version":3,"file":"normalize.js","names":[],"sources":["../../src/math/normalize.ts"],"sourcesContent":["import { clamp } from './clamp';\n\n/**\n * Normalizes a value from the range `[min, max]` into `[0, 1]`. The result is clamped, so\n * values outside `[min, max]` map to `0` or `1` rather than extrapolating.\n *\n * @example\n * ```ts\n * normalize(5, 0, 10); // 0.5\n * normalize(-5, 0, 10); // 0 (clamped)\n * normalize(15, 0, 10); // 1 (clamped)\n * ```\n *\n * @param value - The value to normalize.\n * @param min - The lower bound of the source range.\n * @param max - The upper bound of the source range.\n * @returns The normalized value in `[0, 1]`, or `0` if `min === max`.\n */\nexport function normalize(value: number, min: number, max: number): number {\n if (min === max) return 0;\n\n return clamp((value - min) / (max - min), 0, 1);\n}\n"],"mappings":"mCAkBA,SAAgB,UAAU,EAAe,EAAa,EAAqB,CAGzE,OAFI,IAAQ,EAAY,EAEjB,GAAO,EAAQ,IAAQ,EAAM,GAAM,EAAG,CAAC,CAChD"}
@@ -1,2 +1,2 @@
1
- function e(e,t,n){let[r,i,a]=t===void 0?[0,e,1]:n===void 0?[e,t,1]:[e,t,n];if(!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))throw RangeError(`range: start, stop, and step must be finite numbers`);if(a===0)throw RangeError(`range: step cannot be 0`);if(r===i)return[];let o=(i-r)/a,s=Math.max(0,Number.isInteger(o)?o:Math.ceil(o+2**-52));if(s>1e7)throw RangeError(`range: exceeds maximum allowed size of 10,000,000`);return Array.from({length:s},(e,t)=>r+t*a)}exports.range=e;
1
+ function range(e,t,n){let[r,i,a]=t===void 0?[0,e,1]:n===void 0?[e,t,1]:[e,t,n];if(!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))throw RangeError(`range: start, stop, and step must be finite numbers`);if(a===0)throw RangeError(`range: step cannot be 0`);if(r===i)return[];let o=(i-r)/a,s=Math.max(0,Number.isInteger(o)?o:Math.ceil(o+2**-52));if(s>1e7)throw RangeError(`range: exceeds maximum allowed size of 10,000,000`);return Array.from({length:s},(e,t)=>r+t*a)}exports.range=range;
2
2
  //# sourceMappingURL=range.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"range.cjs","names":[],"sources":["../../src/math/range.ts"],"sourcesContent":["/**\n * Creates an array of numbers from `0` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(5) // [0, 1, 2, 3, 4]\n * ```\n */\nexport function range(stop: number): number[];\n/**\n * Creates an array of numbers from `start` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(2, 6) // [2, 3, 4, 5]\n * ```\n */\nexport function range(start: number, stop: number): number[];\n/**\n * Creates an array of numbers progressing from `start` up to, but not including, `stop` with a given `step`.\n *\n * @example\n * ```ts\n * range(0, 10, 2) // [0, 2, 4, 6, 8]\n * range(10, 0, -2) // [10, 8, 6, 4, 2]\n * ```\n *\n * @param start - The start of the range.\n * @param stop - The end of the range (exclusive).\n * @param step - The value to increment or decrement by.\n *\n * @returns The range of numbers.\n *\n * @throws {RangeError} If start, stop, or step are not finite numbers, step is 0, or range exceeds maximum size.\n */\nexport function range(start: number, stop: number, step: number): number[];\nexport function range(startOrStop: number, stop?: number, step?: number): number[] {\n const [resolvedStart, resolvedStop, resolvedStep] =\n stop === undefined ? [0, startOrStop, 1] : step === undefined ? [startOrStop, stop, 1] : [startOrStop, stop, step];\n\n if (!Number.isFinite(resolvedStart) || !Number.isFinite(resolvedStop) || !Number.isFinite(resolvedStep)) {\n throw new RangeError('range: start, stop, and step must be finite numbers');\n }\n\n if (resolvedStep === 0) throw new RangeError('range: step cannot be 0');\n\n if (resolvedStart === resolvedStop) {\n return [];\n }\n\n const raw = (resolvedStop - resolvedStart) / resolvedStep;\n const length = Math.max(0, Number.isInteger(raw) ? raw : Math.ceil(raw + Number.EPSILON));\n\n if (length > 10_000_000) throw new RangeError('range: exceeds maximum allowed size of 10,000,000');\n\n return Array.from({ length }, (_, i) => resolvedStart + i * resolvedStep);\n}\n"],"mappings":"AAoCA,SAAgB,EAAM,EAAqB,EAAe,EAAyB,CACjF,GAAM,CAAC,EAAe,EAAc,GAClC,IAAS,IAAA,GAAY,CAAC,EAAG,EAAa,CAAC,EAAI,IAAS,IAAA,GAAY,CAAC,EAAa,EAAM,CAAC,EAAI,CAAC,EAAa,EAAM,CAAI,EAEnH,GAAI,CAAC,OAAO,SAAS,CAAa,GAAK,CAAC,OAAO,SAAS,CAAY,GAAK,CAAC,OAAO,SAAS,CAAY,EACpG,MAAU,WAAW,qDAAqD,EAG5E,GAAI,IAAiB,EAAG,MAAU,WAAW,yBAAyB,EAEtE,GAAI,IAAkB,EACpB,MAAO,CAAC,EAGV,IAAM,GAAO,EAAe,GAAiB,EACvC,EAAS,KAAK,IAAI,EAAG,OAAO,UAAU,CAAG,EAAI,EAAM,KAAK,KAAK,QAAoB,CAAC,EAExF,GAAI,EAAS,IAAY,MAAU,WAAW,mDAAmD,EAEjG,OAAO,MAAM,KAAK,CAAE,QAAO,GAAI,EAAG,IAAM,EAAgB,EAAI,CAAY,CAC1E"}
1
+ {"version":3,"file":"range.cjs","names":[],"sources":["../../src/math/range.ts"],"sourcesContent":["/**\n * Creates an array of numbers from `0` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(5) // [0, 1, 2, 3, 4]\n * ```\n */\nexport function range(stop: number): number[];\n/**\n * Creates an array of numbers from `start` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(2, 6) // [2, 3, 4, 5]\n * ```\n */\nexport function range(start: number, stop: number): number[];\n/**\n * Creates an array of numbers progressing from `start` up to, but not including, `stop` with a given `step`.\n *\n * @example\n * ```ts\n * range(0, 10, 2) // [0, 2, 4, 6, 8]\n * range(10, 0, -2) // [10, 8, 6, 4, 2]\n * ```\n *\n * @param start - The start of the range.\n * @param stop - The end of the range (exclusive).\n * @param step - The value to increment or decrement by.\n *\n * @returns The range of numbers.\n *\n * @throws {RangeError} If start, stop, or step are not finite numbers, step is 0, or range exceeds maximum size.\n */\nexport function range(start: number, stop: number, step: number): number[];\nexport function range(startOrStop: number, stop?: number, step?: number): number[] {\n const [resolvedStart, resolvedStop, resolvedStep] =\n stop === undefined ? [0, startOrStop, 1] : step === undefined ? [startOrStop, stop, 1] : [startOrStop, stop, step];\n\n if (!Number.isFinite(resolvedStart) || !Number.isFinite(resolvedStop) || !Number.isFinite(resolvedStep)) {\n throw new RangeError('range: start, stop, and step must be finite numbers');\n }\n\n if (resolvedStep === 0) throw new RangeError('range: step cannot be 0');\n\n if (resolvedStart === resolvedStop) {\n return [];\n }\n\n const raw = (resolvedStop - resolvedStart) / resolvedStep;\n const length = Math.max(0, Number.isInteger(raw) ? raw : Math.ceil(raw + Number.EPSILON));\n\n if (length > 10_000_000) throw new RangeError('range: exceeds maximum allowed size of 10,000,000');\n\n return Array.from({ length }, (_, i) => resolvedStart + i * resolvedStep);\n}\n"],"mappings":"AAoCA,SAAgB,MAAM,EAAqB,EAAe,EAAyB,CACjF,GAAM,CAAC,EAAe,EAAc,GAClC,IAAS,IAAA,GAAY,CAAC,EAAG,EAAa,CAAC,EAAI,IAAS,IAAA,GAAY,CAAC,EAAa,EAAM,CAAC,EAAI,CAAC,EAAa,EAAM,CAAI,EAEnH,GAAI,CAAC,OAAO,SAAS,CAAa,GAAK,CAAC,OAAO,SAAS,CAAY,GAAK,CAAC,OAAO,SAAS,CAAY,EACpG,MAAU,WAAW,qDAAqD,EAG5E,GAAI,IAAiB,EAAG,MAAU,WAAW,yBAAyB,EAEtE,GAAI,IAAkB,EACpB,MAAO,CAAC,EAGV,IAAM,GAAO,EAAe,GAAiB,EACvC,EAAS,KAAK,IAAI,EAAG,OAAO,UAAU,CAAG,EAAI,EAAM,KAAK,KAAK,QAAoB,CAAC,EAExF,GAAI,EAAS,IAAY,MAAU,WAAW,mDAAmD,EAEjG,OAAO,MAAM,KAAK,CAAE,QAAO,GAAI,EAAG,IAAM,EAAgB,EAAI,CAAY,CAC1E"}
@@ -1,26 +1,2 @@
1
- //#region src/math/range.ts
2
- function e(e, t, n) {
3
- let [r, i, a] = t === void 0 ? [
4
- 0,
5
- e,
6
- 1
7
- ] : n === void 0 ? [
8
- e,
9
- t,
10
- 1
11
- ] : [
12
- e,
13
- t,
14
- n
15
- ];
16
- if (!Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a)) throw RangeError("range: start, stop, and step must be finite numbers");
17
- if (a === 0) throw RangeError("range: step cannot be 0");
18
- if (r === i) return [];
19
- let o = (i - r) / a, s = Math.max(0, Number.isInteger(o) ? o : Math.ceil(o + 2 ** -52));
20
- if (s > 1e7) throw RangeError("range: exceeds maximum allowed size of 10,000,000");
21
- return Array.from({ length: s }, (e, t) => r + t * a);
22
- }
23
- //#endregion
24
- export { e as range };
25
-
1
+ function range(e,t,n){let[r,i,a]=t===void 0?[0,e,1]:n===void 0?[e,t,1]:[e,t,n];if(!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))throw RangeError(`range: start, stop, and step must be finite numbers`);if(a===0)throw RangeError(`range: step cannot be 0`);if(r===i)return[];let o=(i-r)/a,s=Math.max(0,Number.isInteger(o)?o:Math.ceil(o+2**-52));if(s>1e7)throw RangeError(`range: exceeds maximum allowed size of 10,000,000`);return Array.from({length:s},(e,t)=>r+t*a)}export{range};
26
2
  //# sourceMappingURL=range.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"range.js","names":[],"sources":["../../src/math/range.ts"],"sourcesContent":["/**\n * Creates an array of numbers from `0` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(5) // [0, 1, 2, 3, 4]\n * ```\n */\nexport function range(stop: number): number[];\n/**\n * Creates an array of numbers from `start` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(2, 6) // [2, 3, 4, 5]\n * ```\n */\nexport function range(start: number, stop: number): number[];\n/**\n * Creates an array of numbers progressing from `start` up to, but not including, `stop` with a given `step`.\n *\n * @example\n * ```ts\n * range(0, 10, 2) // [0, 2, 4, 6, 8]\n * range(10, 0, -2) // [10, 8, 6, 4, 2]\n * ```\n *\n * @param start - The start of the range.\n * @param stop - The end of the range (exclusive).\n * @param step - The value to increment or decrement by.\n *\n * @returns The range of numbers.\n *\n * @throws {RangeError} If start, stop, or step are not finite numbers, step is 0, or range exceeds maximum size.\n */\nexport function range(start: number, stop: number, step: number): number[];\nexport function range(startOrStop: number, stop?: number, step?: number): number[] {\n const [resolvedStart, resolvedStop, resolvedStep] =\n stop === undefined ? [0, startOrStop, 1] : step === undefined ? [startOrStop, stop, 1] : [startOrStop, stop, step];\n\n if (!Number.isFinite(resolvedStart) || !Number.isFinite(resolvedStop) || !Number.isFinite(resolvedStep)) {\n throw new RangeError('range: start, stop, and step must be finite numbers');\n }\n\n if (resolvedStep === 0) throw new RangeError('range: step cannot be 0');\n\n if (resolvedStart === resolvedStop) {\n return [];\n }\n\n const raw = (resolvedStop - resolvedStart) / resolvedStep;\n const length = Math.max(0, Number.isInteger(raw) ? raw : Math.ceil(raw + Number.EPSILON));\n\n if (length > 10_000_000) throw new RangeError('range: exceeds maximum allowed size of 10,000,000');\n\n return Array.from({ length }, (_, i) => resolvedStart + i * resolvedStep);\n}\n"],"mappings":";AAoCA,SAAgB,EAAM,GAAqB,GAAe,GAAyB;CACjF,IAAM,CAAC,GAAe,GAAc,KAClC,MAAS,KAAA,IAAY;EAAC;EAAG;EAAa;CAAC,IAAI,MAAS,KAAA,IAAY;EAAC;EAAa;EAAM;CAAC,IAAI;EAAC;EAAa;EAAM;CAAI;CAEnH,IAAI,CAAC,OAAO,SAAS,CAAa,KAAK,CAAC,OAAO,SAAS,CAAY,KAAK,CAAC,OAAO,SAAS,CAAY,GACpG,MAAU,WAAW,qDAAqD;CAG5E,IAAI,MAAiB,GAAG,MAAU,WAAW,yBAAyB;CAEtE,IAAI,MAAkB,GACpB,OAAO,CAAC;CAGV,IAAM,KAAO,IAAe,KAAiB,GACvC,IAAS,KAAK,IAAI,GAAG,OAAO,UAAU,CAAG,IAAI,IAAM,KAAK,KAAK,YAAoB,CAAC;CAExF,IAAI,IAAS,KAAY,MAAU,WAAW,mDAAmD;CAEjG,OAAO,MAAM,KAAK,EAAE,UAAO,IAAI,GAAG,MAAM,IAAgB,IAAI,CAAY;AAC1E"}
1
+ {"version":3,"file":"range.js","names":[],"sources":["../../src/math/range.ts"],"sourcesContent":["/**\n * Creates an array of numbers from `0` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(5) // [0, 1, 2, 3, 4]\n * ```\n */\nexport function range(stop: number): number[];\n/**\n * Creates an array of numbers from `start` up to, but not including, `stop` with step `1`.\n *\n * @example\n * ```ts\n * range(2, 6) // [2, 3, 4, 5]\n * ```\n */\nexport function range(start: number, stop: number): number[];\n/**\n * Creates an array of numbers progressing from `start` up to, but not including, `stop` with a given `step`.\n *\n * @example\n * ```ts\n * range(0, 10, 2) // [0, 2, 4, 6, 8]\n * range(10, 0, -2) // [10, 8, 6, 4, 2]\n * ```\n *\n * @param start - The start of the range.\n * @param stop - The end of the range (exclusive).\n * @param step - The value to increment or decrement by.\n *\n * @returns The range of numbers.\n *\n * @throws {RangeError} If start, stop, or step are not finite numbers, step is 0, or range exceeds maximum size.\n */\nexport function range(start: number, stop: number, step: number): number[];\nexport function range(startOrStop: number, stop?: number, step?: number): number[] {\n const [resolvedStart, resolvedStop, resolvedStep] =\n stop === undefined ? [0, startOrStop, 1] : step === undefined ? [startOrStop, stop, 1] : [startOrStop, stop, step];\n\n if (!Number.isFinite(resolvedStart) || !Number.isFinite(resolvedStop) || !Number.isFinite(resolvedStep)) {\n throw new RangeError('range: start, stop, and step must be finite numbers');\n }\n\n if (resolvedStep === 0) throw new RangeError('range: step cannot be 0');\n\n if (resolvedStart === resolvedStop) {\n return [];\n }\n\n const raw = (resolvedStop - resolvedStart) / resolvedStep;\n const length = Math.max(0, Number.isInteger(raw) ? raw : Math.ceil(raw + Number.EPSILON));\n\n if (length > 10_000_000) throw new RangeError('range: exceeds maximum allowed size of 10,000,000');\n\n return Array.from({ length }, (_, i) => resolvedStart + i * resolvedStep);\n}\n"],"mappings":"AAoCA,SAAgB,MAAM,EAAqB,EAAe,EAAyB,CACjF,GAAM,CAAC,EAAe,EAAc,GAClC,IAAS,IAAA,GAAY,CAAC,EAAG,EAAa,CAAC,EAAI,IAAS,IAAA,GAAY,CAAC,EAAa,EAAM,CAAC,EAAI,CAAC,EAAa,EAAM,CAAI,EAEnH,GAAI,CAAC,OAAO,SAAS,CAAa,GAAK,CAAC,OAAO,SAAS,CAAY,GAAK,CAAC,OAAO,SAAS,CAAY,EACpG,MAAU,WAAW,qDAAqD,EAG5E,GAAI,IAAiB,EAAG,MAAU,WAAW,yBAAyB,EAEtE,GAAI,IAAkB,EACpB,MAAO,CAAC,EAGV,IAAM,GAAO,EAAe,GAAiB,EACvC,EAAS,KAAK,IAAI,EAAG,OAAO,UAAU,CAAG,EAAI,EAAM,KAAK,KAAK,QAAoB,CAAC,EAExF,GAAI,EAAS,IAAY,MAAU,WAAW,mDAAmD,EAEjG,OAAO,MAAM,KAAK,CAAE,QAAO,GAAI,EAAG,IAAM,EAAgB,EAAI,CAAY,CAC1E"}
@@ -1,2 +1,2 @@
1
- function e(e,t=0,n=Math.round){if(t===0)return n(e);let r=10**Math.max(-323,Math.min(t,292));return n(e*r)/r}exports.round=e;
1
+ function round(e,t=0,n=Math.round){if(t===0)return n(e);let r=10**Math.max(-323,Math.min(t,292));return n(e*r)/r}exports.round=round;
2
2
  //# sourceMappingURL=round.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"round.cjs","names":[],"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified number of decimal places.\n *\n * The `precision` argument is limited to be within the range of -323 to +292 to avoid NaN results.\n *\n * @example\n * ```ts\n * round(123.456) // 123\n * round(123.456, -1) // 120\n * round(123.456, 1, Math.ceil) // 123.5\n * round(123.456, 1, Math.floor) // 123.4\n * ```\n *\n * @param value - The number to round.\n * @param precision - The number of decimal places to round to.\n * @param [parser] - (optional) function to convert the number to a value.\n *\n * @returns The rounded number.\n */\nexport function round(value: number, precision = 0, parser: (value: number) => number = Math.round): number {\n if (precision === 0) return parser(value);\n\n const factor = 10 ** Math.max(-323, Math.min(precision, 292));\n\n return parser(value * factor) / factor;\n}\n"],"mappings":"AAmBA,SAAgB,EAAM,EAAe,EAAY,EAAG,EAAoC,KAAK,MAAe,CAC1G,GAAI,IAAc,EAAG,OAAO,EAAO,CAAK,EAExC,IAAM,EAAS,IAAM,KAAK,IAAI,KAAM,KAAK,IAAI,EAAW,GAAG,CAAC,EAE5D,OAAO,EAAO,EAAQ,CAAM,EAAI,CAClC"}
1
+ {"version":3,"file":"round.cjs","names":[],"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified number of decimal places.\n *\n * The `precision` argument is limited to be within the range of -323 to +292 to avoid NaN results.\n *\n * @example\n * ```ts\n * round(123.456) // 123\n * round(123.456, -1) // 120\n * round(123.456, 1, Math.ceil) // 123.5\n * round(123.456, 1, Math.floor) // 123.4\n * ```\n *\n * @param value - The number to round.\n * @param precision - The number of decimal places to round to.\n * @param [parser] - (optional) function to convert the number to a value.\n *\n * @returns The rounded number.\n */\nexport function round(value: number, precision = 0, parser: (value: number) => number = Math.round): number {\n if (precision === 0) return parser(value);\n\n const factor = 10 ** Math.max(-323, Math.min(precision, 292));\n\n return parser(value * factor) / factor;\n}\n"],"mappings":"AAmBA,SAAgB,MAAM,EAAe,EAAY,EAAG,EAAoC,KAAK,MAAe,CAC1G,GAAI,IAAc,EAAG,OAAO,EAAO,CAAK,EAExC,IAAM,EAAS,IAAM,KAAK,IAAI,KAAM,KAAK,IAAI,EAAW,GAAG,CAAC,EAE5D,OAAO,EAAO,EAAQ,CAAM,EAAI,CAClC"}
@@ -1,10 +1,2 @@
1
- //#region src/math/round.ts
2
- function e(e, t = 0, n = Math.round) {
3
- if (t === 0) return n(e);
4
- let r = 10 ** Math.max(-323, Math.min(t, 292));
5
- return n(e * r) / r;
6
- }
7
- //#endregion
8
- export { e as round };
9
-
1
+ function round(e,t=0,n=Math.round){if(t===0)return n(e);let r=10**Math.max(-323,Math.min(t,292));return n(e*r)/r}export{round};
10
2
  //# sourceMappingURL=round.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"round.js","names":[],"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified number of decimal places.\n *\n * The `precision` argument is limited to be within the range of -323 to +292 to avoid NaN results.\n *\n * @example\n * ```ts\n * round(123.456) // 123\n * round(123.456, -1) // 120\n * round(123.456, 1, Math.ceil) // 123.5\n * round(123.456, 1, Math.floor) // 123.4\n * ```\n *\n * @param value - The number to round.\n * @param precision - The number of decimal places to round to.\n * @param [parser] - (optional) function to convert the number to a value.\n *\n * @returns The rounded number.\n */\nexport function round(value: number, precision = 0, parser: (value: number) => number = Math.round): number {\n if (precision === 0) return parser(value);\n\n const factor = 10 ** Math.max(-323, Math.min(precision, 292));\n\n return parser(value * factor) / factor;\n}\n"],"mappings":";AAmBA,SAAgB,EAAM,GAAe,IAAY,GAAG,IAAoC,KAAK,OAAe;CAC1G,IAAI,MAAc,GAAG,OAAO,EAAO,CAAK;CAExC,IAAM,IAAS,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,GAAW,GAAG,CAAC;CAE5D,OAAO,EAAO,IAAQ,CAAM,IAAI;AAClC"}
1
+ {"version":3,"file":"round.js","names":[],"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified number of decimal places.\n *\n * The `precision` argument is limited to be within the range of -323 to +292 to avoid NaN results.\n *\n * @example\n * ```ts\n * round(123.456) // 123\n * round(123.456, -1) // 120\n * round(123.456, 1, Math.ceil) // 123.5\n * round(123.456, 1, Math.floor) // 123.4\n * ```\n *\n * @param value - The number to round.\n * @param precision - The number of decimal places to round to.\n * @param [parser] - (optional) function to convert the number to a value.\n *\n * @returns The rounded number.\n */\nexport function round(value: number, precision = 0, parser: (value: number) => number = Math.round): number {\n if (precision === 0) return parser(value);\n\n const factor = 10 ** Math.max(-323, Math.min(precision, 292));\n\n return parser(value * factor) / factor;\n}\n"],"mappings":"AAmBA,SAAgB,MAAM,EAAe,EAAY,EAAG,EAAoC,KAAK,MAAe,CAC1G,GAAI,IAAc,EAAG,OAAO,EAAO,CAAK,EAExC,IAAM,EAAS,IAAM,KAAK,IAAI,KAAM,KAAK,IAAI,EAAW,GAAG,CAAC,EAE5D,OAAO,EAAO,EAAQ,CAAM,EAAI,CAClC"}
@@ -1,2 +1,2 @@
1
- const e=require("./variance.cjs");function t(t,n){return Math.sqrt(e.variance(t,n))}exports.standardDeviation=t;
1
+ const e=require("./variance.cjs");function standardDeviation(t,n){return Math.sqrt(e.variance(t,n))}exports.standardDeviation=standardDeviation;
2
2
  //# sourceMappingURL=standardDeviation.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"standardDeviation.cjs","names":[],"sources":["../../src/math/standardDeviation.ts"],"sourcesContent":["import { variance } from './variance';\n\n/**\n * Computes the population standard deviation (square root of `variance`) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * standardDeviation([2, 4, 4, 4, 5, 5, 7, 9]); // 2\n * standardDeviation([]); // 0\n * ```\n *\n * @param array - The array to compute standard deviation over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population standard deviation, or `0` for an empty array.\n */\nexport function standardDeviation<T>(array: readonly T[], callback?: (item: T) => number): number {\n return Math.sqrt(variance(array, callback));\n}\n"],"mappings":"kCAgBA,SAAgB,EAAqB,EAAqB,EAAwC,CAChG,OAAO,KAAK,KAAK,EAAA,SAAS,EAAO,CAAQ,CAAC,CAC5C"}
1
+ {"version":3,"file":"standardDeviation.cjs","names":[],"sources":["../../src/math/standardDeviation.ts"],"sourcesContent":["import { variance } from './variance';\n\n/**\n * Computes the population standard deviation (square root of `variance`) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * standardDeviation([2, 4, 4, 4, 5, 5, 7, 9]); // 2\n * standardDeviation([]); // 0\n * ```\n *\n * @param array - The array to compute standard deviation over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population standard deviation, or `0` for an empty array.\n */\nexport function standardDeviation<T>(array: readonly T[], callback?: (item: T) => number): number {\n return Math.sqrt(variance(array, callback));\n}\n"],"mappings":"kCAgBA,SAAgB,kBAAqB,EAAqB,EAAwC,CAChG,OAAO,KAAK,KAAK,EAAA,SAAS,EAAO,CAAQ,CAAC,CAC5C"}
@@ -1,9 +1,2 @@
1
- import { variance as e } from "./variance.js";
2
- //#region src/math/standardDeviation.ts
3
- function t(t, n) {
4
- return Math.sqrt(e(t, n));
5
- }
6
- //#endregion
7
- export { t as standardDeviation };
8
-
1
+ import{variance as e}from"./variance.js";function standardDeviation(t,n){return Math.sqrt(e(t,n))}export{standardDeviation};
9
2
  //# sourceMappingURL=standardDeviation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standardDeviation.js","names":[],"sources":["../../src/math/standardDeviation.ts"],"sourcesContent":["import { variance } from './variance';\n\n/**\n * Computes the population standard deviation (square root of `variance`) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * standardDeviation([2, 4, 4, 4, 5, 5, 7, 9]); // 2\n * standardDeviation([]); // 0\n * ```\n *\n * @param array - The array to compute standard deviation over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population standard deviation, or `0` for an empty array.\n */\nexport function standardDeviation<T>(array: readonly T[], callback?: (item: T) => number): number {\n return Math.sqrt(variance(array, callback));\n}\n"],"mappings":";;AAgBA,SAAgB,EAAqB,GAAqB,GAAwC;CAChG,OAAO,KAAK,KAAK,EAAS,GAAO,CAAQ,CAAC;AAC5C"}
1
+ {"version":3,"file":"standardDeviation.js","names":[],"sources":["../../src/math/standardDeviation.ts"],"sourcesContent":["import { variance } from './variance';\n\n/**\n * Computes the population standard deviation (square root of `variance`) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * standardDeviation([2, 4, 4, 4, 5, 5, 7, 9]); // 2\n * standardDeviation([]); // 0\n * ```\n *\n * @param array - The array to compute standard deviation over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population standard deviation, or `0` for an empty array.\n */\nexport function standardDeviation<T>(array: readonly T[], callback?: (item: T) => number): number {\n return Math.sqrt(variance(array, callback));\n}\n"],"mappings":"yCAgBA,SAAgB,kBAAqB,EAAqB,EAAwC,CAChG,OAAO,KAAK,KAAK,EAAS,EAAO,CAAQ,CAAC,CAC5C"}
package/dist/math/sum.cjs CHANGED
@@ -1,2 +1,2 @@
1
- function e(e,t){return e.length===0?0:e.reduce((e,n)=>{let r=t?t(n):n;if(!Number.isFinite(r))throw TypeError(`sum: encountered a non-numeric value; provide a callback to map non-number items`);return e+r},0)}exports.sum=e;
1
+ function sum(e,t){return e.length===0?0:e.reduce((e,n)=>{let r=t?t(n):n;if(!Number.isFinite(r))throw TypeError(`sum: encountered a non-numeric value; provide a callback to map non-number items`);return e+r},0)}exports.sum=sum;
2
2
  //# sourceMappingURL=sum.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sum.cjs","names":[],"sources":["../../src/math/sum.ts"],"sourcesContent":["/**\n * Sum numbers in an array or numbers mapped by a callback function.\n *\n * @example\n * ```ts\n * sum([1, 2, 3]) // 6\n * sum([{value: 1}, {value: 2}, {value: 3}], (item) => item.value) // 6\n * sum(['apple', 'banana', 'cherry']) // TypeError\n * ```\n *\n * @param array - The array to sum.\n * @param callback - An optional callback function to map the values.\n *\n * @returns The sum of the numbers in the array or the sum of the mapped values.\n *\n * @throws {TypeError} If (after an optional `callback` mapping) any item is not a finite number.\n */\nexport function sum<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n return array.reduce<number>((acc, item) => {\n const val = callback ? callback(item) : (item as unknown as number);\n\n if (!Number.isFinite(val)) {\n throw new TypeError('sum: encountered a non-numeric value; provide a callback to map non-number items');\n }\n\n return acc + val;\n }, 0);\n}\n"],"mappings":"AAiBA,SAAgB,EAAO,EAAqB,EAAwC,CAGlF,OAFI,EAAM,SAAW,EAAU,EAExB,EAAM,QAAgB,EAAK,IAAS,CACzC,IAAM,EAAM,EAAW,EAAS,CAAI,EAAK,EAEzC,GAAI,CAAC,OAAO,SAAS,CAAG,EACtB,MAAU,UAAU,kFAAkF,EAGxG,OAAO,EAAM,CACf,EAAG,CAAC,CACN"}
1
+ {"version":3,"file":"sum.cjs","names":[],"sources":["../../src/math/sum.ts"],"sourcesContent":["/**\n * Sum numbers in an array or numbers mapped by a callback function.\n *\n * @example\n * ```ts\n * sum([1, 2, 3]) // 6\n * sum([{value: 1}, {value: 2}, {value: 3}], (item) => item.value) // 6\n * sum(['apple', 'banana', 'cherry']) // TypeError\n * ```\n *\n * @param array - The array to sum.\n * @param callback - An optional callback function to map the values.\n *\n * @returns The sum of the numbers in the array or the sum of the mapped values.\n *\n * @throws {TypeError} If (after an optional `callback` mapping) any item is not a finite number.\n */\nexport function sum<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n return array.reduce<number>((acc, item) => {\n const val = callback ? callback(item) : (item as unknown as number);\n\n if (!Number.isFinite(val)) {\n throw new TypeError('sum: encountered a non-numeric value; provide a callback to map non-number items');\n }\n\n return acc + val;\n }, 0);\n}\n"],"mappings":"AAiBA,SAAgB,IAAO,EAAqB,EAAwC,CAGlF,OAFI,EAAM,SAAW,EAAU,EAExB,EAAM,QAAgB,EAAK,IAAS,CACzC,IAAM,EAAM,EAAW,EAAS,CAAI,EAAK,EAEzC,GAAI,CAAC,OAAO,SAAS,CAAG,EACtB,MAAU,UAAU,kFAAkF,EAGxG,OAAO,EAAM,CACf,EAAG,CAAC,CACN"}
package/dist/math/sum.js CHANGED
@@ -1,12 +1,2 @@
1
- //#region src/math/sum.ts
2
- function e(e, t) {
3
- return e.length === 0 ? 0 : e.reduce((e, n) => {
4
- let r = t ? t(n) : n;
5
- if (!Number.isFinite(r)) throw TypeError("sum: encountered a non-numeric value; provide a callback to map non-number items");
6
- return e + r;
7
- }, 0);
8
- }
9
- //#endregion
10
- export { e as sum };
11
-
1
+ function sum(e,t){return e.length===0?0:e.reduce((e,n)=>{let r=t?t(n):n;if(!Number.isFinite(r))throw TypeError(`sum: encountered a non-numeric value; provide a callback to map non-number items`);return e+r},0)}export{sum};
12
2
  //# sourceMappingURL=sum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sum.js","names":[],"sources":["../../src/math/sum.ts"],"sourcesContent":["/**\n * Sum numbers in an array or numbers mapped by a callback function.\n *\n * @example\n * ```ts\n * sum([1, 2, 3]) // 6\n * sum([{value: 1}, {value: 2}, {value: 3}], (item) => item.value) // 6\n * sum(['apple', 'banana', 'cherry']) // TypeError\n * ```\n *\n * @param array - The array to sum.\n * @param callback - An optional callback function to map the values.\n *\n * @returns The sum of the numbers in the array or the sum of the mapped values.\n *\n * @throws {TypeError} If (after an optional `callback` mapping) any item is not a finite number.\n */\nexport function sum<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n return array.reduce<number>((acc, item) => {\n const val = callback ? callback(item) : (item as unknown as number);\n\n if (!Number.isFinite(val)) {\n throw new TypeError('sum: encountered a non-numeric value; provide a callback to map non-number items');\n }\n\n return acc + val;\n }, 0);\n}\n"],"mappings":";AAiBA,SAAgB,EAAO,GAAqB,GAAwC;CAGlF,OAFI,EAAM,WAAW,IAAU,IAExB,EAAM,QAAgB,GAAK,MAAS;EACzC,IAAM,IAAM,IAAW,EAAS,CAAI,IAAK;EAEzC,IAAI,CAAC,OAAO,SAAS,CAAG,GACtB,MAAU,UAAU,kFAAkF;EAGxG,OAAO,IAAM;CACf,GAAG,CAAC;AACN"}
1
+ {"version":3,"file":"sum.js","names":[],"sources":["../../src/math/sum.ts"],"sourcesContent":["/**\n * Sum numbers in an array or numbers mapped by a callback function.\n *\n * @example\n * ```ts\n * sum([1, 2, 3]) // 6\n * sum([{value: 1}, {value: 2}, {value: 3}], (item) => item.value) // 6\n * sum(['apple', 'banana', 'cherry']) // TypeError\n * ```\n *\n * @param array - The array to sum.\n * @param callback - An optional callback function to map the values.\n *\n * @returns The sum of the numbers in the array or the sum of the mapped values.\n *\n * @throws {TypeError} If (after an optional `callback` mapping) any item is not a finite number.\n */\nexport function sum<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n return array.reduce<number>((acc, item) => {\n const val = callback ? callback(item) : (item as unknown as number);\n\n if (!Number.isFinite(val)) {\n throw new TypeError('sum: encountered a non-numeric value; provide a callback to map non-number items');\n }\n\n return acc + val;\n }, 0);\n}\n"],"mappings":"AAiBA,SAAgB,IAAO,EAAqB,EAAwC,CAGlF,OAFI,EAAM,SAAW,EAAU,EAExB,EAAM,QAAgB,EAAK,IAAS,CACzC,IAAM,EAAM,EAAW,EAAS,CAAI,EAAK,EAEzC,GAAI,CAAC,OAAO,SAAS,CAAG,EACtB,MAAU,UAAU,kFAAkF,EAGxG,OAAO,EAAM,CACf,EAAG,CAAC,CACN"}
@@ -1,2 +1,2 @@
1
- const e=require("./average.cjs");function t(t,n){if(t.length===0)return 0;let r=n?t.map(n):t,i=e.average(r)??0;return e.average(r.map(e=>(e-i)**2))??0}exports.variance=t;
1
+ const e=require("./average.cjs");function variance(t,n){if(t.length===0)return 0;let r=n?t.map(n):t,i=e.average(r)??0;return e.average(r.map(e=>(e-i)**2))??0}exports.variance=variance;
2
2
  //# sourceMappingURL=variance.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"variance.cjs","names":[],"sources":["../../src/math/variance.ts"],"sourcesContent":["import { average } from './average';\n\n/**\n * Computes the population variance (average squared deviation from the mean) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * variance([2, 4, 4, 4, 5, 5, 7, 9]); // 4\n * variance([{ n: 1 }, { n: 3 }], (item) => item.n); // 1\n * variance([]); // 0\n * ```\n *\n * @param array - The array to compute variance over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population variance, or `0` for an empty array.\n */\nexport function variance<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n const values = callback ? array.map(callback) : (array as unknown as number[]);\n const mean = average(values) ?? 0;\n\n return average(values.map((value) => (value - mean) ** 2)) ?? 0;\n}\n"],"mappings":"iCAiBA,SAAgB,EAAY,EAAqB,EAAwC,CACvF,GAAI,EAAM,SAAW,EAAG,MAAO,GAE/B,IAAM,EAAS,EAAW,EAAM,IAAI,CAAQ,EAAK,EAC3C,EAAO,EAAA,QAAQ,CAAM,GAAK,EAEhC,OAAO,EAAA,QAAQ,EAAO,IAAK,IAAW,EAAQ,IAAS,CAAC,CAAC,GAAK,CAChE"}
1
+ {"version":3,"file":"variance.cjs","names":[],"sources":["../../src/math/variance.ts"],"sourcesContent":["import { average } from './average';\n\n/**\n * Computes the population variance (average squared deviation from the mean) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * variance([2, 4, 4, 4, 5, 5, 7, 9]); // 4\n * variance([{ n: 1 }, { n: 3 }], (item) => item.n); // 1\n * variance([]); // 0\n * ```\n *\n * @param array - The array to compute variance over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population variance, or `0` for an empty array.\n */\nexport function variance<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n const values = callback ? array.map(callback) : (array as unknown as number[]);\n const mean = average(values) ?? 0;\n\n return average(values.map((value) => (value - mean) ** 2)) ?? 0;\n}\n"],"mappings":"iCAiBA,SAAgB,SAAY,EAAqB,EAAwC,CACvF,GAAI,EAAM,SAAW,EAAG,MAAO,GAE/B,IAAM,EAAS,EAAW,EAAM,IAAI,CAAQ,EAAK,EAC3C,EAAO,EAAA,QAAQ,CAAM,GAAK,EAEhC,OAAO,EAAA,QAAQ,EAAO,IAAK,IAAW,EAAQ,IAAS,CAAC,CAAC,GAAK,CAChE"}
@@ -1,11 +1,2 @@
1
- import { average as e } from "./average.js";
2
- //#region src/math/variance.ts
3
- function t(t, n) {
4
- if (t.length === 0) return 0;
5
- let r = n ? t.map(n) : t, i = e(r) ?? 0;
6
- return e(r.map((e) => (e - i) ** 2)) ?? 0;
7
- }
8
- //#endregion
9
- export { t as variance };
10
-
1
+ import{average as e}from"./average.js";function variance(t,n){if(t.length===0)return 0;let r=n?t.map(n):t,i=e(r)??0;return e(r.map(e=>(e-i)**2))??0}export{variance};
11
2
  //# sourceMappingURL=variance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"variance.js","names":[],"sources":["../../src/math/variance.ts"],"sourcesContent":["import { average } from './average';\n\n/**\n * Computes the population variance (average squared deviation from the mean) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * variance([2, 4, 4, 4, 5, 5, 7, 9]); // 4\n * variance([{ n: 1 }, { n: 3 }], (item) => item.n); // 1\n * variance([]); // 0\n * ```\n *\n * @param array - The array to compute variance over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population variance, or `0` for an empty array.\n */\nexport function variance<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n const values = callback ? array.map(callback) : (array as unknown as number[]);\n const mean = average(values) ?? 0;\n\n return average(values.map((value) => (value - mean) ** 2)) ?? 0;\n}\n"],"mappings":";;AAiBA,SAAgB,EAAY,GAAqB,GAAwC;CACvF,IAAI,EAAM,WAAW,GAAG,OAAO;CAE/B,IAAM,IAAS,IAAW,EAAM,IAAI,CAAQ,IAAK,GAC3C,IAAO,EAAQ,CAAM,KAAK;CAEhC,OAAO,EAAQ,EAAO,KAAK,OAAW,IAAQ,MAAS,CAAC,CAAC,KAAK;AAChE"}
1
+ {"version":3,"file":"variance.js","names":[],"sources":["../../src/math/variance.ts"],"sourcesContent":["import { average } from './average';\n\n/**\n * Computes the population variance (average squared deviation from the mean) of an array of\n * numbers, or of values mapped by a callback.\n *\n * @example\n * ```ts\n * variance([2, 4, 4, 4, 5, 5, 7, 9]); // 4\n * variance([{ n: 1 }, { n: 3 }], (item) => item.n); // 1\n * variance([]); // 0\n * ```\n *\n * @param array - The array to compute variance over.\n * @param callback - An optional callback to map each item to a number.\n * @returns The population variance, or `0` for an empty array.\n */\nexport function variance<T>(array: readonly T[], callback?: (item: T) => number): number {\n if (array.length === 0) return 0;\n\n const values = callback ? array.map(callback) : (array as unknown as number[]);\n const mean = average(values) ?? 0;\n\n return average(values.map((value) => (value - mean) ** 2)) ?? 0;\n}\n"],"mappings":"uCAiBA,SAAgB,SAAY,EAAqB,EAAwC,CACvF,GAAI,EAAM,SAAW,EAAG,MAAO,GAE/B,IAAM,EAAS,EAAW,EAAM,IAAI,CAAQ,EAAK,EAC3C,EAAO,EAAQ,CAAM,GAAK,EAEhC,OAAO,EAAQ,EAAO,IAAK,IAAW,EAAQ,IAAS,CAAC,CAAC,GAAK,CAChE"}
@@ -1,2 +1,2 @@
1
- const e=require("../_common/unsafePaths.cjs"),t=require("../guards/isPlainObject.cjs");function n(n,...r){let i={...n};for(let n of r)if(t.isPlainObject(n))for(let t of Object.keys(n))e.isUnsafeKey(t)||i[t]===void 0&&(i[t]=n[t]);return i}exports.defaults=n;
1
+ const e=require("../_common/unsafePaths.cjs"),t=require("../guards/isPlainObject.cjs");function defaults(n,...r){let i={...n};for(let n of r)if(t.isPlainObject(n))for(let t of Object.keys(n))e.isUnsafeKey(t)||i[t]===void 0&&(i[t]=n[t]);return i}exports.defaults=defaults;
2
2
  //# sourceMappingURL=defaults.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.cjs","names":[],"sources":["../../src/object/defaults.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\nimport type { Obj } from '../types';\n\n/**\n * Fills in `undefined` properties in `target` with values from `sources`. First source wins\n * — unlike `shallowMerge`, already-set keys are never overwritten.\n *\n * @example\n * ```ts\n * defaults({ a: 1, b: undefined }, { a: 99, b: 2, c: 3 });\n * // { a: 1, b: 2, c: 3 }\n * ```\n *\n * @param target - The object to fill in.\n * @param sources - One or more partial objects supplying default values.\n * @returns A new object with missing keys filled from `sources`.\n */\nexport function defaults<T extends Obj>(target: T, ...sources: Array<Partial<T>>): T {\n const out = { ...target };\n\n for (const source of sources) {\n if (!isPlainObject(source)) continue;\n\n for (const key of Object.keys(source) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (out[key] === undefined) {\n out[key] = source[key] as T[keyof T];\n }\n }\n }\n\n return out;\n}\n"],"mappings":"uFAkBA,SAAgB,EAAwB,EAAW,GAAG,EAA+B,CACnF,IAAM,EAAM,CAAE,GAAG,CAAO,EAExB,IAAK,IAAM,KAAU,EACd,KAAA,cAAc,CAAM,EAEzB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAM,EAC9B,EAAA,YAAY,CAAkB,GAE9B,EAAI,KAAS,IAAA,KACf,EAAI,GAAO,EAAO,IAKxB,OAAO,CACT"}
1
+ {"version":3,"file":"defaults.cjs","names":[],"sources":["../../src/object/defaults.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\nimport type { Obj } from '../types';\n\n/**\n * Fills in `undefined` properties in `target` with values from `sources`. First source wins\n * — unlike `shallowMerge`, already-set keys are never overwritten.\n *\n * @example\n * ```ts\n * defaults({ a: 1, b: undefined }, { a: 99, b: 2, c: 3 });\n * // { a: 1, b: 2, c: 3 }\n * ```\n *\n * @param target - The object to fill in.\n * @param sources - One or more partial objects supplying default values.\n * @returns A new object with missing keys filled from `sources`.\n */\nexport function defaults<T extends Obj>(target: T, ...sources: Array<Partial<T>>): T {\n const out = { ...target };\n\n for (const source of sources) {\n if (!isPlainObject(source)) continue;\n\n for (const key of Object.keys(source) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (out[key] === undefined) {\n out[key] = source[key] as T[keyof T];\n }\n }\n }\n\n return out;\n}\n"],"mappings":"uFAkBA,SAAgB,SAAwB,EAAW,GAAG,EAA+B,CACnF,IAAM,EAAM,CAAE,GAAG,CAAO,EAExB,IAAK,IAAM,KAAU,EACd,KAAA,cAAc,CAAM,EAEzB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAM,EAC9B,EAAA,YAAY,CAAkB,GAE9B,EAAI,KAAS,IAAA,KACf,EAAI,GAAO,EAAO,IAKxB,OAAO,CACT"}
@@ -1,12 +1,2 @@
1
- import { isUnsafeKey as e } from "../_common/unsafePaths.js";
2
- import { isPlainObject as t } from "../guards/isPlainObject.js";
3
- //#region src/object/defaults.ts
4
- function n(n, ...r) {
5
- let i = { ...n };
6
- for (let n of r) if (t(n)) for (let t of Object.keys(n)) e(t) || i[t] === void 0 && (i[t] = n[t]);
7
- return i;
8
- }
9
- //#endregion
10
- export { n as defaults };
11
-
1
+ import{isUnsafeKey as e}from"../_common/unsafePaths.js";import{isPlainObject as t}from"../guards/isPlainObject.js";function defaults(n,...r){let i={...n};for(let n of r)if(t(n))for(let t of Object.keys(n))e(t)||i[t]===void 0&&(i[t]=n[t]);return i}export{defaults};
12
2
  //# sourceMappingURL=defaults.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","names":[],"sources":["../../src/object/defaults.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\nimport type { Obj } from '../types';\n\n/**\n * Fills in `undefined` properties in `target` with values from `sources`. First source wins\n * — unlike `shallowMerge`, already-set keys are never overwritten.\n *\n * @example\n * ```ts\n * defaults({ a: 1, b: undefined }, { a: 99, b: 2, c: 3 });\n * // { a: 1, b: 2, c: 3 }\n * ```\n *\n * @param target - The object to fill in.\n * @param sources - One or more partial objects supplying default values.\n * @returns A new object with missing keys filled from `sources`.\n */\nexport function defaults<T extends Obj>(target: T, ...sources: Array<Partial<T>>): T {\n const out = { ...target };\n\n for (const source of sources) {\n if (!isPlainObject(source)) continue;\n\n for (const key of Object.keys(source) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (out[key] === undefined) {\n out[key] = source[key] as T[keyof T];\n }\n }\n }\n\n return out;\n}\n"],"mappings":";;;AAkBA,SAAgB,EAAwB,GAAW,GAAG,GAA+B;CACnF,IAAM,IAAM,EAAE,GAAG,EAAO;CAExB,KAAK,IAAM,KAAU,GACd,MAAc,CAAM,GAEzB,KAAK,IAAM,KAAO,OAAO,KAAK,CAAM,GAC9B,EAAY,CAAkB,KAE9B,EAAI,OAAS,KAAA,MACf,EAAI,KAAO,EAAO;CAKxB,OAAO;AACT"}
1
+ {"version":3,"file":"defaults.js","names":[],"sources":["../../src/object/defaults.ts"],"sourcesContent":["import { isUnsafeKey } from '../_common/unsafePaths';\nimport { isPlainObject } from '../guards/isPlainObject';\nimport type { Obj } from '../types';\n\n/**\n * Fills in `undefined` properties in `target` with values from `sources`. First source wins\n * — unlike `shallowMerge`, already-set keys are never overwritten.\n *\n * @example\n * ```ts\n * defaults({ a: 1, b: undefined }, { a: 99, b: 2, c: 3 });\n * // { a: 1, b: 2, c: 3 }\n * ```\n *\n * @param target - The object to fill in.\n * @param sources - One or more partial objects supplying default values.\n * @returns A new object with missing keys filled from `sources`.\n */\nexport function defaults<T extends Obj>(target: T, ...sources: Array<Partial<T>>): T {\n const out = { ...target };\n\n for (const source of sources) {\n if (!isPlainObject(source)) continue;\n\n for (const key of Object.keys(source) as Array<keyof T>) {\n if (isUnsafeKey(key as PropertyKey)) continue;\n\n if (out[key] === undefined) {\n out[key] = source[key] as T[keyof T];\n }\n }\n }\n\n return out;\n}\n"],"mappings":"mHAkBA,SAAgB,SAAwB,EAAW,GAAG,EAA+B,CACnF,IAAM,EAAM,CAAE,GAAG,CAAO,EAExB,IAAK,IAAM,KAAU,EACd,KAAc,CAAM,EAEzB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAM,EAC9B,EAAY,CAAkB,GAE9B,EAAI,KAAS,IAAA,KACf,EAAI,GAAO,EAAO,IAKxB,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- const e=require("../guards/isEqual.cjs"),t=require("../_common/unsafePaths.cjs");function n(n={},r={},i=e.isEqual){let a=[],o=[],s={},c=new Set(Object.keys(n)),l=new Set(Object.keys(r));for(let e of l)c.has(e)?!t.isUnsafeKey(e)&&!i(n[e],r[e])&&(s[e]={after:r[e],before:n[e]}):a.push(e);for(let e of c)l.has(e)||o.push(e);return{added:a,changed:s,removed:o}}function r(t,n,r){let i=r?.compareFn??((t,n)=>e.isEqual(t,n));return{added:n.filter(e=>!t.some(t=>i(t,e))),removed:t.filter(e=>!n.some(t=>i(e,t)))}}exports.diff=n,exports.diffArrays=r;
1
+ const e=require("../guards/isEqual.cjs"),t=require("../_common/unsafePaths.cjs");function diff(n={},r={},i=e.isEqual){let a=[],o=[],s={},c=new Set(Object.keys(n)),l=new Set(Object.keys(r));for(let e of l)c.has(e)?!t.isUnsafeKey(e)&&!i(n[e],r[e])&&(s[e]={after:r[e],before:n[e]}):a.push(e);for(let e of c)l.has(e)||o.push(e);return{added:a,changed:s,removed:o}}function diffArrays(t,n,r){let i=r?.compareFn??((t,n)=>e.isEqual(t,n));return{added:n.filter(e=>!t.some(t=>i(t,e))),removed:t.filter(e=>!n.some(t=>i(e,t)))}}exports.diff=diff,exports.diffArrays=diffArrays;
2
2
  //# sourceMappingURL=diff.cjs.map