@vielzeug/toolkit 1.0.11

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 (422) hide show
  1. package/dist/array/aggregate.cjs +2 -0
  2. package/dist/array/aggregate.cjs.map +1 -0
  3. package/dist/array/aggregate.js +16 -0
  4. package/dist/array/aggregate.js.map +1 -0
  5. package/dist/array/alternate.cjs +2 -0
  6. package/dist/array/alternate.cjs.map +1 -0
  7. package/dist/array/alternate.js +9 -0
  8. package/dist/array/alternate.js.map +1 -0
  9. package/dist/array/chunk.cjs +2 -0
  10. package/dist/array/chunk.cjs.map +1 -0
  11. package/dist/array/chunk.js +22 -0
  12. package/dist/array/chunk.js.map +1 -0
  13. package/dist/array/compact.cjs +2 -0
  14. package/dist/array/compact.cjs.map +1 -0
  15. package/dist/array/compact.js +9 -0
  16. package/dist/array/compact.js.map +1 -0
  17. package/dist/array/contains.cjs +2 -0
  18. package/dist/array/contains.cjs.map +1 -0
  19. package/dist/array/contains.js +11 -0
  20. package/dist/array/contains.js.map +1 -0
  21. package/dist/array/every.cjs +2 -0
  22. package/dist/array/every.cjs.map +1 -0
  23. package/dist/array/every.js +14 -0
  24. package/dist/array/every.js.map +1 -0
  25. package/dist/array/filter.cjs +2 -0
  26. package/dist/array/filter.cjs.map +1 -0
  27. package/dist/array/filter.js +14 -0
  28. package/dist/array/filter.js.map +1 -0
  29. package/dist/array/find.cjs +2 -0
  30. package/dist/array/find.cjs.map +1 -0
  31. package/dist/array/find.js +14 -0
  32. package/dist/array/find.js.map +1 -0
  33. package/dist/array/findIndex.cjs +2 -0
  34. package/dist/array/findIndex.cjs.map +1 -0
  35. package/dist/array/findIndex.js +14 -0
  36. package/dist/array/findIndex.js.map +1 -0
  37. package/dist/array/findLast.cjs +2 -0
  38. package/dist/array/findLast.cjs.map +1 -0
  39. package/dist/array/findLast.js +14 -0
  40. package/dist/array/findLast.js.map +1 -0
  41. package/dist/array/flatten.cjs +2 -0
  42. package/dist/array/flatten.cjs.map +1 -0
  43. package/dist/array/flatten.js +7 -0
  44. package/dist/array/flatten.js.map +1 -0
  45. package/dist/array/group.cjs +2 -0
  46. package/dist/array/group.cjs.map +1 -0
  47. package/dist/array/group.js +16 -0
  48. package/dist/array/group.js.map +1 -0
  49. package/dist/array/list.cjs +2 -0
  50. package/dist/array/list.cjs.map +1 -0
  51. package/dist/array/list.js +70 -0
  52. package/dist/array/list.js.map +1 -0
  53. package/dist/array/map.cjs +2 -0
  54. package/dist/array/map.cjs.map +1 -0
  55. package/dist/array/map.js +18 -0
  56. package/dist/array/map.js.map +1 -0
  57. package/dist/array/pick.cjs +2 -0
  58. package/dist/array/pick.cjs.map +1 -0
  59. package/dist/array/pick.js +15 -0
  60. package/dist/array/pick.js.map +1 -0
  61. package/dist/array/reduce.cjs +2 -0
  62. package/dist/array/reduce.cjs.map +1 -0
  63. package/dist/array/reduce.js +16 -0
  64. package/dist/array/reduce.js.map +1 -0
  65. package/dist/array/search.cjs +2 -0
  66. package/dist/array/search.cjs.map +1 -0
  67. package/dist/array/search.js +14 -0
  68. package/dist/array/search.js.map +1 -0
  69. package/dist/array/select.cjs +2 -0
  70. package/dist/array/select.cjs.map +1 -0
  71. package/dist/array/select.js +16 -0
  72. package/dist/array/select.js.map +1 -0
  73. package/dist/array/shift.cjs +2 -0
  74. package/dist/array/shift.cjs.map +1 -0
  75. package/dist/array/shift.js +13 -0
  76. package/dist/array/shift.js.map +1 -0
  77. package/dist/array/some.cjs +2 -0
  78. package/dist/array/some.cjs.map +1 -0
  79. package/dist/array/some.js +14 -0
  80. package/dist/array/some.js.map +1 -0
  81. package/dist/array/sort.cjs +2 -0
  82. package/dist/array/sort.cjs.map +1 -0
  83. package/dist/array/sort.js +13 -0
  84. package/dist/array/sort.js.map +1 -0
  85. package/dist/array/sortBy.cjs +2 -0
  86. package/dist/array/sortBy.cjs.map +1 -0
  87. package/dist/array/sortBy.js +6 -0
  88. package/dist/array/sortBy.js.map +1 -0
  89. package/dist/array/substitute.cjs +2 -0
  90. package/dist/array/substitute.cjs.map +1 -0
  91. package/dist/array/substitute.js +13 -0
  92. package/dist/array/substitute.js.map +1 -0
  93. package/dist/array/uniq.cjs +2 -0
  94. package/dist/array/uniq.cjs.map +1 -0
  95. package/dist/array/uniq.js +18 -0
  96. package/dist/array/uniq.js.map +1 -0
  97. package/dist/date/expires.cjs +2 -0
  98. package/dist/date/expires.cjs.map +1 -0
  99. package/dist/date/expires.js +11 -0
  100. package/dist/date/expires.js.map +1 -0
  101. package/dist/date/interval.cjs +2 -0
  102. package/dist/date/interval.cjs.map +1 -0
  103. package/dist/date/interval.js +39 -0
  104. package/dist/date/interval.js.map +1 -0
  105. package/dist/date/timeDiff.cjs +2 -0
  106. package/dist/date/timeDiff.cjs.map +1 -0
  107. package/dist/date/timeDiff.js +29 -0
  108. package/dist/date/timeDiff.js.map +1 -0
  109. package/dist/function/assert.cjs +3 -0
  110. package/dist/function/assert.cjs.map +1 -0
  111. package/dist/function/assert.js +12 -0
  112. package/dist/function/assert.js.map +1 -0
  113. package/dist/function/assertParams.cjs +2 -0
  114. package/dist/function/assertParams.cjs.map +1 -0
  115. package/dist/function/assertParams.js +13 -0
  116. package/dist/function/assertParams.js.map +1 -0
  117. package/dist/function/attempt.cjs +2 -0
  118. package/dist/function/attempt.cjs.map +1 -0
  119. package/dist/function/attempt.js +15 -0
  120. package/dist/function/attempt.js.map +1 -0
  121. package/dist/function/compare.cjs +2 -0
  122. package/dist/function/compare.cjs.map +1 -0
  123. package/dist/function/compare.js +22 -0
  124. package/dist/function/compare.js.map +1 -0
  125. package/dist/function/compareBy.cjs +2 -0
  126. package/dist/function/compareBy.cjs.map +1 -0
  127. package/dist/function/compareBy.js +15 -0
  128. package/dist/function/compareBy.js.map +1 -0
  129. package/dist/function/compose.cjs +2 -0
  130. package/dist/function/compose.cjs.map +1 -0
  131. package/dist/function/compose.js +14 -0
  132. package/dist/function/compose.js.map +1 -0
  133. package/dist/function/curry.cjs +2 -0
  134. package/dist/function/curry.cjs.map +1 -0
  135. package/dist/function/curry.js +8 -0
  136. package/dist/function/curry.js.map +1 -0
  137. package/dist/function/debounce.cjs +2 -0
  138. package/dist/function/debounce.cjs.map +1 -0
  139. package/dist/function/debounce.js +10 -0
  140. package/dist/function/debounce.js.map +1 -0
  141. package/dist/function/delay.cjs +2 -0
  142. package/dist/function/delay.cjs.map +1 -0
  143. package/dist/function/delay.js +8 -0
  144. package/dist/function/delay.js.map +1 -0
  145. package/dist/function/fp.cjs +2 -0
  146. package/dist/function/fp.cjs.map +1 -0
  147. package/dist/function/fp.js +10 -0
  148. package/dist/function/fp.js.map +1 -0
  149. package/dist/function/memo.cjs +2 -0
  150. package/dist/function/memo.cjs.map +1 -0
  151. package/dist/function/memo.js +24 -0
  152. package/dist/function/memo.js.map +1 -0
  153. package/dist/function/once.cjs +2 -0
  154. package/dist/function/once.cjs.map +1 -0
  155. package/dist/function/once.js +11 -0
  156. package/dist/function/once.js.map +1 -0
  157. package/dist/function/pipe.cjs +2 -0
  158. package/dist/function/pipe.cjs.map +1 -0
  159. package/dist/function/pipe.js +11 -0
  160. package/dist/function/pipe.js.map +1 -0
  161. package/dist/function/predict.cjs +2 -0
  162. package/dist/function/predict.cjs.map +1 -0
  163. package/dist/function/predict.js +13 -0
  164. package/dist/function/predict.js.map +1 -0
  165. package/dist/function/proxy.cjs +2 -0
  166. package/dist/function/proxy.cjs.map +1 -0
  167. package/dist/function/proxy.js +22 -0
  168. package/dist/function/proxy.js.map +1 -0
  169. package/dist/function/retry.cjs +2 -0
  170. package/dist/function/retry.cjs.map +1 -0
  171. package/dist/function/retry.js +25 -0
  172. package/dist/function/retry.js.map +1 -0
  173. package/dist/function/sleep.cjs +2 -0
  174. package/dist/function/sleep.cjs.map +1 -0
  175. package/dist/function/sleep.js +7 -0
  176. package/dist/function/sleep.js.map +1 -0
  177. package/dist/function/throttle.cjs +2 -0
  178. package/dist/function/throttle.cjs.map +1 -0
  179. package/dist/function/throttle.js +11 -0
  180. package/dist/function/throttle.js.map +1 -0
  181. package/dist/function/worker.cjs +14 -0
  182. package/dist/function/worker.cjs.map +1 -0
  183. package/dist/function/worker.js +29 -0
  184. package/dist/function/worker.js.map +1 -0
  185. package/dist/index.cjs +2 -0
  186. package/dist/index.cjs.map +1 -0
  187. package/dist/index.d.ts +2278 -0
  188. package/dist/index.js +217 -0
  189. package/dist/index.js.map +1 -0
  190. package/dist/logit/dist/logit.cjs +2 -0
  191. package/dist/logit/dist/logit.cjs.map +1 -0
  192. package/dist/logit/dist/logit.js +178 -0
  193. package/dist/logit/dist/logit.js.map +1 -0
  194. package/dist/math/average.cjs +2 -0
  195. package/dist/math/average.cjs.map +1 -0
  196. package/dist/math/average.js +19 -0
  197. package/dist/math/average.js.map +1 -0
  198. package/dist/math/boil.cjs +2 -0
  199. package/dist/math/boil.cjs.map +1 -0
  200. package/dist/math/boil.js +17 -0
  201. package/dist/math/boil.js.map +1 -0
  202. package/dist/math/clamp.cjs +2 -0
  203. package/dist/math/clamp.cjs.map +1 -0
  204. package/dist/math/clamp.js +7 -0
  205. package/dist/math/clamp.js.map +1 -0
  206. package/dist/math/max.cjs +2 -0
  207. package/dist/math/max.cjs.map +1 -0
  208. package/dist/math/max.js +12 -0
  209. package/dist/math/max.js.map +1 -0
  210. package/dist/math/median.cjs +2 -0
  211. package/dist/math/median.cjs.map +1 -0
  212. package/dist/math/median.js +11 -0
  213. package/dist/math/median.js.map +1 -0
  214. package/dist/math/min.cjs +2 -0
  215. package/dist/math/min.cjs.map +1 -0
  216. package/dist/math/min.js +12 -0
  217. package/dist/math/min.js.map +1 -0
  218. package/dist/math/range.cjs +2 -0
  219. package/dist/math/range.cjs.map +1 -0
  220. package/dist/math/range.js +10 -0
  221. package/dist/math/range.js.map +1 -0
  222. package/dist/math/rate.cjs +2 -0
  223. package/dist/math/rate.cjs.map +1 -0
  224. package/dist/math/rate.js +9 -0
  225. package/dist/math/rate.js.map +1 -0
  226. package/dist/math/round.cjs +2 -0
  227. package/dist/math/round.cjs.map +1 -0
  228. package/dist/math/round.js +9 -0
  229. package/dist/math/round.js.map +1 -0
  230. package/dist/math/sum.cjs +2 -0
  231. package/dist/math/sum.cjs.map +1 -0
  232. package/dist/math/sum.js +22 -0
  233. package/dist/math/sum.js.map +1 -0
  234. package/dist/object/clone.cjs +2 -0
  235. package/dist/object/clone.cjs.map +1 -0
  236. package/dist/object/clone.js +7 -0
  237. package/dist/object/clone.js.map +1 -0
  238. package/dist/object/diff.cjs +2 -0
  239. package/dist/object/diff.cjs.map +1 -0
  240. package/dist/object/diff.js +18 -0
  241. package/dist/object/diff.js.map +1 -0
  242. package/dist/object/entries.cjs +2 -0
  243. package/dist/object/entries.cjs.map +1 -0
  244. package/dist/object/entries.js +9 -0
  245. package/dist/object/entries.js.map +1 -0
  246. package/dist/object/keys.cjs +2 -0
  247. package/dist/object/keys.cjs.map +1 -0
  248. package/dist/object/keys.js +9 -0
  249. package/dist/object/keys.js.map +1 -0
  250. package/dist/object/merge.cjs +2 -0
  251. package/dist/object/merge.cjs.map +1 -0
  252. package/dist/object/merge.js +29 -0
  253. package/dist/object/merge.js.map +1 -0
  254. package/dist/object/parseJSON.cjs +2 -0
  255. package/dist/object/parseJSON.cjs.map +1 -0
  256. package/dist/object/parseJSON.js +19 -0
  257. package/dist/object/parseJSON.js.map +1 -0
  258. package/dist/object/path.cjs +2 -0
  259. package/dist/object/path.cjs.map +1 -0
  260. package/dist/object/path.js +24 -0
  261. package/dist/object/path.js.map +1 -0
  262. package/dist/object/seek.cjs +2 -0
  263. package/dist/object/seek.cjs.map +1 -0
  264. package/dist/object/seek.js +11 -0
  265. package/dist/object/seek.js.map +1 -0
  266. package/dist/object/values.cjs +2 -0
  267. package/dist/object/values.cjs.map +1 -0
  268. package/dist/object/values.js +9 -0
  269. package/dist/object/values.js.map +1 -0
  270. package/dist/random/draw.cjs +2 -0
  271. package/dist/random/draw.cjs.map +1 -0
  272. package/dist/random/draw.js +11 -0
  273. package/dist/random/draw.js.map +1 -0
  274. package/dist/random/random.cjs +2 -0
  275. package/dist/random/random.cjs.map +1 -0
  276. package/dist/random/random.js +10 -0
  277. package/dist/random/random.js.map +1 -0
  278. package/dist/random/shuffle.cjs +2 -0
  279. package/dist/random/shuffle.cjs.map +1 -0
  280. package/dist/random/shuffle.js +15 -0
  281. package/dist/random/shuffle.js.map +1 -0
  282. package/dist/random/uuid.cjs +2 -0
  283. package/dist/random/uuid.cjs.map +1 -0
  284. package/dist/random/uuid.js +7 -0
  285. package/dist/random/uuid.js.map +1 -0
  286. package/dist/string/_caseUtils.cjs +2 -0
  287. package/dist/string/_caseUtils.cjs.map +1 -0
  288. package/dist/string/_caseUtils.js +9 -0
  289. package/dist/string/_caseUtils.js.map +1 -0
  290. package/dist/string/camelCase.cjs +2 -0
  291. package/dist/string/camelCase.cjs.map +1 -0
  292. package/dist/string/camelCase.js +8 -0
  293. package/dist/string/camelCase.js.map +1 -0
  294. package/dist/string/kebabCase.cjs +2 -0
  295. package/dist/string/kebabCase.cjs.map +1 -0
  296. package/dist/string/kebabCase.js +8 -0
  297. package/dist/string/kebabCase.js.map +1 -0
  298. package/dist/string/pascalCase.cjs +2 -0
  299. package/dist/string/pascalCase.cjs.map +1 -0
  300. package/dist/string/pascalCase.js +8 -0
  301. package/dist/string/pascalCase.js.map +1 -0
  302. package/dist/string/similarity.cjs +2 -0
  303. package/dist/string/similarity.cjs.map +1 -0
  304. package/dist/string/similarity.js +34 -0
  305. package/dist/string/similarity.js.map +1 -0
  306. package/dist/string/snakeCase.cjs +2 -0
  307. package/dist/string/snakeCase.cjs.map +1 -0
  308. package/dist/string/snakeCase.js +8 -0
  309. package/dist/string/snakeCase.js.map +1 -0
  310. package/dist/string/truncate.cjs +2 -0
  311. package/dist/string/truncate.cjs.map +1 -0
  312. package/dist/string/truncate.js +9 -0
  313. package/dist/string/truncate.js.map +1 -0
  314. package/dist/typed/ge.cjs +2 -0
  315. package/dist/typed/ge.cjs.map +1 -0
  316. package/dist/typed/ge.js +7 -0
  317. package/dist/typed/ge.js.map +1 -0
  318. package/dist/typed/gt.cjs +2 -0
  319. package/dist/typed/gt.cjs.map +1 -0
  320. package/dist/typed/gt.js +7 -0
  321. package/dist/typed/gt.js.map +1 -0
  322. package/dist/typed/is.cjs +2 -0
  323. package/dist/typed/is.cjs.map +1 -0
  324. package/dist/typed/is.js +44 -0
  325. package/dist/typed/is.js.map +1 -0
  326. package/dist/typed/isArray.cjs +2 -0
  327. package/dist/typed/isArray.cjs.map +1 -0
  328. package/dist/typed/isArray.js +9 -0
  329. package/dist/typed/isArray.js.map +1 -0
  330. package/dist/typed/isBoolean.cjs +2 -0
  331. package/dist/typed/isBoolean.cjs.map +1 -0
  332. package/dist/typed/isBoolean.js +7 -0
  333. package/dist/typed/isBoolean.js.map +1 -0
  334. package/dist/typed/isDate.cjs +2 -0
  335. package/dist/typed/isDate.cjs.map +1 -0
  336. package/dist/typed/isDate.js +9 -0
  337. package/dist/typed/isDate.js.map +1 -0
  338. package/dist/typed/isDefined.cjs +2 -0
  339. package/dist/typed/isDefined.cjs.map +1 -0
  340. package/dist/typed/isDefined.js +7 -0
  341. package/dist/typed/isDefined.js.map +1 -0
  342. package/dist/typed/isEmpty.cjs +2 -0
  343. package/dist/typed/isEmpty.cjs.map +1 -0
  344. package/dist/typed/isEmpty.js +12 -0
  345. package/dist/typed/isEmpty.js.map +1 -0
  346. package/dist/typed/isEqual.cjs +2 -0
  347. package/dist/typed/isEqual.cjs.map +1 -0
  348. package/dist/typed/isEqual.js +25 -0
  349. package/dist/typed/isEqual.js.map +1 -0
  350. package/dist/typed/isEven.cjs +2 -0
  351. package/dist/typed/isEven.cjs.map +1 -0
  352. package/dist/typed/isEven.js +7 -0
  353. package/dist/typed/isEven.js.map +1 -0
  354. package/dist/typed/isFunction.cjs +2 -0
  355. package/dist/typed/isFunction.cjs.map +1 -0
  356. package/dist/typed/isFunction.js +9 -0
  357. package/dist/typed/isFunction.js.map +1 -0
  358. package/dist/typed/isMatch.cjs +2 -0
  359. package/dist/typed/isMatch.cjs.map +1 -0
  360. package/dist/typed/isMatch.js +19 -0
  361. package/dist/typed/isMatch.js.map +1 -0
  362. package/dist/typed/isNegative.cjs +2 -0
  363. package/dist/typed/isNegative.cjs.map +1 -0
  364. package/dist/typed/isNegative.js +7 -0
  365. package/dist/typed/isNegative.js.map +1 -0
  366. package/dist/typed/isNil.cjs +2 -0
  367. package/dist/typed/isNil.cjs.map +1 -0
  368. package/dist/typed/isNil.js +9 -0
  369. package/dist/typed/isNil.js.map +1 -0
  370. package/dist/typed/isNumber.cjs +2 -0
  371. package/dist/typed/isNumber.cjs.map +1 -0
  372. package/dist/typed/isNumber.js +9 -0
  373. package/dist/typed/isNumber.js.map +1 -0
  374. package/dist/typed/isObject.cjs +2 -0
  375. package/dist/typed/isObject.cjs.map +1 -0
  376. package/dist/typed/isObject.js +9 -0
  377. package/dist/typed/isObject.js.map +1 -0
  378. package/dist/typed/isOdd.cjs +2 -0
  379. package/dist/typed/isOdd.cjs.map +1 -0
  380. package/dist/typed/isOdd.js +7 -0
  381. package/dist/typed/isOdd.js.map +1 -0
  382. package/dist/typed/isPositive.cjs +2 -0
  383. package/dist/typed/isPositive.cjs.map +1 -0
  384. package/dist/typed/isPositive.js +7 -0
  385. package/dist/typed/isPositive.js.map +1 -0
  386. package/dist/typed/isPrimitive.cjs +2 -0
  387. package/dist/typed/isPrimitive.cjs.map +1 -0
  388. package/dist/typed/isPrimitive.js +10 -0
  389. package/dist/typed/isPrimitive.js.map +1 -0
  390. package/dist/typed/isPromise.cjs +2 -0
  391. package/dist/typed/isPromise.cjs.map +1 -0
  392. package/dist/typed/isPromise.js +10 -0
  393. package/dist/typed/isPromise.js.map +1 -0
  394. package/dist/typed/isRegex.cjs +2 -0
  395. package/dist/typed/isRegex.cjs.map +1 -0
  396. package/dist/typed/isRegex.js +7 -0
  397. package/dist/typed/isRegex.js.map +1 -0
  398. package/dist/typed/isString.cjs +2 -0
  399. package/dist/typed/isString.cjs.map +1 -0
  400. package/dist/typed/isString.js +9 -0
  401. package/dist/typed/isString.js.map +1 -0
  402. package/dist/typed/isWithin.cjs +2 -0
  403. package/dist/typed/isWithin.cjs.map +1 -0
  404. package/dist/typed/isWithin.js +10 -0
  405. package/dist/typed/isWithin.js.map +1 -0
  406. package/dist/typed/isZero.cjs +2 -0
  407. package/dist/typed/isZero.cjs.map +1 -0
  408. package/dist/typed/isZero.js +7 -0
  409. package/dist/typed/isZero.js.map +1 -0
  410. package/dist/typed/le.cjs +2 -0
  411. package/dist/typed/le.cjs.map +1 -0
  412. package/dist/typed/le.js +7 -0
  413. package/dist/typed/le.js.map +1 -0
  414. package/dist/typed/lt.cjs +2 -0
  415. package/dist/typed/lt.cjs.map +1 -0
  416. package/dist/typed/lt.js +7 -0
  417. package/dist/typed/lt.js.map +1 -0
  418. package/dist/typed/typeOf.cjs +2 -0
  419. package/dist/typed/typeOf.cjs.map +1 -0
  420. package/dist/typed/typeOf.js +14 -0
  421. package/dist/typed/typeOf.js.map +1 -0
  422. package/package.json +38 -0
package/dist/index.js ADDED
@@ -0,0 +1,217 @@
1
+ import { aggregate as e } from "./array/aggregate.js";
2
+ import { alternate as m } from "./array/alternate.js";
3
+ import { chunk as f } from "./array/chunk.js";
4
+ import { compact as i } from "./array/compact.js";
5
+ import { contains as a } from "./array/contains.js";
6
+ import { every as _ } from "./array/every.js";
7
+ import { filter as S } from "./array/filter.js";
8
+ import { find as l } from "./array/find.js";
9
+ import { findIndex as I } from "./array/findIndex.js";
10
+ import { findLast as u } from "./array/findLast.js";
11
+ import { flatten as M } from "./array/flatten.js";
12
+ import { group as g } from "./array/group.js";
13
+ import { list as N } from "./array/list.js";
14
+ import { map as b } from "./array/map.js";
15
+ import { pick as k } from "./array/pick.js";
16
+ import { reduce as T } from "./array/reduce.js";
17
+ import { search as A } from "./array/search.js";
18
+ import { select as D } from "./array/select.js";
19
+ import { shift as U } from "./array/shift.js";
20
+ import { some as w } from "./array/some.js";
21
+ import { sort as J } from "./array/sort.js";
22
+ import { sortBy as Y } from "./array/sortBy.js";
23
+ import { substitute as H } from "./array/substitute.js";
24
+ import { uniq as V } from "./array/uniq.js";
25
+ import { expires as z } from "./date/expires.js";
26
+ import { interval as X } from "./date/interval.js";
27
+ import { timeDiff as rr } from "./date/timeDiff.js";
28
+ import { assert as er } from "./function/assert.js";
29
+ import { assertParams as mr } from "./function/assertParams.js";
30
+ import { attempt as fr } from "./function/attempt.js";
31
+ import { compare as ir } from "./function/compare.js";
32
+ import { compareBy as ar } from "./function/compareBy.js";
33
+ import { compose as _r } from "./function/compose.js";
34
+ import { curry as Sr } from "./function/curry.js";
35
+ import { debounce as lr } from "./function/debounce.js";
36
+ import { delay as Ir } from "./function/delay.js";
37
+ import { fp as ur } from "./function/fp.js";
38
+ import { memo as Mr } from "./function/memo.js";
39
+ import { once as gr } from "./function/once.js";
40
+ import { pipe as Nr } from "./function/pipe.js";
41
+ import { predict as br } from "./function/predict.js";
42
+ import { proxy as kr } from "./function/proxy.js";
43
+ import { retry as Tr } from "./function/retry.js";
44
+ import { sleep as Ar } from "./function/sleep.js";
45
+ import { throttle as Dr } from "./function/throttle.js";
46
+ import { worker as Ur } from "./function/worker.js";
47
+ import { average as wr } from "./math/average.js";
48
+ import { boil as Jr } from "./math/boil.js";
49
+ import { clamp as Yr } from "./math/clamp.js";
50
+ import { max as Hr } from "./math/max.js";
51
+ import { median as Vr } from "./math/median.js";
52
+ import { min as zr } from "./math/min.js";
53
+ import { range as Xr } from "./math/range.js";
54
+ import { rate as ro } from "./math/rate.js";
55
+ import { round as eo } from "./math/round.js";
56
+ import { sum as mo } from "./math/sum.js";
57
+ import { clone as fo } from "./object/clone.js";
58
+ import { diff as io } from "./object/diff.js";
59
+ import { entries as ao } from "./object/entries.js";
60
+ import { keys as _o } from "./object/keys.js";
61
+ import { merge as So } from "./object/merge.js";
62
+ import { parseJSON as lo } from "./object/parseJSON.js";
63
+ import { path as Io } from "./object/path.js";
64
+ import { seek as uo } from "./object/seek.js";
65
+ import { values as Go } from "./object/values.js";
66
+ import { draw as yo } from "./random/draw.js";
67
+ import { random as vo } from "./random/random.js";
68
+ import { shuffle as ho } from "./random/shuffle.js";
69
+ import { uuid as Po } from "./random/uuid.js";
70
+ import { camelCase as Co } from "./string/camelCase.js";
71
+ import { kebabCase as Bo } from "./string/kebabCase.js";
72
+ import { pascalCase as Lo } from "./string/pascalCase.js";
73
+ import { similarity as qo } from "./string/similarity.js";
74
+ import { snakeCase as Fo } from "./string/snakeCase.js";
75
+ import { truncate as Wo } from "./string/truncate.js";
76
+ import { ge as jo } from "./typed/ge.js";
77
+ import { gt as Qo } from "./typed/gt.js";
78
+ import { is as Zo } from "./typed/is.js";
79
+ import { IS_ARRAY_ERROR_MSG as Ko, isArray as Xo } from "./typed/isArray.js";
80
+ import { isBoolean as re } from "./typed/isBoolean.js";
81
+ import { IS_DATE_ERROR_MSG as ee, isDate as te } from "./typed/isDate.js";
82
+ import { isDefined as pe } from "./typed/isDefined.js";
83
+ import { IS_EMPTY_ERROR_MSG as xe, isEmpty as ie } from "./typed/isEmpty.js";
84
+ import { IS_EQUAL_ERROR_MSG as ae, isEqual as Re } from "./typed/isEqual.js";
85
+ import { isEven as ne } from "./typed/isEven.js";
86
+ import { IS_FUNCTION_ERROR_MSG as ce, isFunction as le } from "./typed/isFunction.js";
87
+ import { isNegative as Ie } from "./typed/isNegative.js";
88
+ import { IS_NIL_ERROR_MSG as ue, isNil as de } from "./typed/isNil.js";
89
+ import { IS_NUMBER_ERROR_MSG as Ge, isNumber as ge } from "./typed/isNumber.js";
90
+ import { IS_OBJECT_ERROR_MSG as Ne, isObject as ve } from "./typed/isObject.js";
91
+ import { isOdd as he } from "./typed/isOdd.js";
92
+ import { isPositive as Pe } from "./typed/isPositive.js";
93
+ import { IS_PRIMITIVE_ERROR_MSG as Ce, isPrimitive as Ae } from "./typed/isPrimitive.js";
94
+ import { IS_PROMISE_ERROR_MSG as De, isPromise as Le } from "./typed/isPromise.js";
95
+ import { isRegex as qe } from "./typed/isRegex.js";
96
+ import { IS_STRING_ERROR_MSG as Fe, isString as Je } from "./typed/isString.js";
97
+ import { IS_WITHIN_ERROR_MSG as Ye, isWithin as je } from "./typed/isWithin.js";
98
+ import { isZero as Qe } from "./typed/isZero.js";
99
+ import { le as Ze } from "./typed/le.js";
100
+ import { lt as Ke } from "./typed/lt.js";
101
+ import { typeOf as $e } from "./typed/typeOf.js";
102
+ export {
103
+ Ko as IS_ARRAY_ERROR_MSG,
104
+ ee as IS_DATE_ERROR_MSG,
105
+ xe as IS_EMPTY_ERROR_MSG,
106
+ ae as IS_EQUAL_ERROR_MSG,
107
+ ce as IS_FUNCTION_ERROR_MSG,
108
+ ue as IS_NIL_ERROR_MSG,
109
+ Ge as IS_NUMBER_ERROR_MSG,
110
+ Ne as IS_OBJECT_ERROR_MSG,
111
+ Ce as IS_PRIMITIVE_ERROR_MSG,
112
+ De as IS_PROMISE_ERROR_MSG,
113
+ Fe as IS_STRING_ERROR_MSG,
114
+ Ye as IS_WITHIN_ERROR_MSG,
115
+ e as aggregate,
116
+ m as alternate,
117
+ er as assert,
118
+ mr as assertParams,
119
+ fr as attempt,
120
+ wr as average,
121
+ Jr as boil,
122
+ Co as camelCase,
123
+ f as chunk,
124
+ Yr as clamp,
125
+ fo as clone,
126
+ i as compact,
127
+ ir as compare,
128
+ ar as compareBy,
129
+ _r as compose,
130
+ a as contains,
131
+ Sr as curry,
132
+ lr as debounce,
133
+ Ir as delay,
134
+ io as diff,
135
+ yo as draw,
136
+ ao as entries,
137
+ _ as every,
138
+ z as expires,
139
+ S as filter,
140
+ l as find,
141
+ I as findIndex,
142
+ u as findLast,
143
+ M as flatten,
144
+ ur as fp,
145
+ jo as ge,
146
+ g as group,
147
+ Qo as gt,
148
+ X as interval,
149
+ Zo as is,
150
+ Xo as isArray,
151
+ re as isBoolean,
152
+ te as isDate,
153
+ pe as isDefined,
154
+ ie as isEmpty,
155
+ Re as isEqual,
156
+ ne as isEven,
157
+ le as isFunction,
158
+ Ie as isNegative,
159
+ de as isNil,
160
+ ge as isNumber,
161
+ ve as isObject,
162
+ he as isOdd,
163
+ Pe as isPositive,
164
+ Ae as isPrimitive,
165
+ Le as isPromise,
166
+ qe as isRegex,
167
+ Je as isString,
168
+ je as isWithin,
169
+ Qe as isZero,
170
+ Bo as kebabCase,
171
+ _o as keys,
172
+ Ze as le,
173
+ N as list,
174
+ Ke as lt,
175
+ b as map,
176
+ Hr as max,
177
+ Vr as median,
178
+ Mr as memo,
179
+ So as merge,
180
+ zr as min,
181
+ gr as once,
182
+ lo as parseJSON,
183
+ Lo as pascalCase,
184
+ Io as path,
185
+ k as pick,
186
+ Nr as pipe,
187
+ br as predict,
188
+ kr as proxy,
189
+ vo as random,
190
+ Xr as range,
191
+ ro as rate,
192
+ T as reduce,
193
+ Tr as retry,
194
+ eo as round,
195
+ A as search,
196
+ uo as seek,
197
+ D as select,
198
+ U as shift,
199
+ ho as shuffle,
200
+ qo as similarity,
201
+ Ar as sleep,
202
+ Fo as snakeCase,
203
+ w as some,
204
+ J as sort,
205
+ Y as sortBy,
206
+ H as substitute,
207
+ mo as sum,
208
+ Dr as throttle,
209
+ rr as timeDiff,
210
+ Wo as truncate,
211
+ $e as typeOf,
212
+ V as uniq,
213
+ Po as uuid,
214
+ Go as values,
215
+ Ur as worker
216
+ };
217
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w={},$={debug:"log",success:"log"},v=()=>w?.NODE_ENV==="production",x=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,m={debug:{bg:"#616161",border:"#424242",color:"#fff",icon:"☕",symbol:"🅳"},error:{bg:"#d32f2f",border:"#c62828",color:"#fff",icon:"✘",symbol:"🅴"},group:{bg:"#546e7a",border:"#455a64",color:"#fff",icon:"⚭",symbol:"🅶"},info:{bg:"#1976d2",border:"#1565c0",color:"#fff",icon:"ℹ",symbol:"🅸"},ns:x?{bg:"#fafafa",border:"#c7c7c7",color:"#000"}:{bg:"#424242",border:"#212121",color:"#fff"},success:{bg:"#689f38",border:"#558b2f",color:"#fff",icon:"✔",symbol:"🆂"},time:{bg:"#0097a7",border:"#00838f",color:"#fff",icon:"⏲",symbol:"🆃"},trace:{bg:"#d81b60",border:"#c2185b",color:"#fff",icon:"⛢",symbol:"🆃"},warn:{bg:"#ffb300",border:"#ffa000",color:"#fff",icon:"⚠",symbol:"🆆"}},f={debug:0,trace:1,time:2,table:3,info:4,success:5,warn:6,error:7,off:8},o={environment:!0,logLevel:"debug",namespace:"",remote:{handler:void 0,logLevel:"off"},timestamp:!0,variant:"symbol"},g=e=>f[o.logLevel]<=f[e],u=()=>new Date().toISOString().slice(11,23),p=()=>v()?"🄿":"🄳",y=(e,r)=>{o.remote.handler&&f[o.remote.logLevel]<=f[e]&&o.remote.handler(e,...r)},b=e=>$[e]||e,d=(e,r="")=>{const{bg:t,color:s,border:n}=m[e],c=`color: ${t}; border: 1px solid ${n}; border-radius: 4px;`;switch(o.variant){case"symbol":return`${c} padding: 1px 1px 0;${r};`;case"icon":return`${c} padding: 0 3px;${r};`;default:return`background: ${t}; color: ${s}; border: 1px solid ${n}; border-radius: 4px; font-weight: bold; padding: 0 3px;${r}`}};function L(e){const r=m[e],{namespace:t,variant:s,timestamp:n,environment:c}=o;let a=`%c${r[s]??e.toUpperCase()}%c`;const i=[d(e),""];return t&&(a+=` %c${t}%c`,i.push(d("ns"," border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;"),"")),c&&(a+=` %c${p()}%c`,i.push("color: darkgray;","")),n&&(a+=` %c${u()}%c`,i.push("color: gray;","")),{format:a,parts:i}}const l=(e,...r)=>{if(typeof window>"u"){const c=m[e],{variant:a}=o,i=console[b(e)];i(`${c[a]??e.toUpperCase()} | ${p()} |`,...r);return}if(!g(e))return;const{format:t,parts:s}=L(e),n=console[b(e)];n(t,...s,...r),y(e,r)},E=e=>{const r=Math.floor(Date.now()-e);return r?`${r}ms`:""},h={assert:(e,r,t)=>console.assert(e,r,t),debug:(...e)=>l("debug",...e),error:(...e)=>l("error",...e),getLevel:()=>o.logLevel,getPrefix:()=>o.namespace,getTimestamp:()=>o.timestamp,groupCollapsed:(e,r="GROUP",t=Date.now())=>{if(!g("success"))return;const s=E(t),n=p();console.groupCollapsed(`%c${r}%c${o.namespace}%c${n}%c${o.timestamp?u():""}%c${s}%c${e}`,d("group","margin-right: 6px; padding: 1px 3px 0"),d("ns"," border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;margin-right: 6px;"),"color: darkgray; margin-right: 6px;","color: gray;font-weight: lighter;margin-right: 6px;","color: gray; font-weight: lighter;margin-right: 6px;","color: inherit;font-weight: lighter;")},groupEnd:()=>{g("success")&&console.groupEnd()},info:(...e)=>l("info",...e),initialise:e=>{Object.assign(o,e)},setLogLevel:e=>{o.logLevel=e},setPrefix:e=>{o.namespace=e},setRemote:e=>{o.remote=e},setRemoteLogLevel:e=>{o.remote.logLevel=e},setVariant:e=>{o.variant=e},showEnvironment:e=>{o.environment=e},showTimestamp:e=>{o.timestamp=e},success:(...e)=>l("success",...e),table:(...e)=>{g("table")&&console.table(...e)},time:e=>{g("time")&&console.time(e)},timeEnd:e=>{g("time")&&console.timeEnd(e)},trace:(...e)=>l("trace",...e),warn:(...e)=>l("warn",...e)};typeof window<"u"&&(window.Logit=h);exports.Logit=h;
2
+ //# sourceMappingURL=logit.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logit.cjs","sources":["../../../../logit/dist/logit.js"],"sourcesContent":["const h = {};\nconst w = {\n debug: \"log\",\n success: \"log\"\n}, v = () => h?.NODE_ENV === \"production\", $ = typeof window < \"u\" && window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches, m = {\n debug: { bg: \"#616161\", border: \"#424242\", color: \"#fff\", icon: \"☕\", symbol: \"🅳\" },\n error: { bg: \"#d32f2f\", border: \"#c62828\", color: \"#fff\", icon: \"✘\", symbol: \"🅴\" },\n group: { bg: \"#546e7a\", border: \"#455a64\", color: \"#fff\", icon: \"⚭\", symbol: \"🅶\" },\n info: { bg: \"#1976d2\", border: \"#1565c0\", color: \"#fff\", icon: \"ℹ\", symbol: \"🅸\" },\n ns: $ ? { bg: \"#fafafa\", border: \"#c7c7c7\", color: \"#000\" } : { bg: \"#424242\", border: \"#212121\", color: \"#fff\" },\n success: { bg: \"#689f38\", border: \"#558b2f\", color: \"#fff\", icon: \"✔\", symbol: \"🆂\" },\n time: { bg: \"#0097a7\", border: \"#00838f\", color: \"#fff\", icon: \"⏲\", symbol: \"🆃\" },\n trace: { bg: \"#d81b60\", border: \"#c2185b\", color: \"#fff\", icon: \"⛢\", symbol: \"🆃\" },\n warn: { bg: \"#ffb300\", border: \"#ffa000\", color: \"#fff\", icon: \"⚠\", symbol: \"🆆\" }\n}, f = {\n debug: 0,\n trace: 1,\n time: 2,\n table: 3,\n info: 4,\n success: 5,\n warn: 6,\n error: 7,\n off: 8\n}, e = {\n environment: !0,\n logLevel: \"debug\",\n namespace: \"\",\n remote: { handler: void 0, logLevel: \"off\" },\n timestamp: !0,\n variant: \"symbol\"\n}, d = (o) => f[e.logLevel] <= f[o], u = () => (/* @__PURE__ */ new Date()).toISOString().slice(11, 23), b = () => v() ? \"🄿\" : \"🄳\", x = (o, r) => {\n e.remote.handler && f[e.remote.logLevel] <= f[o] && e.remote.handler(o, ...r);\n}, p = (o) => w[o] || o, g = (o, r = \"\") => {\n const { bg: t, color: s, border: n } = m[o], c = `color: ${t}; border: 1px solid ${n}; border-radius: 4px;`;\n switch (e.variant) {\n case \"symbol\":\n return `${c} padding: 1px 1px 0;${r};`;\n case \"icon\":\n return `${c} padding: 0 3px;${r};`;\n default:\n return `background: ${t}; color: ${s}; border: 1px solid ${n}; border-radius: 4px; font-weight: bold; padding: 0 3px;${r}`;\n }\n};\nfunction L(o) {\n const r = m[o], { namespace: t, variant: s, timestamp: n, environment: c } = e;\n let i = `%c${r[s] ?? o.toUpperCase()}%c`;\n const a = [g(o), \"\"];\n return t && (i += ` %c${t}%c`, a.push(g(\"ns\", \" border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;\"), \"\")), c && (i += ` %c${b()}%c`, a.push(\"color: darkgray;\", \"\")), n && (i += ` %c${u()}%c`, a.push(\"color: gray;\", \"\")), { format: i, parts: a };\n}\nconst l = (o, ...r) => {\n if (typeof window > \"u\") {\n const c = m[o], { variant: i } = e, a = console[p(o)];\n a(`${c[i] ?? o.toUpperCase()} | ${b()} |`, ...r);\n return;\n }\n if (!d(o)) return;\n const { format: t, parts: s } = L(o), n = console[p(o)];\n n(t, ...s, ...r), x(o, r);\n}, E = (o) => {\n const r = Math.floor(Date.now() - o);\n return r ? `${r}ms` : \"\";\n}, _ = {\n /**\n * Asserts a condition and logs an error if it's false.\n */\n assert: (o, r, t) => console.assert(o, r, t),\n debug: (...o) => l(\"debug\", ...o),\n error: (...o) => l(\"error\", ...o),\n /**\n * Gets the current log level.\n */\n getLevel: () => e.logLevel,\n /**\n * Gets the current namespace prefix.\n */\n getPrefix: () => e.namespace,\n /**\n * Gets whether timestamps are shown.\n */\n getTimestamp: () => e.timestamp,\n /**\n * Creates a collapsed group in the console.\n */\n groupCollapsed: (o, r = \"GROUP\", t = Date.now()) => {\n if (!d(\"success\")) return;\n const s = E(t), n = b();\n console.groupCollapsed(\n `%c${r}%c${e.namespace}%c${n}%c${e.timestamp ? u() : \"\"}%c${s}%c${o}`,\n g(\"group\", \"margin-right: 6px; padding: 1px 3px 0\"),\n g(\"ns\", \" border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;margin-right: 6px;\"),\n \"color: darkgray; margin-right: 6px;\",\n \"color: gray;font-weight: lighter;margin-right: 6px;\",\n \"color: gray; font-weight: lighter;margin-right: 6px;\",\n \"color: inherit;font-weight: lighter;\"\n );\n },\n /**\n * Ends the current console group.\n */\n groupEnd: () => {\n d(\"success\") && console.groupEnd();\n },\n info: (...o) => l(\"info\", ...o),\n /**\n * Initializes Logit with custom options.\n */\n initialise: (o) => {\n Object.assign(e, o);\n },\n /**\n * Sets the minimum log level to display.\n */\n setLogLevel: (o) => {\n e.logLevel = o;\n },\n /**\n * Sets the namespace prefix for all logs.\n */\n setPrefix: (o) => {\n e.namespace = o;\n },\n /**\n * Configures remote logging options.\n */\n setRemote: (o) => {\n e.remote = o;\n },\n /**\n * Sets the log level for remote logging.\n */\n setRemoteLogLevel: (o) => {\n e.remote.logLevel = o;\n },\n /**\n * Sets the display variant (text, icon, or symbol).\n */\n setVariant: (o) => {\n e.variant = o;\n },\n /**\n * Shows or hides the environment indicator.\n */\n showEnvironment: (o) => {\n e.environment = o;\n },\n /**\n * Shows or hides timestamps in logs.\n */\n showTimestamp: (o) => {\n e.timestamp = o;\n },\n success: (...o) => l(\"success\", ...o),\n /**\n * Displays data in a table format.\n */\n table: (...o) => {\n d(\"table\") && console.table(...o);\n },\n /**\n * Starts a timer with the given label.\n */\n time: (o) => {\n d(\"time\") && console.time(o);\n },\n /**\n * Ends a timer with the given label.\n */\n timeEnd: (o) => {\n d(\"time\") && console.timeEnd(o);\n },\n trace: (...o) => l(\"trace\", ...o),\n warn: (...o) => l(\"warn\", ...o)\n};\ntypeof window < \"u\" && (window.Logit = _);\nexport {\n _ as Logit\n};\n//# sourceMappingURL=logit.js.map\n"],"names":["h","w","$","e","d","o","b","x","p","g","i","a","_"],"mappings":"gFAAA,MAAMA,EAAI,CAAA,EACJC,EAAI,CACR,MAAO,MACP,QAAS,KACX,EAAG,EAAI,IAAMD,GAAG,WAAa,aAAcE,EAAI,OAAO,OAAS,KAAO,OAAO,aAAa,8BAA8B,EAAE,QAAS,E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,CAChB,EAIA,UAAYA,GAAM,CAChBF,EAAE,OAASE,CACb,EAIA,kBAAoBA,GAAM,CACxBF,EAAE,OAAO,SAAWE,CACtB,EAIA,WAAaA,GAAM,CACjBF,EAAE,QAAUE,CACd,EAIA,gBAAkBA,GAAM,CACtBF,EAAE,YAAcE,CAClB,EAIA,cAAgBA,GAAM,CACpBF,EAAE,UAAYE,CAChB,EACA,QAAS,IAAIA,IAAM,EAAE,UAAW,GAAGA,CAAC,EAIpC,MAAO,IAAIA,IAAM,CACfD,EAAE,OAAO,GAAK,QAAQ,MAAM,GAAGC,CAAC,CAClC,EAIA,KAAOA,GAAM,CACXD,EAAE,MAAM,GAAK,QAAQ,KAAKC,CAAC,CAC7B,EAIA,QAAUA,GAAM,CACdD,EAAE,MAAM,GAAK,QAAQ,QAAQC,CAAC,CAChC,EACA,MAAO,IAAIA,IAAM,EAAE,QAAS,GAAGA,CAAC,EAChC,KAAM,IAAIA,IAAM,EAAE,OAAQ,GAAGA,CAAC,CAChC,EACA,OAAO,OAAS,MAAQ,OAAO,MAAQO"}
@@ -0,0 +1,178 @@
1
+ const h = {}, w = {
2
+ debug: "log",
3
+ success: "log"
4
+ }, $ = () => h?.NODE_ENV === "production", x = typeof window < "u" && window.matchMedia?.("(prefers-color-scheme: dark)").matches, m = {
5
+ debug: { bg: "#616161", border: "#424242", color: "#fff", icon: "☕", symbol: "🅳" },
6
+ error: { bg: "#d32f2f", border: "#c62828", color: "#fff", icon: "✘", symbol: "🅴" },
7
+ group: { bg: "#546e7a", border: "#455a64", color: "#fff", icon: "⚭", symbol: "🅶" },
8
+ info: { bg: "#1976d2", border: "#1565c0", color: "#fff", icon: "ℹ", symbol: "🅸" },
9
+ ns: x ? { bg: "#fafafa", border: "#c7c7c7", color: "#000" } : { bg: "#424242", border: "#212121", color: "#fff" },
10
+ success: { bg: "#689f38", border: "#558b2f", color: "#fff", icon: "✔", symbol: "🆂" },
11
+ time: { bg: "#0097a7", border: "#00838f", color: "#fff", icon: "⏲", symbol: "🆃" },
12
+ trace: { bg: "#d81b60", border: "#c2185b", color: "#fff", icon: "⛢", symbol: "🆃" },
13
+ warn: { bg: "#ffb300", border: "#ffa000", color: "#fff", icon: "⚠", symbol: "🆆" }
14
+ }, f = {
15
+ debug: 0,
16
+ trace: 1,
17
+ time: 2,
18
+ table: 3,
19
+ info: 4,
20
+ success: 5,
21
+ warn: 6,
22
+ error: 7,
23
+ off: 8
24
+ }, o = {
25
+ environment: !0,
26
+ logLevel: "debug",
27
+ namespace: "",
28
+ remote: { handler: void 0, logLevel: "off" },
29
+ timestamp: !0,
30
+ variant: "symbol"
31
+ }, g = (e) => f[o.logLevel] <= f[e], u = () => (/* @__PURE__ */ new Date()).toISOString().slice(11, 23), p = () => $() ? "🄿" : "🄳", v = (e, r) => {
32
+ o.remote.handler && f[o.remote.logLevel] <= f[e] && o.remote.handler(e, ...r);
33
+ }, b = (e) => w[e] || e, d = (e, r = "") => {
34
+ const { bg: t, color: s, border: n } = m[e], c = `color: ${t}; border: 1px solid ${n}; border-radius: 4px;`;
35
+ switch (o.variant) {
36
+ case "symbol":
37
+ return `${c} padding: 1px 1px 0;${r};`;
38
+ case "icon":
39
+ return `${c} padding: 0 3px;${r};`;
40
+ default:
41
+ return `background: ${t}; color: ${s}; border: 1px solid ${n}; border-radius: 4px; font-weight: bold; padding: 0 3px;${r}`;
42
+ }
43
+ };
44
+ function y(e) {
45
+ const r = m[e], { namespace: t, variant: s, timestamp: n, environment: c } = o;
46
+ let a = `%c${r[s] ?? e.toUpperCase()}%c`;
47
+ const i = [d(e), ""];
48
+ return t && (a += ` %c${t}%c`, i.push(d("ns", " border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;"), "")), c && (a += ` %c${p()}%c`, i.push("color: darkgray;", "")), n && (a += ` %c${u()}%c`, i.push("color: gray;", "")), { format: a, parts: i };
49
+ }
50
+ const l = (e, ...r) => {
51
+ if (typeof window > "u") {
52
+ const c = m[e], { variant: a } = o, i = console[b(e)];
53
+ i(`${c[a] ?? e.toUpperCase()} | ${p()} |`, ...r);
54
+ return;
55
+ }
56
+ if (!g(e)) return;
57
+ const { format: t, parts: s } = y(e), n = console[b(e)];
58
+ n(t, ...s, ...r), v(e, r);
59
+ }, L = (e) => {
60
+ const r = Math.floor(Date.now() - e);
61
+ return r ? `${r}ms` : "";
62
+ }, E = {
63
+ /**
64
+ * Asserts a condition and logs an error if it's false.
65
+ */
66
+ assert: (e, r, t) => console.assert(e, r, t),
67
+ debug: (...e) => l("debug", ...e),
68
+ error: (...e) => l("error", ...e),
69
+ /**
70
+ * Gets the current log level.
71
+ */
72
+ getLevel: () => o.logLevel,
73
+ /**
74
+ * Gets the current namespace prefix.
75
+ */
76
+ getPrefix: () => o.namespace,
77
+ /**
78
+ * Gets whether timestamps are shown.
79
+ */
80
+ getTimestamp: () => o.timestamp,
81
+ /**
82
+ * Creates a collapsed group in the console.
83
+ */
84
+ groupCollapsed: (e, r = "GROUP", t = Date.now()) => {
85
+ if (!g("success")) return;
86
+ const s = L(t), n = p();
87
+ console.groupCollapsed(
88
+ `%c${r}%c${o.namespace}%c${n}%c${o.timestamp ? u() : ""}%c${s}%c${e}`,
89
+ d("group", "margin-right: 6px; padding: 1px 3px 0"),
90
+ d("ns", " border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;margin-right: 6px;"),
91
+ "color: darkgray; margin-right: 6px;",
92
+ "color: gray;font-weight: lighter;margin-right: 6px;",
93
+ "color: gray; font-weight: lighter;margin-right: 6px;",
94
+ "color: inherit;font-weight: lighter;"
95
+ );
96
+ },
97
+ /**
98
+ * Ends the current console group.
99
+ */
100
+ groupEnd: () => {
101
+ g("success") && console.groupEnd();
102
+ },
103
+ info: (...e) => l("info", ...e),
104
+ /**
105
+ * Initializes Logit with custom options.
106
+ */
107
+ initialise: (e) => {
108
+ Object.assign(o, e);
109
+ },
110
+ /**
111
+ * Sets the minimum log level to display.
112
+ */
113
+ setLogLevel: (e) => {
114
+ o.logLevel = e;
115
+ },
116
+ /**
117
+ * Sets the namespace prefix for all logs.
118
+ */
119
+ setPrefix: (e) => {
120
+ o.namespace = e;
121
+ },
122
+ /**
123
+ * Configures remote logging options.
124
+ */
125
+ setRemote: (e) => {
126
+ o.remote = e;
127
+ },
128
+ /**
129
+ * Sets the log level for remote logging.
130
+ */
131
+ setRemoteLogLevel: (e) => {
132
+ o.remote.logLevel = e;
133
+ },
134
+ /**
135
+ * Sets the display variant (text, icon, or symbol).
136
+ */
137
+ setVariant: (e) => {
138
+ o.variant = e;
139
+ },
140
+ /**
141
+ * Shows or hides the environment indicator.
142
+ */
143
+ showEnvironment: (e) => {
144
+ o.environment = e;
145
+ },
146
+ /**
147
+ * Shows or hides timestamps in logs.
148
+ */
149
+ showTimestamp: (e) => {
150
+ o.timestamp = e;
151
+ },
152
+ success: (...e) => l("success", ...e),
153
+ /**
154
+ * Displays data in a table format.
155
+ */
156
+ table: (...e) => {
157
+ g("table") && console.table(...e);
158
+ },
159
+ /**
160
+ * Starts a timer with the given label.
161
+ */
162
+ time: (e) => {
163
+ g("time") && console.time(e);
164
+ },
165
+ /**
166
+ * Ends a timer with the given label.
167
+ */
168
+ timeEnd: (e) => {
169
+ g("time") && console.timeEnd(e);
170
+ },
171
+ trace: (...e) => l("trace", ...e),
172
+ warn: (...e) => l("warn", ...e)
173
+ };
174
+ typeof window < "u" && (window.Logit = E);
175
+ export {
176
+ E as Logit
177
+ };
178
+ //# sourceMappingURL=logit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logit.js","sources":["../../../../logit/dist/logit.js"],"sourcesContent":["const h = {};\nconst w = {\n debug: \"log\",\n success: \"log\"\n}, v = () => h?.NODE_ENV === \"production\", $ = typeof window < \"u\" && window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches, m = {\n debug: { bg: \"#616161\", border: \"#424242\", color: \"#fff\", icon: \"☕\", symbol: \"🅳\" },\n error: { bg: \"#d32f2f\", border: \"#c62828\", color: \"#fff\", icon: \"✘\", symbol: \"🅴\" },\n group: { bg: \"#546e7a\", border: \"#455a64\", color: \"#fff\", icon: \"⚭\", symbol: \"🅶\" },\n info: { bg: \"#1976d2\", border: \"#1565c0\", color: \"#fff\", icon: \"ℹ\", symbol: \"🅸\" },\n ns: $ ? { bg: \"#fafafa\", border: \"#c7c7c7\", color: \"#000\" } : { bg: \"#424242\", border: \"#212121\", color: \"#fff\" },\n success: { bg: \"#689f38\", border: \"#558b2f\", color: \"#fff\", icon: \"✔\", symbol: \"🆂\" },\n time: { bg: \"#0097a7\", border: \"#00838f\", color: \"#fff\", icon: \"⏲\", symbol: \"🆃\" },\n trace: { bg: \"#d81b60\", border: \"#c2185b\", color: \"#fff\", icon: \"⛢\", symbol: \"🆃\" },\n warn: { bg: \"#ffb300\", border: \"#ffa000\", color: \"#fff\", icon: \"⚠\", symbol: \"🆆\" }\n}, f = {\n debug: 0,\n trace: 1,\n time: 2,\n table: 3,\n info: 4,\n success: 5,\n warn: 6,\n error: 7,\n off: 8\n}, e = {\n environment: !0,\n logLevel: \"debug\",\n namespace: \"\",\n remote: { handler: void 0, logLevel: \"off\" },\n timestamp: !0,\n variant: \"symbol\"\n}, d = (o) => f[e.logLevel] <= f[o], u = () => (/* @__PURE__ */ new Date()).toISOString().slice(11, 23), b = () => v() ? \"🄿\" : \"🄳\", x = (o, r) => {\n e.remote.handler && f[e.remote.logLevel] <= f[o] && e.remote.handler(o, ...r);\n}, p = (o) => w[o] || o, g = (o, r = \"\") => {\n const { bg: t, color: s, border: n } = m[o], c = `color: ${t}; border: 1px solid ${n}; border-radius: 4px;`;\n switch (e.variant) {\n case \"symbol\":\n return `${c} padding: 1px 1px 0;${r};`;\n case \"icon\":\n return `${c} padding: 0 3px;${r};`;\n default:\n return `background: ${t}; color: ${s}; border: 1px solid ${n}; border-radius: 4px; font-weight: bold; padding: 0 3px;${r}`;\n }\n};\nfunction L(o) {\n const r = m[o], { namespace: t, variant: s, timestamp: n, environment: c } = e;\n let i = `%c${r[s] ?? o.toUpperCase()}%c`;\n const a = [g(o), \"\"];\n return t && (i += ` %c${t}%c`, a.push(g(\"ns\", \" border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;\"), \"\")), c && (i += ` %c${b()}%c`, a.push(\"color: darkgray;\", \"\")), n && (i += ` %c${u()}%c`, a.push(\"color: gray;\", \"\")), { format: i, parts: a };\n}\nconst l = (o, ...r) => {\n if (typeof window > \"u\") {\n const c = m[o], { variant: i } = e, a = console[p(o)];\n a(`${c[i] ?? o.toUpperCase()} | ${b()} |`, ...r);\n return;\n }\n if (!d(o)) return;\n const { format: t, parts: s } = L(o), n = console[p(o)];\n n(t, ...s, ...r), x(o, r);\n}, E = (o) => {\n const r = Math.floor(Date.now() - o);\n return r ? `${r}ms` : \"\";\n}, _ = {\n /**\n * Asserts a condition and logs an error if it's false.\n */\n assert: (o, r, t) => console.assert(o, r, t),\n debug: (...o) => l(\"debug\", ...o),\n error: (...o) => l(\"error\", ...o),\n /**\n * Gets the current log level.\n */\n getLevel: () => e.logLevel,\n /**\n * Gets the current namespace prefix.\n */\n getPrefix: () => e.namespace,\n /**\n * Gets whether timestamps are shown.\n */\n getTimestamp: () => e.timestamp,\n /**\n * Creates a collapsed group in the console.\n */\n groupCollapsed: (o, r = \"GROUP\", t = Date.now()) => {\n if (!d(\"success\")) return;\n const s = E(t), n = b();\n console.groupCollapsed(\n `%c${r}%c${e.namespace}%c${n}%c${e.timestamp ? u() : \"\"}%c${s}%c${o}`,\n g(\"group\", \"margin-right: 6px; padding: 1px 3px 0\"),\n g(\"ns\", \" border-radius: 8px; font: italic small-caps bold 12px; font-weight: lighter;margin-right: 6px;\"),\n \"color: darkgray; margin-right: 6px;\",\n \"color: gray;font-weight: lighter;margin-right: 6px;\",\n \"color: gray; font-weight: lighter;margin-right: 6px;\",\n \"color: inherit;font-weight: lighter;\"\n );\n },\n /**\n * Ends the current console group.\n */\n groupEnd: () => {\n d(\"success\") && console.groupEnd();\n },\n info: (...o) => l(\"info\", ...o),\n /**\n * Initializes Logit with custom options.\n */\n initialise: (o) => {\n Object.assign(e, o);\n },\n /**\n * Sets the minimum log level to display.\n */\n setLogLevel: (o) => {\n e.logLevel = o;\n },\n /**\n * Sets the namespace prefix for all logs.\n */\n setPrefix: (o) => {\n e.namespace = o;\n },\n /**\n * Configures remote logging options.\n */\n setRemote: (o) => {\n e.remote = o;\n },\n /**\n * Sets the log level for remote logging.\n */\n setRemoteLogLevel: (o) => {\n e.remote.logLevel = o;\n },\n /**\n * Sets the display variant (text, icon, or symbol).\n */\n setVariant: (o) => {\n e.variant = o;\n },\n /**\n * Shows or hides the environment indicator.\n */\n showEnvironment: (o) => {\n e.environment = o;\n },\n /**\n * Shows or hides timestamps in logs.\n */\n showTimestamp: (o) => {\n e.timestamp = o;\n },\n success: (...o) => l(\"success\", ...o),\n /**\n * Displays data in a table format.\n */\n table: (...o) => {\n d(\"table\") && console.table(...o);\n },\n /**\n * Starts a timer with the given label.\n */\n time: (o) => {\n d(\"time\") && console.time(o);\n },\n /**\n * Ends a timer with the given label.\n */\n timeEnd: (o) => {\n d(\"time\") && console.timeEnd(o);\n },\n trace: (...o) => l(\"trace\", ...o),\n warn: (...o) => l(\"warn\", ...o)\n};\ntypeof window < \"u\" && (window.Logit = _);\nexport {\n _ as Logit\n};\n//# sourceMappingURL=logit.js.map\n"],"names":["v","$","e","d","o","b","x","p","g","L","i","a","E","_"],"mappings":"AAAA,MAAM,IAAI,CAAA,GACJ,IAAI;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AACX,GAAGA,IAAI,MAAM,GAAG,aAAa,cAAcC,IAAI,OAAO,SAAS,OAAO,OAAO,aAAa,8BAA8B,EAAE,SAAS,IAAI;AAAA,EACrI,OAAO,EAAE,IAAI,WAAW,QAAQ,WAAW,OAAO,QAAQ,MAAM,KAAK,QAAQ,KAAI;AAAA,EACjF,OAAO,EAAE,IAAI,WAAW,QAAQ,WAAW,OAAO,QAAQ,MAAM,KAAK,QAAQ,KAAI;AAAA,EACjF,OAA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AS,GAAGA,CAAC;AAAA,EAChC,MAAM,IAAIA,MAAM,EAAE,QAAQ,GAAGA,CAAC;AAChC;AACA,OAAO,SAAS,QAAQ,OAAO,QAAQS;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./sum.cjs");function o(t,n){if(t.length===0)return;let e;try{e=i.sum(t,n)}catch(r){if(r instanceof TypeError)return;throw r}if(typeof e=="number")return e/t.length;if(e instanceof Date)return new Date(e.getTime()/t.length)}exports.average=o;
2
+ //# sourceMappingURL=average.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"average.cjs","sources":["../../src/math/average.ts"],"sourcesContent":["import { sum } from './sum';\n\n/**\n * Calculates the average of an array of numbers or dates.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4, 5];\n * average(arr); // 3\n * average(arr, (num) => num * 2); // 6\n * average(arr, (num) => new Date(Date.now() + 1000 * 60 * 60 * 24 * num); // Date object representing 3 days from now\n * ```\n *\n * @param array - The array of numbers or dates to average.\n * @param callback - (optional) A callback function to map the values.\n * @returns The average of the numbers or dates in the array.\n */\n\nexport function average<T>(array: T[], callback?: (item: T) => number | Date): number | Date | undefined {\n if (array.length === 0) return undefined;\n let total: number | Date | undefined;\n try {\n total = sum(array, callback);\n } catch (err) {\n if (err instanceof TypeError) return undefined;\n throw err;\n }\n if (typeof total === 'number') {\n return total / array.length;\n }\n if (total instanceof Date) {\n // For dates, average by dividing the timestamp sum by array length\n return new Date(total.getTime() / array.length);\n }\n return undefined;\n}\n"],"names":["average","array","callback","total","sum","err"],"mappings":"6GAkBO,SAASA,EAAWC,EAAYC,EAAkE,CACvG,GAAID,EAAM,SAAW,EAAG,OACxB,IAAIE,EACJ,GAAI,CACFA,EAAQC,EAAAA,IAAIH,EAAOC,CAAQ,CAC7B,OAASG,EAAK,CACZ,GAAIA,aAAe,UAAW,OAC9B,MAAMA,CACR,CACA,GAAI,OAAOF,GAAU,SACnB,OAAOA,EAAQF,EAAM,OAEvB,GAAIE,aAAiB,KAEnB,OAAO,IAAI,KAAKA,EAAM,QAAA,EAAYF,EAAM,MAAM,CAGlD"}
@@ -0,0 +1,19 @@
1
+ import { sum as o } from "./sum.js";
2
+ function f(t, r) {
3
+ if (t.length === 0) return;
4
+ let e;
5
+ try {
6
+ e = o(t, r);
7
+ } catch (n) {
8
+ if (n instanceof TypeError) return;
9
+ throw n;
10
+ }
11
+ if (typeof e == "number")
12
+ return e / t.length;
13
+ if (e instanceof Date)
14
+ return new Date(e.getTime() / t.length);
15
+ }
16
+ export {
17
+ f as average
18
+ };
19
+ //# sourceMappingURL=average.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"average.js","sources":["../../src/math/average.ts"],"sourcesContent":["import { sum } from './sum';\n\n/**\n * Calculates the average of an array of numbers or dates.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4, 5];\n * average(arr); // 3\n * average(arr, (num) => num * 2); // 6\n * average(arr, (num) => new Date(Date.now() + 1000 * 60 * 60 * 24 * num); // Date object representing 3 days from now\n * ```\n *\n * @param array - The array of numbers or dates to average.\n * @param callback - (optional) A callback function to map the values.\n * @returns The average of the numbers or dates in the array.\n */\n\nexport function average<T>(array: T[], callback?: (item: T) => number | Date): number | Date | undefined {\n if (array.length === 0) return undefined;\n let total: number | Date | undefined;\n try {\n total = sum(array, callback);\n } catch (err) {\n if (err instanceof TypeError) return undefined;\n throw err;\n }\n if (typeof total === 'number') {\n return total / array.length;\n }\n if (total instanceof Date) {\n // For dates, average by dividing the timestamp sum by array length\n return new Date(total.getTime() / array.length);\n }\n return undefined;\n}\n"],"names":["average","array","callback","total","sum","err"],"mappings":";AAkBO,SAASA,EAAWC,GAAYC,GAAkE;AACvG,MAAID,EAAM,WAAW,EAAG;AACxB,MAAIE;AACJ,MAAI;AACF,IAAAA,IAAQC,EAAIH,GAAOC,CAAQ;AAAA,EAC7B,SAASG,GAAK;AACZ,QAAIA,aAAe,UAAW;AAC9B,UAAMA;AAAA,EACR;AACA,MAAI,OAAOF,KAAU;AACnB,WAAOA,IAAQF,EAAM;AAEvB,MAAIE,aAAiB;AAEnB,WAAO,IAAI,KAAKA,EAAM,QAAA,IAAYF,EAAM,MAAM;AAGlD;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../function/assert.cjs"),o=require("../typed/isArray.cjs");function u(e,s){n.assert(o.isArray(e),o.IS_ARRAY_ERROR_MSG,{args:{array:e,callback:s},type:TypeError});const i=s;let t=e[0];for(let r=1;r<e.length;r++)t=i(t,e[r]);return t}exports.boil=u;
2
+ //# sourceMappingURL=boil.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boil.cjs","sources":["../../src/math/boil.ts"],"sourcesContent":["import { assert } from '../function/assert';\nimport { IS_ARRAY_ERROR_MSG, isArray } from '../typed/isArray';\n\n/**\n * Boils down an array to a single value by applying a callback function to each pair of elements.\n *\n * @example\n * ```ts\n * boil([1, 2, 3]) // 3\n * boil([1, 2, 3], (a, b) => a > b ? a : b) // 3\n * boil([1, 2, 3], (a, b) => a + b) // 6\n * boil([{ a: 1 }, { a: 2 }, { a: 3 }], (a, b) => ({ a: a.a + b.a })) // { a: 6 }\n * boil([], (a, b) => a + b) // undefined\n * boil([1], (a, b) => a + b) // 1\n * ```\n *\n * @param array - The array to be boiled down.\n * @param callback - The function to invoke for each pair of elements in the array.\n *\n * @return The boiled down value, or `undefined` if the array is empty.\n */\nexport function boil<T>(array: readonly T[], callback: (a: T, b: T) => T): T | undefined {\n assert(isArray(array), IS_ARRAY_ERROR_MSG, {\n args: { array, callback },\n type: TypeError,\n });\n\n const fn = callback;\n\n let result = array[0];\n for (let i = 1; i < array.length; i++) {\n result = fn(result, array[i]);\n }\n return result;\n}\n"],"names":["boil","array","callback","assert","isArray","IS_ARRAY_ERROR_MSG","fn","result","i"],"mappings":"4JAqBO,SAASA,EAAQC,EAAqBC,EAA4C,CACvFC,EAAAA,OAAOC,EAAAA,QAAQH,CAAK,EAAGI,qBAAoB,CACzC,KAAM,CAAE,MAAAJ,EAAO,SAAAC,CAAA,EACf,KAAM,SAAA,CACP,EAED,MAAMI,EAAKJ,EAEX,IAAIK,EAASN,EAAM,CAAC,EACpB,QAASO,EAAI,EAAGA,EAAIP,EAAM,OAAQO,IAChCD,EAASD,EAAGC,EAAQN,EAAMO,CAAC,CAAC,EAE9B,OAAOD,CACT"}
@@ -0,0 +1,17 @@
1
+ import { assert as n } from "../function/assert.js";
2
+ import { IS_ARRAY_ERROR_MSG as s, isArray as f } from "../typed/isArray.js";
3
+ function m(t, r) {
4
+ n(f(t), s, {
5
+ args: { array: t, callback: r },
6
+ type: TypeError
7
+ });
8
+ const i = r;
9
+ let o = t[0];
10
+ for (let e = 1; e < t.length; e++)
11
+ o = i(o, t[e]);
12
+ return o;
13
+ }
14
+ export {
15
+ m as boil
16
+ };
17
+ //# sourceMappingURL=boil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boil.js","sources":["../../src/math/boil.ts"],"sourcesContent":["import { assert } from '../function/assert';\nimport { IS_ARRAY_ERROR_MSG, isArray } from '../typed/isArray';\n\n/**\n * Boils down an array to a single value by applying a callback function to each pair of elements.\n *\n * @example\n * ```ts\n * boil([1, 2, 3]) // 3\n * boil([1, 2, 3], (a, b) => a > b ? a : b) // 3\n * boil([1, 2, 3], (a, b) => a + b) // 6\n * boil([{ a: 1 }, { a: 2 }, { a: 3 }], (a, b) => ({ a: a.a + b.a })) // { a: 6 }\n * boil([], (a, b) => a + b) // undefined\n * boil([1], (a, b) => a + b) // 1\n * ```\n *\n * @param array - The array to be boiled down.\n * @param callback - The function to invoke for each pair of elements in the array.\n *\n * @return The boiled down value, or `undefined` if the array is empty.\n */\nexport function boil<T>(array: readonly T[], callback: (a: T, b: T) => T): T | undefined {\n assert(isArray(array), IS_ARRAY_ERROR_MSG, {\n args: { array, callback },\n type: TypeError,\n });\n\n const fn = callback;\n\n let result = array[0];\n for (let i = 1; i < array.length; i++) {\n result = fn(result, array[i]);\n }\n return result;\n}\n"],"names":["boil","array","callback","assert","isArray","IS_ARRAY_ERROR_MSG","fn","result","i"],"mappings":";;AAqBO,SAASA,EAAQC,GAAqBC,GAA4C;AACvF,EAAAC,EAAOC,EAAQH,CAAK,GAAGI,GAAoB;AAAA,IACzC,MAAM,EAAE,OAAAJ,GAAO,UAAAC,EAAA;AAAA,IACf,MAAM;AAAA,EAAA,CACP;AAED,QAAMI,IAAKJ;AAEX,MAAIK,IAASN,EAAM,CAAC;AACpB,WAASO,IAAI,GAAGA,IAAIP,EAAM,QAAQO;AAChC,IAAAD,IAASD,EAAGC,GAAQN,EAAMO,CAAC,CAAC;AAE9B,SAAOD;AACT;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(t,e,a){return Math.min(Math.max(t,e),a)}exports.clamp=n;
2
+ //# sourceMappingURL=clamp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clamp.cjs","sources":["../../src/math/clamp.ts"],"sourcesContent":["/**\n * The `clamp` function restricts a number to be within a specified range.\n *\n * @example\n * ```ts\n * clamp(5, 1, 10) // 5\n * clamp(0, 1, 10) // 1\n * clamp(15, 1, 10) // 10\n * ```\n *\n * @param n - The number to be clamped.\n * @param min - The minimum value of the range.\n * @param max - The maximum value of the range.\n *\n * @returns The clamped number.\n */\nexport function clamp(n: number, min: number, max: number): number {\n return Math.min(Math.max(n, min), max);\n}\n"],"names":["clamp","n","min","max"],"mappings":"gFAgBO,SAASA,EAAMC,EAAWC,EAAaC,EAAqB,CACjE,OAAO,KAAK,IAAI,KAAK,IAAIF,EAAGC,CAAG,EAAGC,CAAG,CACvC"}
@@ -0,0 +1,7 @@
1
+ function m(t, a, n) {
2
+ return Math.min(Math.max(t, a), n);
3
+ }
4
+ export {
5
+ m as clamp
6
+ };
7
+ //# sourceMappingURL=clamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clamp.js","sources":["../../src/math/clamp.ts"],"sourcesContent":["/**\n * The `clamp` function restricts a number to be within a specified range.\n *\n * @example\n * ```ts\n * clamp(5, 1, 10) // 5\n * clamp(0, 1, 10) // 1\n * clamp(15, 1, 10) // 10\n * ```\n *\n * @param n - The number to be clamped.\n * @param min - The minimum value of the range.\n * @param max - The maximum value of the range.\n *\n * @returns The clamped number.\n */\nexport function clamp(n: number, min: number, max: number): number {\n return Math.min(Math.max(n, min), max);\n}\n"],"names":["clamp","n","min","max"],"mappings":"AAgBO,SAASA,EAAMC,GAAWC,GAAaC,GAAqB;AACjE,SAAO,KAAK,IAAI,KAAK,IAAIF,GAAGC,CAAG,GAAGC,CAAG;AACvC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../function/compare.cjs"),u=require("./boil.cjs");function a(t,n){return u.boil(t,(e,r)=>{const o=n||(c=>c);return i.compare(o(e),o(r))>0?e:r})}exports.max=a;
2
+ //# sourceMappingURL=max.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max.cjs","sources":["../../src/math/max.ts"],"sourcesContent":["import { compare } from '../function/compare';\nimport { boil } from './boil';\n\n/**\n * Finds the maximum item in an array.\n *\n * @description\n * This function can be used to find the maximum number, string, or any other type of item in an array.\n *\n * @example\n * ```ts\n * max([1, 2, 3]); // 3\n * max([{ value: 1 }, { value: 2 }, { value: 3 }], item => item.value); // 3\n * max(['apple', 'banana', 'cherry']); // 'cherry'\n * max([new Date('2023-01-01'), new Date('2022-01-01')]); // 2023-01-01\n * ```\n *\n * @param array - The array to be searched.\n * @param [callback] - (optional) The function to invoke for each element in the array to determine its value.\n *\n * @return The item with the maximum value as determined by the callback function.\n *\n * @throws {TypeError} If the provided array is not an array.\n */\nexport function max<T>(array: T[], callback?: (item: T) => string | number | Date): T | undefined {\n return boil(array, (a, b) => {\n const fn = callback || ((item: T) => item);\n return compare(fn(a), fn(b)) > 0 ? a : b;\n });\n}\n"],"names":["max","array","callback","boil","a","b","fn","item","compare"],"mappings":"mJAwBO,SAASA,EAAOC,EAAYC,EAA+D,CAChG,OAAOC,OAAKF,EAAO,CAACG,EAAGC,IAAM,CAC3B,MAAMC,EAAKJ,IAAcK,GAAYA,GACrC,OAAOC,EAAAA,QAAQF,EAAGF,CAAC,EAAGE,EAAGD,CAAC,CAAC,EAAI,EAAID,EAAIC,CACzC,CAAC,CACH"}
@@ -0,0 +1,12 @@
1
+ import { compare as f } from "../function/compare.js";
2
+ import { boil as i } from "./boil.js";
3
+ function u(m, n) {
4
+ return i(m, (r, o) => {
5
+ const t = n || ((e) => e);
6
+ return f(t(r), t(o)) > 0 ? r : o;
7
+ });
8
+ }
9
+ export {
10
+ u as max
11
+ };
12
+ //# sourceMappingURL=max.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max.js","sources":["../../src/math/max.ts"],"sourcesContent":["import { compare } from '../function/compare';\nimport { boil } from './boil';\n\n/**\n * Finds the maximum item in an array.\n *\n * @description\n * This function can be used to find the maximum number, string, or any other type of item in an array.\n *\n * @example\n * ```ts\n * max([1, 2, 3]); // 3\n * max([{ value: 1 }, { value: 2 }, { value: 3 }], item => item.value); // 3\n * max(['apple', 'banana', 'cherry']); // 'cherry'\n * max([new Date('2023-01-01'), new Date('2022-01-01')]); // 2023-01-01\n * ```\n *\n * @param array - The array to be searched.\n * @param [callback] - (optional) The function to invoke for each element in the array to determine its value.\n *\n * @return The item with the maximum value as determined by the callback function.\n *\n * @throws {TypeError} If the provided array is not an array.\n */\nexport function max<T>(array: T[], callback?: (item: T) => string | number | Date): T | undefined {\n return boil(array, (a, b) => {\n const fn = callback || ((item: T) => item);\n return compare(fn(a), fn(b)) > 0 ? a : b;\n });\n}\n"],"names":["max","array","callback","boil","a","b","fn","item","compare"],"mappings":";;AAwBO,SAASA,EAAOC,GAAYC,GAA+D;AAChG,SAAOC,EAAKF,GAAO,CAACG,GAAGC,MAAM;AAC3B,UAAMC,IAAKJ,MAAa,CAACK,MAAYA;AACrC,WAAOC,EAAQF,EAAGF,CAAC,GAAGE,EAAGD,CAAC,CAAC,IAAI,IAAID,IAAIC;AAAA,EACzC,CAAC;AACH;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(n,a){if(n.length===0)return;const i=a?n.map(a):n,l=i.every(e=>e instanceof Date),t=i.map(e=>e instanceof Date?e.getTime():e);t.sort((e,u)=>e-u);const o=Math.floor(t.length/2),s=t.length%2===0?(t[o-1]+t[o])/2:t[o];return l?new Date(s):s}exports.median=c;
2
+ //# sourceMappingURL=median.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"median.cjs","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 * median([new Date(2020-01-01), new Date(2020-01-02), new Date(2020-01-31)]) // 2020-01-02\n * ```\n *\n * @param arr - The array of numbers.\n * @param callback - (optional) A callback function to map the numbers.\n * @returns The median of the numbers.\n */\nexport function median<T>(arr: T[], callback?: (item: T) => number | Date): number | Date | undefined {\n if (arr.length === 0) return undefined;\n\n const values = callback ? arr.map(callback) : (arr as unknown as (number | Date)[]);\n const allDates = values.every((v) => v instanceof Date);\n const numericValues = values.map((v) => (v instanceof Date ? v.getTime() : (v as number)));\n\n numericValues.sort((a, b) => a - b);\n\n const mid = Math.floor(numericValues.length / 2);\n const medianValue =\n numericValues.length % 2 === 0 ? (numericValues[mid - 1] + numericValues[mid]) / 2 : numericValues[mid];\n\n return allDates ? new Date(medianValue) : medianValue;\n}\n"],"names":["median","arr","callback","values","allDates","v","numericValues","a","b","mid","medianValue"],"mappings":"gFAgBO,SAASA,EAAUC,EAAUC,EAAkE,CACpG,GAAID,EAAI,SAAW,EAAG,OAEtB,MAAME,EAASD,EAAWD,EAAI,IAAIC,CAAQ,EAAKD,EACzCG,EAAWD,EAAO,MAAOE,GAAMA,aAAa,IAAI,EAChDC,EAAgBH,EAAO,IAAKE,GAAOA,aAAa,KAAOA,EAAE,QAAA,EAAaA,CAAa,EAEzFC,EAAc,KAAK,CAACC,EAAGC,IAAMD,EAAIC,CAAC,EAElC,MAAMC,EAAM,KAAK,MAAMH,EAAc,OAAS,CAAC,EACzCI,EACJJ,EAAc,OAAS,IAAM,GAAKA,EAAcG,EAAM,CAAC,EAAIH,EAAcG,CAAG,GAAK,EAAIH,EAAcG,CAAG,EAExG,OAAOL,EAAW,IAAI,KAAKM,CAAW,EAAIA,CAC5C"}
@@ -0,0 +1,11 @@
1
+ function m(n, a) {
2
+ if (n.length === 0) return;
3
+ const s = a ? n.map(a) : n, c = s.every((e) => e instanceof Date), t = s.map((e) => e instanceof Date ? e.getTime() : e);
4
+ t.sort((e, l) => e - l);
5
+ const o = Math.floor(t.length / 2), i = t.length % 2 === 0 ? (t[o - 1] + t[o]) / 2 : t[o];
6
+ return c ? new Date(i) : i;
7
+ }
8
+ export {
9
+ m as median
10
+ };
11
+ //# sourceMappingURL=median.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"median.js","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 * median([new Date(2020-01-01), new Date(2020-01-02), new Date(2020-01-31)]) // 2020-01-02\n * ```\n *\n * @param arr - The array of numbers.\n * @param callback - (optional) A callback function to map the numbers.\n * @returns The median of the numbers.\n */\nexport function median<T>(arr: T[], callback?: (item: T) => number | Date): number | Date | undefined {\n if (arr.length === 0) return undefined;\n\n const values = callback ? arr.map(callback) : (arr as unknown as (number | Date)[]);\n const allDates = values.every((v) => v instanceof Date);\n const numericValues = values.map((v) => (v instanceof Date ? v.getTime() : (v as number)));\n\n numericValues.sort((a, b) => a - b);\n\n const mid = Math.floor(numericValues.length / 2);\n const medianValue =\n numericValues.length % 2 === 0 ? (numericValues[mid - 1] + numericValues[mid]) / 2 : numericValues[mid];\n\n return allDates ? new Date(medianValue) : medianValue;\n}\n"],"names":["median","arr","callback","values","allDates","v","numericValues","a","b","mid","medianValue"],"mappings":"AAgBO,SAASA,EAAUC,GAAUC,GAAkE;AACpG,MAAID,EAAI,WAAW,EAAG;AAEtB,QAAME,IAASD,IAAWD,EAAI,IAAIC,CAAQ,IAAKD,GACzCG,IAAWD,EAAO,MAAM,CAACE,MAAMA,aAAa,IAAI,GAChDC,IAAgBH,EAAO,IAAI,CAACE,MAAOA,aAAa,OAAOA,EAAE,QAAA,IAAaA,CAAa;AAEzF,EAAAC,EAAc,KAAK,CAACC,GAAGC,MAAMD,IAAIC,CAAC;AAElC,QAAMC,IAAM,KAAK,MAAMH,EAAc,SAAS,CAAC,GACzCI,IACJJ,EAAc,SAAS,MAAM,KAAKA,EAAcG,IAAM,CAAC,IAAIH,EAAcG,CAAG,KAAK,IAAIH,EAAcG,CAAG;AAExG,SAAOL,IAAW,IAAI,KAAKM,CAAW,IAAIA;AAC5C;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../function/compare.cjs"),u=require("./boil.cjs");function l(o,t){return u.boil(o,(e,r)=>{const n=t||(i=>i);return c.compare(n(e),n(r))<0?e:r})}exports.min=l;
2
+ //# sourceMappingURL=min.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"min.cjs","sources":["../../src/math/min.ts"],"sourcesContent":["import { compare } from '../function/compare';\nimport { boil } from './boil';\n\n/**\n * Finds the minimum item in an array.\n *\n * @description\n * This function can be used to find the minimum number, string, or any other type of item in an array.\n *\n * @example\n * ```ts\n * min([1, 2, 3]); // 1\n * min([{ value: 1 }, { value: 2 }, { value: 3 }], item => item.value); // 1\n * min(['apple', 'banana', 'cherry']); // 'apple'\n * min([new Date('2023-01-01'), new Date('2022-01-01')]); // 2022-01-01\n * ```\n *\n * @param array - The array to be searched.\n * @param [callback] - (optional) The function to invoke for each element in the array to determine its value.\n *\n * @return The item with the minimum value as determined by the callback function.\n *\n * @throws {TypeError} If the provided array is not an array.\n */\nexport function min<T>(array: T[], callback?: (item: T) => string | number | Date): T | undefined {\n return boil(array, (a, b) => {\n const fn = callback || ((item: T) => item);\n return compare(fn(a), fn(b)) < 0 ? a : b;\n });\n}\n"],"names":["min","array","callback","boil","a","b","fn","item","compare"],"mappings":"mJAwBO,SAASA,EAAOC,EAAYC,EAA+D,CAChG,OAAOC,OAAKF,EAAO,CAACG,EAAGC,IAAM,CAC3B,MAAMC,EAAKJ,IAAcK,GAAYA,GACrC,OAAOC,EAAAA,QAAQF,EAAGF,CAAC,EAAGE,EAAGD,CAAC,CAAC,EAAI,EAAID,EAAIC,CACzC,CAAC,CACH"}