@vielzeug/toolkit 1.1.3 → 2.1.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.
- package/README.md +325 -452
- package/dist/array/chunk.cjs +2 -2
- package/dist/array/chunk.cjs.map +1 -1
- package/dist/array/chunk.d.ts +29 -0
- package/dist/array/chunk.d.ts.map +1 -0
- package/dist/array/chunk.js +22 -24
- package/dist/array/chunk.js.map +1 -1
- package/dist/array/contains.cjs +2 -2
- package/dist/array/contains.cjs.map +1 -1
- package/dist/array/contains.d.ts +19 -0
- package/dist/array/contains.d.ts.map +1 -0
- package/dist/array/contains.js +12 -9
- package/dist/array/contains.js.map +1 -1
- package/dist/array/fold.cjs +2 -0
- package/dist/array/fold.cjs.map +1 -0
- package/dist/array/fold.d.ts +21 -0
- package/dist/array/fold.d.ts.map +1 -0
- package/dist/array/fold.js +19 -0
- package/dist/array/fold.js.map +1 -0
- package/dist/array/group.cjs +2 -2
- package/dist/array/group.cjs.map +1 -1
- package/dist/array/group.d.ts +19 -0
- package/dist/array/group.d.ts.map +1 -0
- package/dist/array/group.js +18 -15
- package/dist/array/group.js.map +1 -1
- package/dist/array/index.d.ts +16 -0
- package/dist/array/index.d.ts.map +1 -0
- package/dist/array/keyBy.cjs +2 -0
- package/dist/array/keyBy.cjs.map +1 -0
- package/dist/array/keyBy.d.ts +20 -0
- package/dist/array/keyBy.d.ts.map +1 -0
- package/dist/array/keyBy.js +19 -0
- package/dist/array/keyBy.js.map +1 -0
- package/dist/array/list.cjs +2 -2
- package/dist/array/list.cjs.map +1 -1
- package/dist/array/list.d.ts +58 -0
- package/dist/array/list.d.ts.map +1 -0
- package/dist/array/list.js +103 -106
- package/dist/array/list.js.map +1 -1
- package/dist/array/pick.cjs +2 -2
- package/dist/array/pick.cjs.map +1 -1
- package/dist/array/pick.d.ts +19 -0
- package/dist/array/pick.d.ts.map +1 -0
- package/dist/array/pick.js +15 -14
- package/dist/array/pick.js.map +1 -1
- package/dist/array/remoteList.cjs +2 -2
- package/dist/array/remoteList.cjs.map +1 -1
- package/dist/array/remoteList.d.ts +64 -0
- package/dist/array/remoteList.d.ts.map +1 -0
- package/dist/array/remoteList.js +121 -122
- package/dist/array/remoteList.js.map +1 -1
- package/dist/array/replace.cjs +2 -0
- package/dist/array/replace.cjs.map +1 -0
- package/dist/array/replace.d.ts +20 -0
- package/dist/array/replace.d.ts.map +1 -0
- package/dist/array/replace.js +19 -0
- package/dist/array/replace.js.map +1 -0
- package/dist/array/rotate.cjs +2 -0
- package/dist/array/rotate.cjs.map +1 -0
- package/dist/array/rotate.d.ts +22 -0
- package/dist/array/rotate.d.ts.map +1 -0
- package/dist/array/rotate.js +19 -0
- package/dist/array/rotate.js.map +1 -0
- package/dist/array/search.cjs +2 -2
- package/dist/array/search.cjs.map +1 -1
- package/dist/array/search.d.ts +19 -0
- package/dist/array/search.d.ts.map +1 -0
- package/dist/array/search.js +23 -13
- package/dist/array/search.js.map +1 -1
- package/dist/array/select.cjs +2 -2
- package/dist/array/select.cjs.map +1 -1
- package/dist/array/select.d.ts +21 -0
- package/dist/array/select.d.ts.map +1 -0
- package/dist/array/select.js +16 -15
- package/dist/array/select.js.map +1 -1
- package/dist/array/sort.cjs +2 -2
- package/dist/array/sort.cjs.map +1 -1
- package/dist/array/sort.d.ts +26 -0
- package/dist/array/sort.d.ts.map +1 -0
- package/dist/array/sort.js +18 -12
- package/dist/array/sort.js.map +1 -1
- package/dist/array/toggle.cjs +2 -0
- package/dist/array/toggle.cjs.map +1 -0
- package/dist/array/toggle.d.ts +29 -0
- package/dist/array/toggle.d.ts.map +1 -0
- package/dist/array/toggle.js +9 -0
- package/dist/array/toggle.js.map +1 -0
- package/dist/array/uniq.cjs +2 -2
- package/dist/array/uniq.cjs.map +1 -1
- package/dist/array/uniq.d.ts +21 -0
- package/dist/array/uniq.d.ts.map +1 -0
- package/dist/array/uniq.js +15 -17
- package/dist/array/uniq.js.map +1 -1
- package/dist/async/attempt.cjs +2 -2
- package/dist/async/attempt.cjs.map +1 -1
- package/dist/async/attempt.d.ts +40 -0
- package/dist/async/attempt.d.ts.map +1 -0
- package/dist/async/attempt.js +19 -14
- package/dist/async/attempt.js.map +1 -1
- package/dist/async/defer.cjs +2 -2
- package/dist/async/defer.cjs.map +1 -1
- package/dist/async/defer.d.ts +23 -0
- package/dist/async/defer.d.ts.map +1 -0
- package/dist/async/defer.js +12 -9
- package/dist/async/defer.js.map +1 -1
- package/dist/async/index.d.ts +12 -0
- package/dist/async/index.d.ts.map +1 -0
- package/dist/async/parallel.cjs +2 -2
- package/dist/async/parallel.cjs.map +1 -1
- package/dist/async/parallel.d.ts +31 -0
- package/dist/async/parallel.d.ts.map +1 -0
- package/dist/async/parallel.js +26 -27
- package/dist/async/parallel.js.map +1 -1
- package/dist/async/pool.cjs +2 -2
- package/dist/async/pool.cjs.map +1 -1
- package/dist/async/pool.d.ts +21 -0
- package/dist/async/pool.d.ts.map +1 -0
- package/dist/async/pool.js +23 -21
- package/dist/async/pool.js.map +1 -1
- package/dist/async/predict.cjs +2 -2
- package/dist/async/predict.cjs.map +1 -1
- package/dist/async/predict.d.ts +24 -0
- package/dist/async/predict.d.ts.map +1 -0
- package/dist/async/predict.js +10 -12
- package/dist/async/predict.js.map +1 -1
- package/dist/async/queue.cjs +2 -2
- package/dist/async/queue.cjs.map +1 -1
- package/dist/async/queue.d.ts +43 -0
- package/dist/async/queue.d.ts.map +1 -0
- package/dist/async/queue.js +52 -56
- package/dist/async/queue.js.map +1 -1
- package/dist/async/race.cjs +2 -2
- package/dist/async/race.cjs.map +1 -1
- package/dist/async/race.d.ts +16 -0
- package/dist/async/race.d.ts.map +1 -0
- package/dist/async/race.js +8 -7
- package/dist/async/race.js.map +1 -1
- package/dist/async/retry.cjs +2 -2
- package/dist/async/retry.cjs.map +1 -1
- package/dist/async/retry.d.ts +32 -0
- package/dist/async/retry.d.ts.map +1 -0
- package/dist/async/retry.js +19 -24
- package/dist/async/retry.js.map +1 -1
- package/dist/async/scheduler.cjs +2 -0
- package/dist/async/scheduler.cjs.map +1 -0
- package/dist/async/scheduler.d.ts +51 -0
- package/dist/async/scheduler.d.ts.map +1 -0
- package/dist/async/scheduler.js +43 -0
- package/dist/async/scheduler.js.map +1 -0
- package/dist/async/sleep.cjs +2 -2
- package/dist/async/sleep.cjs.map +1 -1
- package/dist/async/sleep.d.ts +16 -0
- package/dist/async/sleep.d.ts.map +1 -0
- package/dist/async/sleep.js +11 -11
- package/dist/async/sleep.js.map +1 -1
- package/dist/async/waitFor.cjs +2 -2
- package/dist/async/waitFor.cjs.map +1 -1
- package/dist/async/waitFor.d.ts +33 -0
- package/dist/async/waitFor.d.ts.map +1 -0
- package/dist/async/waitFor.js +29 -36
- package/dist/async/waitFor.js.map +1 -1
- package/dist/date/expires.cjs +2 -2
- package/dist/date/expires.cjs.map +1 -1
- package/dist/date/expires.d.ts +15 -0
- package/dist/date/expires.d.ts.map +1 -0
- package/dist/date/expires.js +11 -10
- package/dist/date/expires.js.map +1 -1
- package/dist/date/index.d.ts +4 -0
- package/dist/date/index.d.ts.map +1 -0
- package/dist/date/interval.cjs +2 -2
- package/dist/date/interval.cjs.map +1 -1
- package/dist/date/interval.d.ts +25 -0
- package/dist/date/interval.d.ts.map +1 -0
- package/dist/date/interval.js +31 -37
- package/dist/date/interval.js.map +1 -1
- package/dist/date/timeDiff.cjs +2 -2
- package/dist/date/timeDiff.cjs.map +1 -1
- package/dist/date/timeDiff.d.ts +24 -0
- package/dist/date/timeDiff.d.ts.map +1 -0
- package/dist/date/timeDiff.js +58 -25
- package/dist/date/timeDiff.js.map +1 -1
- package/dist/function/assert.cjs +2 -3
- package/dist/function/assert.cjs.map +1 -1
- package/dist/function/assert.d.ts +38 -0
- package/dist/function/assert.d.ts.map +1 -0
- package/dist/function/assert.js +13 -11
- package/dist/function/assert.js.map +1 -1
- package/dist/function/assertParams.cjs +2 -2
- package/dist/function/assertParams.cjs.map +1 -1
- package/dist/function/assertParams.d.ts +24 -0
- package/dist/function/assertParams.d.ts.map +1 -0
- package/dist/function/assertParams.js +13 -12
- package/dist/function/assertParams.js.map +1 -1
- package/dist/function/compare.cjs +2 -2
- package/dist/function/compare.cjs.map +1 -1
- package/dist/function/compare.d.ts +23 -0
- package/dist/function/compare.d.ts.map +1 -0
- package/dist/function/compare.js +22 -21
- package/dist/function/compare.js.map +1 -1
- package/dist/function/compareBy.cjs +2 -2
- package/dist/function/compareBy.cjs.map +1 -1
- package/dist/function/compareBy.d.ts +24 -0
- package/dist/function/compareBy.d.ts.map +1 -0
- package/dist/function/compareBy.js +15 -14
- package/dist/function/compareBy.js.map +1 -1
- package/dist/function/compose.cjs +2 -2
- package/dist/function/compose.cjs.map +1 -1
- package/dist/function/compose.d.ts +22 -0
- package/dist/function/compose.d.ts.map +1 -0
- package/dist/function/compose.js +10 -13
- package/dist/function/compose.js.map +1 -1
- package/dist/function/curry.cjs +2 -2
- package/dist/function/curry.cjs.map +1 -1
- package/dist/function/curry.d.ts +21 -0
- package/dist/function/curry.d.ts.map +1 -0
- package/dist/function/curry.js +8 -7
- package/dist/function/curry.js.map +1 -1
- package/dist/function/debounce.cjs +2 -2
- package/dist/function/debounce.cjs.map +1 -1
- package/dist/function/debounce.d.ts +12 -0
- package/dist/function/debounce.d.ts.map +1 -0
- package/dist/function/debounce.js +34 -26
- package/dist/function/debounce.js.map +1 -1
- package/dist/function/fp.cjs +2 -2
- package/dist/function/fp.cjs.map +1 -1
- package/dist/function/fp.d.ts +24 -0
- package/dist/function/fp.d.ts.map +1 -0
- package/dist/function/fp.js +6 -10
- package/dist/function/fp.js.map +1 -1
- package/dist/function/index.d.ts +13 -0
- package/dist/function/index.d.ts.map +1 -0
- package/dist/function/memo.cjs +2 -2
- package/dist/function/memo.cjs.map +1 -1
- package/dist/function/memo.d.ts +30 -0
- package/dist/function/memo.d.ts.map +1 -0
- package/dist/function/memo.js +16 -24
- package/dist/function/memo.js.map +1 -1
- package/dist/function/once.cjs +2 -2
- package/dist/function/once.cjs.map +1 -1
- package/dist/function/once.d.ts +24 -0
- package/dist/function/once.d.ts.map +1 -0
- package/dist/function/once.js +10 -10
- package/dist/function/once.js.map +1 -1
- package/dist/function/pipe.cjs +2 -2
- package/dist/function/pipe.cjs.map +1 -1
- package/dist/function/pipe.d.ts +23 -0
- package/dist/function/pipe.d.ts.map +1 -0
- package/dist/function/pipe.js +10 -10
- package/dist/function/pipe.js.map +1 -1
- package/dist/function/throttle.cjs +2 -2
- package/dist/function/throttle.cjs.map +1 -1
- package/dist/function/throttle.d.ts +21 -0
- package/dist/function/throttle.d.ts.map +1 -0
- package/dist/function/throttle.js +45 -37
- package/dist/function/throttle.js.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.d.ts +77 -2813
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -253
- package/dist/math/abs.cjs +2 -2
- package/dist/math/abs.cjs.map +1 -1
- package/dist/math/abs.d.ts +17 -0
- package/dist/math/abs.d.ts.map +1 -0
- package/dist/math/abs.js +7 -6
- package/dist/math/abs.js.map +1 -1
- package/dist/math/allocate.cjs +2 -2
- package/dist/math/allocate.cjs.map +1 -1
- package/dist/math/allocate.d.ts +24 -0
- package/dist/math/allocate.d.ts.map +1 -0
- package/dist/math/allocate.js +20 -28
- package/dist/math/allocate.js.map +1 -1
- package/dist/math/average.cjs +2 -2
- package/dist/math/average.cjs.map +1 -1
- package/dist/math/average.d.ts +16 -0
- package/dist/math/average.d.ts.map +1 -0
- package/dist/math/average.js +13 -24
- package/dist/math/average.js.map +1 -1
- package/dist/math/clamp.cjs +2 -2
- package/dist/math/clamp.cjs.map +1 -1
- package/dist/math/clamp.d.ts +18 -0
- package/dist/math/clamp.d.ts.map +1 -0
- package/dist/math/clamp.js +7 -6
- package/dist/math/clamp.js.map +1 -1
- package/dist/math/distribute.cjs +2 -2
- package/dist/math/distribute.cjs.map +1 -1
- package/dist/math/distribute.d.ts +24 -0
- package/dist/math/distribute.d.ts.map +1 -0
- package/dist/math/distribute.js +14 -17
- package/dist/math/distribute.js.map +1 -1
- package/dist/math/index.d.ts +14 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/math/linspace.cjs +2 -0
- package/dist/math/linspace.cjs.map +1 -0
- package/dist/math/linspace.d.ts +19 -0
- package/dist/math/linspace.d.ts.map +1 -0
- package/dist/math/linspace.js +11 -0
- package/dist/math/linspace.js.map +1 -0
- package/dist/math/max.cjs +2 -2
- package/dist/math/max.cjs.map +1 -1
- package/dist/math/max.d.ts +23 -0
- package/dist/math/max.d.ts.map +1 -0
- package/dist/math/max.js +10 -11
- package/dist/math/max.js.map +1 -1
- package/dist/math/median.cjs +2 -2
- package/dist/math/median.cjs.map +1 -1
- package/dist/math/median.d.ts +17 -0
- package/dist/math/median.d.ts.map +1 -0
- package/dist/math/median.js +11 -10
- package/dist/math/median.js.map +1 -1
- package/dist/math/min.cjs +2 -2
- package/dist/math/min.cjs.map +1 -1
- package/dist/math/min.d.ts +23 -0
- package/dist/math/min.d.ts.map +1 -0
- package/dist/math/min.js +10 -11
- package/dist/math/min.js.map +1 -1
- package/dist/math/percent.cjs +2 -0
- package/dist/math/percent.cjs.map +1 -0
- package/dist/math/percent.d.ts +19 -0
- package/dist/math/percent.d.ts.map +1 -0
- package/dist/math/percent.js +8 -0
- package/dist/math/percent.js.map +1 -0
- package/dist/math/range.cjs +2 -2
- package/dist/math/range.cjs.map +1 -1
- package/dist/math/range.d.ts +23 -0
- package/dist/math/range.d.ts.map +1 -0
- package/dist/math/range.js +28 -17
- package/dist/math/range.js.map +1 -1
- package/dist/math/round.cjs +2 -2
- package/dist/math/round.cjs.map +1 -1
- package/dist/math/round.d.ts +21 -0
- package/dist/math/round.d.ts.map +1 -0
- package/dist/math/round.js +9 -8
- package/dist/math/round.js.map +1 -1
- package/dist/math/sum.cjs +2 -2
- package/dist/math/sum.cjs.map +1 -1
- package/dist/math/sum.d.ts +17 -0
- package/dist/math/sum.d.ts.map +1 -0
- package/dist/math/sum.js +11 -14
- package/dist/math/sum.js.map +1 -1
- package/dist/money/currency.cjs +2 -2
- package/dist/money/currency.cjs.map +1 -1
- package/dist/money/currency.d.ts +30 -0
- package/dist/money/currency.d.ts.map +1 -0
- package/dist/money/currency.js +19 -47
- package/dist/money/currency.js.map +1 -1
- package/dist/money/exchange.cjs +2 -2
- package/dist/money/exchange.cjs.map +1 -1
- package/dist/money/exchange.d.ts +29 -0
- package/dist/money/exchange.d.ts.map +1 -0
- package/dist/money/exchange.js +12 -12
- package/dist/money/exchange.js.map +1 -1
- package/dist/money/index.d.ts +4 -0
- package/dist/money/index.d.ts.map +1 -0
- package/dist/money/types.d.ts +9 -0
- package/dist/money/types.d.ts.map +1 -0
- package/dist/object/diff.cjs +2 -2
- package/dist/object/diff.cjs.map +1 -1
- package/dist/object/diff.d.ts +26 -0
- package/dist/object/diff.d.ts.map +1 -0
- package/dist/object/diff.js +19 -17
- package/dist/object/diff.js.map +1 -1
- package/dist/object/index.d.ts +9 -0
- package/dist/object/index.d.ts.map +1 -0
- package/dist/object/merge.cjs +2 -2
- package/dist/object/merge.cjs.map +1 -1
- package/dist/object/merge.d.ts +44 -0
- package/dist/object/merge.d.ts.map +1 -0
- package/dist/object/merge.js +27 -21
- package/dist/object/merge.js.map +1 -1
- package/dist/object/parseJSON.cjs +2 -2
- package/dist/object/parseJSON.cjs.map +1 -1
- package/dist/object/parseJSON.d.ts +32 -0
- package/dist/object/parseJSON.d.ts.map +1 -0
- package/dist/object/parseJSON.js +17 -18
- package/dist/object/parseJSON.js.map +1 -1
- package/dist/object/path.cjs +2 -2
- package/dist/object/path.cjs.map +1 -1
- package/dist/object/path.d.ts +32 -0
- package/dist/object/path.d.ts.map +1 -0
- package/dist/object/path.js +25 -23
- package/dist/object/path.js.map +1 -1
- package/dist/object/proxy.cjs +2 -0
- package/dist/object/proxy.cjs.map +1 -0
- package/dist/object/proxy.d.ts +30 -0
- package/dist/object/proxy.d.ts.map +1 -0
- package/dist/object/proxy.js +21 -0
- package/dist/object/proxy.js.map +1 -0
- package/dist/object/prune.cjs +2 -0
- package/dist/object/prune.cjs.map +1 -0
- package/dist/object/prune.d.ts +21 -0
- package/dist/object/prune.d.ts.map +1 -0
- package/dist/object/prune.js +31 -0
- package/dist/object/prune.js.map +1 -0
- package/dist/object/seek.cjs +2 -2
- package/dist/object/seek.cjs.map +1 -1
- package/dist/object/seek.d.ts +2 -0
- package/dist/object/seek.d.ts.map +1 -0
- package/dist/object/seek.js +25 -12
- package/dist/object/seek.js.map +1 -1
- package/dist/object/stash.cjs +2 -0
- package/dist/object/stash.cjs.map +1 -0
- package/dist/object/stash.d.ts +45 -0
- package/dist/object/stash.d.ts.map +1 -0
- package/dist/object/stash.js +99 -0
- package/dist/object/stash.js.map +1 -0
- package/dist/random/draw.cjs +2 -2
- package/dist/random/draw.cjs.map +1 -1
- package/dist/random/draw.d.ts +16 -0
- package/dist/random/draw.d.ts.map +1 -0
- package/dist/random/draw.js +13 -10
- package/dist/random/draw.js.map +1 -1
- package/dist/random/index.d.ts +5 -0
- package/dist/random/index.d.ts.map +1 -0
- package/dist/random/random.cjs +2 -2
- package/dist/random/random.cjs.map +1 -1
- package/dist/random/random.d.ts +14 -0
- package/dist/random/random.d.ts.map +1 -0
- package/dist/random/random.js +16 -9
- package/dist/random/random.js.map +1 -1
- package/dist/random/shuffle.cjs +2 -2
- package/dist/random/shuffle.cjs.map +1 -1
- package/dist/random/shuffle.d.ts +17 -0
- package/dist/random/shuffle.d.ts.map +1 -0
- package/dist/random/shuffle.js +18 -14
- package/dist/random/shuffle.js.map +1 -1
- package/dist/random/uuid.cjs +2 -2
- package/dist/random/uuid.cjs.map +1 -1
- package/dist/random/uuid.d.ts +12 -0
- package/dist/random/uuid.d.ts.map +1 -0
- package/dist/random/uuid.js +7 -9
- package/dist/random/uuid.js.map +1 -1
- package/dist/string/_caseUtils.cjs +2 -2
- package/dist/string/_caseUtils.cjs.map +1 -1
- package/dist/string/_caseUtils.d.ts +13 -0
- package/dist/string/_caseUtils.d.ts.map +1 -0
- package/dist/string/_caseUtils.js +8 -8
- package/dist/string/_caseUtils.js.map +1 -1
- package/dist/string/camelCase.cjs +2 -2
- package/dist/string/camelCase.cjs.map +1 -1
- package/dist/string/camelCase.d.ts +14 -0
- package/dist/string/camelCase.d.ts.map +1 -0
- package/dist/string/camelCase.js +8 -7
- package/dist/string/camelCase.js.map +1 -1
- package/dist/string/index.d.ts +7 -0
- package/dist/string/index.d.ts.map +1 -0
- package/dist/string/kebabCase.cjs +2 -2
- package/dist/string/kebabCase.cjs.map +1 -1
- package/dist/string/kebabCase.d.ts +15 -0
- package/dist/string/kebabCase.d.ts.map +1 -0
- package/dist/string/kebabCase.js +8 -7
- package/dist/string/kebabCase.js.map +1 -1
- package/dist/string/pascalCase.cjs +2 -2
- package/dist/string/pascalCase.cjs.map +1 -1
- package/dist/string/pascalCase.d.ts +15 -0
- package/dist/string/pascalCase.d.ts.map +1 -0
- package/dist/string/pascalCase.js +8 -7
- package/dist/string/pascalCase.js.map +1 -1
- package/dist/string/similarity.cjs +2 -2
- package/dist/string/similarity.cjs.map +1 -1
- package/dist/string/similarity.d.ts +20 -0
- package/dist/string/similarity.d.ts.map +1 -0
- package/dist/string/similarity.js +20 -36
- package/dist/string/similarity.js.map +1 -1
- package/dist/string/snakeCase.cjs +2 -2
- package/dist/string/snakeCase.cjs.map +1 -1
- package/dist/string/snakeCase.d.ts +15 -0
- package/dist/string/snakeCase.d.ts.map +1 -0
- package/dist/string/snakeCase.js +8 -7
- package/dist/string/snakeCase.js.map +1 -1
- package/dist/string/truncate.cjs +2 -2
- package/dist/string/truncate.cjs.map +1 -1
- package/dist/string/truncate.d.ts +28 -0
- package/dist/string/truncate.d.ts.map +1 -0
- package/dist/string/truncate.js +20 -17
- package/dist/string/truncate.js.map +1 -1
- package/dist/toolkit.cjs +2 -0
- package/dist/toolkit.cjs.map +1 -0
- package/dist/toolkit.js +1523 -0
- package/dist/toolkit.js.map +1 -0
- package/dist/typed/index.d.ts +24 -0
- package/dist/typed/index.d.ts.map +1 -0
- package/dist/typed/is.cjs +2 -2
- package/dist/typed/is.cjs.map +1 -1
- package/dist/typed/is.d.ts +95 -0
- package/dist/typed/is.d.ts.map +1 -0
- package/dist/typed/is.js +54 -42
- package/dist/typed/is.js.map +1 -1
- package/dist/typed/isArray.cjs +2 -2
- package/dist/typed/isArray.cjs.map +1 -1
- package/dist/typed/isArray.d.ts +16 -0
- package/dist/typed/isArray.d.ts.map +1 -0
- package/dist/typed/isArray.js +8 -8
- package/dist/typed/isArray.js.map +1 -1
- package/dist/typed/isBoolean.cjs +2 -2
- package/dist/typed/isBoolean.cjs.map +1 -1
- package/dist/typed/isBoolean.d.ts +23 -0
- package/dist/typed/isBoolean.d.ts.map +1 -0
- package/dist/typed/isBoolean.js +7 -6
- package/dist/typed/isBoolean.js.map +1 -1
- package/dist/typed/isDate.cjs +2 -2
- package/dist/typed/isDate.cjs.map +1 -1
- package/dist/typed/isDate.d.ts +16 -0
- package/dist/typed/isDate.d.ts.map +1 -0
- package/dist/typed/isDate.js +7 -8
- package/dist/typed/isDate.js.map +1 -1
- package/dist/typed/isDefined.cjs +2 -2
- package/dist/typed/isDefined.cjs.map +1 -1
- package/dist/typed/isDefined.d.ts +19 -0
- package/dist/typed/isDefined.d.ts.map +1 -0
- package/dist/typed/isDefined.js +7 -6
- package/dist/typed/isDefined.js.map +1 -1
- package/dist/typed/isEmpty.cjs +2 -2
- package/dist/typed/isEmpty.cjs.map +1 -1
- package/dist/typed/isEmpty.d.ts +24 -0
- package/dist/typed/isEmpty.d.ts.map +1 -0
- package/dist/typed/isEmpty.js +8 -9
- package/dist/typed/isEmpty.js.map +1 -1
- package/dist/typed/isEqual.cjs +2 -2
- package/dist/typed/isEqual.cjs.map +1 -1
- package/dist/typed/isEqual.d.ts +24 -0
- package/dist/typed/isEqual.d.ts.map +1 -0
- package/dist/typed/isEqual.js +27 -28
- package/dist/typed/isEqual.js.map +1 -1
- package/dist/typed/isEven.cjs +2 -2
- package/dist/typed/isEven.cjs.map +1 -1
- package/dist/typed/isEven.d.ts +9 -0
- package/dist/typed/isEven.d.ts.map +1 -0
- package/dist/typed/isEven.js +7 -6
- package/dist/typed/isEven.js.map +1 -1
- package/dist/typed/isFunction.cjs +2 -2
- package/dist/typed/isFunction.cjs.map +1 -1
- package/dist/typed/isFunction.d.ts +16 -0
- package/dist/typed/isFunction.d.ts.map +1 -0
- package/dist/typed/isFunction.js +7 -8
- package/dist/typed/isFunction.js.map +1 -1
- package/dist/typed/isMatch.cjs +2 -2
- package/dist/typed/isMatch.cjs.map +1 -1
- package/dist/typed/isMatch.d.ts +23 -0
- package/dist/typed/isMatch.d.ts.map +1 -0
- package/dist/typed/isMatch.js +16 -18
- package/dist/typed/isMatch.js.map +1 -1
- package/dist/typed/isNegative.cjs +2 -2
- package/dist/typed/isNegative.cjs.map +1 -1
- package/dist/typed/isNegative.d.ts +26 -0
- package/dist/typed/isNegative.d.ts.map +1 -0
- package/dist/typed/isNegative.js +7 -6
- package/dist/typed/isNegative.js.map +1 -1
- package/dist/typed/isNil.cjs +2 -2
- package/dist/typed/isNil.cjs.map +1 -1
- package/dist/typed/isNil.d.ts +17 -0
- package/dist/typed/isNil.d.ts.map +1 -0
- package/dist/typed/isNil.js +7 -8
- package/dist/typed/isNil.js.map +1 -1
- package/dist/typed/isNumber.cjs +2 -2
- package/dist/typed/isNumber.cjs.map +1 -1
- package/dist/typed/isNumber.d.ts +16 -0
- package/dist/typed/isNumber.d.ts.map +1 -0
- package/dist/typed/isNumber.js +8 -8
- package/dist/typed/isNumber.js.map +1 -1
- package/dist/typed/isObject.cjs +2 -2
- package/dist/typed/isObject.cjs.map +1 -1
- package/dist/typed/isObject.d.ts +19 -0
- package/dist/typed/isObject.d.ts.map +1 -0
- package/dist/typed/isObject.js +8 -8
- package/dist/typed/isObject.js.map +1 -1
- package/dist/typed/isOdd.cjs +2 -2
- package/dist/typed/isOdd.cjs.map +1 -1
- package/dist/typed/isOdd.d.ts +9 -0
- package/dist/typed/isOdd.d.ts.map +1 -0
- package/dist/typed/isOdd.js +7 -6
- package/dist/typed/isOdd.js.map +1 -1
- package/dist/typed/isPositive.cjs +2 -2
- package/dist/typed/isPositive.cjs.map +1 -1
- package/dist/typed/isPositive.d.ts +26 -0
- package/dist/typed/isPositive.d.ts.map +1 -0
- package/dist/typed/isPositive.js +7 -6
- package/dist/typed/isPositive.js.map +1 -1
- package/dist/typed/isPrimitive.cjs +2 -2
- package/dist/typed/isPrimitive.cjs.map +1 -1
- package/dist/typed/isPrimitive.d.ts +18 -0
- package/dist/typed/isPrimitive.d.ts.map +1 -0
- package/dist/typed/isPrimitive.js +8 -9
- package/dist/typed/isPrimitive.js.map +1 -1
- package/dist/typed/isPromise.cjs +2 -2
- package/dist/typed/isPromise.cjs.map +1 -1
- package/dist/typed/isPromise.d.ts +17 -0
- package/dist/typed/isPromise.d.ts.map +1 -0
- package/dist/typed/isPromise.js +7 -9
- package/dist/typed/isPromise.js.map +1 -1
- package/dist/typed/isRegex.cjs +2 -2
- package/dist/typed/isRegex.cjs.map +1 -1
- package/dist/typed/isRegex.d.ts +21 -0
- package/dist/typed/isRegex.d.ts.map +1 -0
- package/dist/typed/isRegex.js +7 -6
- package/dist/typed/isRegex.js.map +1 -1
- package/dist/typed/isString.cjs +2 -2
- package/dist/typed/isString.cjs.map +1 -1
- package/dist/typed/isString.d.ts +16 -0
- package/dist/typed/isString.d.ts.map +1 -0
- package/dist/typed/isString.js +8 -8
- package/dist/typed/isString.js.map +1 -1
- package/dist/typed/isWithin.cjs +2 -2
- package/dist/typed/isWithin.cjs.map +1 -1
- package/dist/typed/isWithin.d.ts +20 -0
- package/dist/typed/isWithin.d.ts.map +1 -0
- package/dist/typed/isWithin.js +9 -9
- package/dist/typed/isWithin.js.map +1 -1
- package/dist/typed/isZero.cjs +2 -2
- package/dist/typed/isZero.cjs.map +1 -1
- package/dist/typed/isZero.d.ts +25 -0
- package/dist/typed/isZero.d.ts.map +1 -0
- package/dist/typed/isZero.js +7 -6
- package/dist/typed/isZero.js.map +1 -1
- package/dist/typed/typeOf.cjs +2 -2
- package/dist/typed/typeOf.cjs.map +1 -1
- package/dist/typed/typeOf.d.ts +30 -0
- package/dist/typed/typeOf.d.ts.map +1 -0
- package/dist/typed/typeOf.js +11 -13
- package/dist/typed/typeOf.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +77 -12
- package/dist/array/aggregate.cjs +0 -2
- package/dist/array/aggregate.cjs.map +0 -1
- package/dist/array/aggregate.js +0 -16
- package/dist/array/aggregate.js.map +0 -1
- package/dist/array/alternate.cjs +0 -2
- package/dist/array/alternate.cjs.map +0 -1
- package/dist/array/alternate.js +0 -9
- package/dist/array/alternate.js.map +0 -1
- package/dist/array/arrange.cjs +0 -2
- package/dist/array/arrange.cjs.map +0 -1
- package/dist/array/arrange.js +0 -6
- package/dist/array/arrange.js.map +0 -1
- package/dist/array/compact.cjs +0 -2
- package/dist/array/compact.cjs.map +0 -1
- package/dist/array/compact.js +0 -9
- package/dist/array/compact.js.map +0 -1
- package/dist/array/every.cjs +0 -2
- package/dist/array/every.cjs.map +0 -1
- package/dist/array/every.js +0 -14
- package/dist/array/every.js.map +0 -1
- package/dist/array/filter.cjs +0 -2
- package/dist/array/filter.cjs.map +0 -1
- package/dist/array/filter.js +0 -14
- package/dist/array/filter.js.map +0 -1
- package/dist/array/find.cjs +0 -2
- package/dist/array/find.cjs.map +0 -1
- package/dist/array/find.js +0 -14
- package/dist/array/find.js.map +0 -1
- package/dist/array/findIndex.cjs +0 -2
- package/dist/array/findIndex.cjs.map +0 -1
- package/dist/array/findIndex.js +0 -14
- package/dist/array/findIndex.js.map +0 -1
- package/dist/array/findLast.cjs +0 -2
- package/dist/array/findLast.cjs.map +0 -1
- package/dist/array/findLast.js +0 -14
- package/dist/array/findLast.js.map +0 -1
- package/dist/array/flatten.cjs +0 -2
- package/dist/array/flatten.cjs.map +0 -1
- package/dist/array/flatten.js +0 -7
- package/dist/array/flatten.js.map +0 -1
- package/dist/array/map.cjs +0 -2
- package/dist/array/map.cjs.map +0 -1
- package/dist/array/map.js +0 -18
- package/dist/array/map.js.map +0 -1
- package/dist/array/reduce.cjs +0 -2
- package/dist/array/reduce.cjs.map +0 -1
- package/dist/array/reduce.js +0 -16
- package/dist/array/reduce.js.map +0 -1
- package/dist/array/shift.cjs +0 -2
- package/dist/array/shift.cjs.map +0 -1
- package/dist/array/shift.js +0 -13
- package/dist/array/shift.js.map +0 -1
- package/dist/array/some.cjs +0 -2
- package/dist/array/some.cjs.map +0 -1
- package/dist/array/some.js +0 -14
- package/dist/array/some.js.map +0 -1
- package/dist/array/substitute.cjs +0 -2
- package/dist/array/substitute.cjs.map +0 -1
- package/dist/array/substitute.js +0 -13
- package/dist/array/substitute.js.map +0 -1
- package/dist/async/delay.cjs +0 -2
- package/dist/async/delay.cjs.map +0 -1
- package/dist/async/delay.js +0 -8
- package/dist/async/delay.js.map +0 -1
- package/dist/function/proxy.cjs +0 -2
- package/dist/function/proxy.cjs.map +0 -1
- package/dist/function/proxy.js +0 -22
- package/dist/function/proxy.js.map +0 -1
- package/dist/function/prune.cjs +0 -2
- package/dist/function/prune.cjs.map +0 -1
- package/dist/function/prune.js +0 -30
- package/dist/function/prune.js.map +0 -1
- package/dist/function/worker.cjs +0 -14
- package/dist/function/worker.cjs.map +0 -1
- package/dist/function/worker.js +0 -29
- package/dist/function/worker.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logit/dist/logit.cjs +0 -2
- package/dist/logit/dist/logit.cjs.map +0 -1
- package/dist/logit/dist/logit.js +0 -263
- package/dist/logit/dist/logit.js.map +0 -1
- package/dist/math/add.cjs +0 -2
- package/dist/math/add.cjs.map +0 -1
- package/dist/math/add.js +0 -9
- package/dist/math/add.js.map +0 -1
- package/dist/math/boil.cjs +0 -2
- package/dist/math/boil.cjs.map +0 -1
- package/dist/math/boil.js +0 -17
- package/dist/math/boil.js.map +0 -1
- package/dist/math/divide.cjs +0 -2
- package/dist/math/divide.cjs.map +0 -1
- package/dist/math/divide.js +0 -11
- package/dist/math/divide.js.map +0 -1
- package/dist/math/multiply.cjs +0 -2
- package/dist/math/multiply.cjs.map +0 -1
- package/dist/math/multiply.js +0 -9
- package/dist/math/multiply.js.map +0 -1
- package/dist/math/rate.cjs +0 -2
- package/dist/math/rate.cjs.map +0 -1
- package/dist/math/rate.js +0 -9
- package/dist/math/rate.js.map +0 -1
- package/dist/math/subtract.cjs +0 -2
- package/dist/math/subtract.cjs.map +0 -1
- package/dist/math/subtract.js +0 -9
- package/dist/math/subtract.js.map +0 -1
- package/dist/object/cache.cjs +0 -2
- package/dist/object/cache.cjs.map +0 -1
- package/dist/object/cache.js +0 -63
- package/dist/object/cache.js.map +0 -1
- package/dist/object/clone.cjs +0 -2
- package/dist/object/clone.cjs.map +0 -1
- package/dist/object/clone.js +0 -17
- package/dist/object/clone.js.map +0 -1
- package/dist/object/entries.cjs +0 -2
- package/dist/object/entries.cjs.map +0 -1
- package/dist/object/entries.js +0 -9
- package/dist/object/entries.js.map +0 -1
- package/dist/object/keys.cjs +0 -2
- package/dist/object/keys.cjs.map +0 -1
- package/dist/object/keys.js +0 -9
- package/dist/object/keys.js.map +0 -1
- package/dist/object/values.cjs +0 -2
- package/dist/object/values.cjs.map +0 -1
- package/dist/object/values.js +0 -9
- package/dist/object/values.js.map +0 -1
- package/dist/typed/ge.cjs +0 -2
- package/dist/typed/ge.cjs.map +0 -1
- package/dist/typed/ge.js +0 -7
- package/dist/typed/ge.js.map +0 -1
- package/dist/typed/gt.cjs +0 -2
- package/dist/typed/gt.cjs.map +0 -1
- package/dist/typed/gt.js +0 -7
- package/dist/typed/gt.js.map +0 -1
- package/dist/typed/le.cjs +0 -2
- package/dist/typed/le.cjs.map +0 -1
- package/dist/typed/le.js +0 -7
- package/dist/typed/le.js.map +0 -1
- package/dist/typed/lt.cjs +0 -2
- package/dist/typed/lt.cjs.map +0 -1
- package/dist/typed/lt.js +0 -7
- package/dist/typed/lt.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,253 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
|
|
76
|
-
import { diff as jo } from "./object/diff.js";
|
|
77
|
-
import { entries as Qo } from "./object/entries.js";
|
|
78
|
-
import { keys as Zo } from "./object/keys.js";
|
|
79
|
-
import { merge as Ko } from "./object/merge.js";
|
|
80
|
-
import { parseJSON as $o } from "./object/parseJSON.js";
|
|
81
|
-
import { path as oe } from "./object/path.js";
|
|
82
|
-
import { seek as te } from "./object/seek.js";
|
|
83
|
-
import { values as pe } from "./object/values.js";
|
|
84
|
-
import { draw as xe } from "./random/draw.js";
|
|
85
|
-
import { random as ae } from "./random/random.js";
|
|
86
|
-
import { shuffle as Re } from "./random/shuffle.js";
|
|
87
|
-
import { uuid as ne } from "./random/uuid.js";
|
|
88
|
-
import { camelCase as le } from "./string/camelCase.js";
|
|
89
|
-
import { kebabCase as ue } from "./string/kebabCase.js";
|
|
90
|
-
import { pascalCase as Ee } from "./string/pascalCase.js";
|
|
91
|
-
import { similarity as Oe } from "./string/similarity.js";
|
|
92
|
-
import { snakeCase as ge } from "./string/snakeCase.js";
|
|
93
|
-
import { truncate as Ge } from "./string/truncate.js";
|
|
94
|
-
import { ge as Ne } from "./typed/ge.js";
|
|
95
|
-
import { gt as ve } from "./typed/gt.js";
|
|
96
|
-
import { is as Pe } from "./typed/is.js";
|
|
97
|
-
import { IS_ARRAY_ERROR_MSG as Ce, isArray as Ae } from "./typed/isArray.js";
|
|
98
|
-
import { isBoolean as De } from "./typed/isBoolean.js";
|
|
99
|
-
import { IS_DATE_ERROR_MSG as qe, isDate as we } from "./typed/isDate.js";
|
|
100
|
-
import { isDefined as Ue } from "./typed/isDefined.js";
|
|
101
|
-
import { IS_EMPTY_ERROR_MSG as We, isEmpty as Ye } from "./typed/isEmpty.js";
|
|
102
|
-
import { IS_EQUAL_ERROR_MSG as He, isEqual as Qe } from "./typed/isEqual.js";
|
|
103
|
-
import { isEven as Ze } from "./typed/isEven.js";
|
|
104
|
-
import { IS_FUNCTION_ERROR_MSG as Ke, isFunction as Xe } from "./typed/isFunction.js";
|
|
105
|
-
import { isNegative as rt } from "./typed/isNegative.js";
|
|
106
|
-
import { IS_NIL_ERROR_MSG as et, isNil as tt } from "./typed/isNil.js";
|
|
107
|
-
import { IS_NUMBER_ERROR_MSG as pt, isNumber as ft } from "./typed/isNumber.js";
|
|
108
|
-
import { IS_OBJECT_ERROR_MSG as it, isObject as at } from "./typed/isObject.js";
|
|
109
|
-
import { isOdd as Rt } from "./typed/isOdd.js";
|
|
110
|
-
import { isPositive as nt } from "./typed/isPositive.js";
|
|
111
|
-
import { IS_PRIMITIVE_ERROR_MSG as lt, isPrimitive as St } from "./typed/isPrimitive.js";
|
|
112
|
-
import { IS_PROMISE_ERROR_MSG as dt, isPromise as Et } from "./typed/isPromise.js";
|
|
113
|
-
import { isRegex as Ot } from "./typed/isRegex.js";
|
|
114
|
-
import { IS_STRING_ERROR_MSG as gt, isString as yt } from "./typed/isString.js";
|
|
115
|
-
import { IS_WITHIN_ERROR_MSG as bt, isWithin as Nt } from "./typed/isWithin.js";
|
|
116
|
-
import { isZero as vt } from "./typed/isZero.js";
|
|
117
|
-
import { le as Pt } from "./typed/le.js";
|
|
118
|
-
import { lt as Ct } from "./typed/lt.js";
|
|
119
|
-
import { typeOf as Bt } from "./typed/typeOf.js";
|
|
120
|
-
export {
|
|
121
|
-
Ce as IS_ARRAY_ERROR_MSG,
|
|
122
|
-
qe as IS_DATE_ERROR_MSG,
|
|
123
|
-
We as IS_EMPTY_ERROR_MSG,
|
|
124
|
-
He as IS_EQUAL_ERROR_MSG,
|
|
125
|
-
Ke as IS_FUNCTION_ERROR_MSG,
|
|
126
|
-
et as IS_NIL_ERROR_MSG,
|
|
127
|
-
pt as IS_NUMBER_ERROR_MSG,
|
|
128
|
-
it as IS_OBJECT_ERROR_MSG,
|
|
129
|
-
lt as IS_PRIMITIVE_ERROR_MSG,
|
|
130
|
-
dt as IS_PROMISE_ERROR_MSG,
|
|
131
|
-
gt as IS_STRING_ERROR_MSG,
|
|
132
|
-
bt as IS_WITHIN_ERROR_MSG,
|
|
133
|
-
eo as abs,
|
|
134
|
-
mo as add,
|
|
135
|
-
e as aggregate,
|
|
136
|
-
fo as allocate,
|
|
137
|
-
m as alternate,
|
|
138
|
-
f as arrange,
|
|
139
|
-
br as assert,
|
|
140
|
-
hr as assertParams,
|
|
141
|
-
X as attempt,
|
|
142
|
-
io as average,
|
|
143
|
-
so as boil,
|
|
144
|
-
Uo as cache,
|
|
145
|
-
le as camelCase,
|
|
146
|
-
i as chunk,
|
|
147
|
-
_o as clamp,
|
|
148
|
-
Wo as clone,
|
|
149
|
-
s as compact,
|
|
150
|
-
kr as compare,
|
|
151
|
-
Tr as compareBy,
|
|
152
|
-
Ar as compose,
|
|
153
|
-
_ as contains,
|
|
154
|
-
Lo as currency,
|
|
155
|
-
Dr as curry,
|
|
156
|
-
qr as debounce,
|
|
157
|
-
rr as defer,
|
|
158
|
-
er as delay,
|
|
159
|
-
jo as diff,
|
|
160
|
-
co as distribute,
|
|
161
|
-
So as divide,
|
|
162
|
-
xe as draw,
|
|
163
|
-
Qo as entries,
|
|
164
|
-
c as every,
|
|
165
|
-
wo as exchange,
|
|
166
|
-
Ir as expires,
|
|
167
|
-
S as filter,
|
|
168
|
-
d as find,
|
|
169
|
-
I as findIndex,
|
|
170
|
-
M as findLast,
|
|
171
|
-
y as flatten,
|
|
172
|
-
Fr as fp,
|
|
173
|
-
Ne as ge,
|
|
174
|
-
b as group,
|
|
175
|
-
ve as gt,
|
|
176
|
-
Mr as interval,
|
|
177
|
-
Pe as is,
|
|
178
|
-
Ae as isArray,
|
|
179
|
-
De as isBoolean,
|
|
180
|
-
we as isDate,
|
|
181
|
-
Ue as isDefined,
|
|
182
|
-
Ye as isEmpty,
|
|
183
|
-
Qe as isEqual,
|
|
184
|
-
Ze as isEven,
|
|
185
|
-
Xe as isFunction,
|
|
186
|
-
rt as isNegative,
|
|
187
|
-
tt as isNil,
|
|
188
|
-
ft as isNumber,
|
|
189
|
-
at as isObject,
|
|
190
|
-
Rt as isOdd,
|
|
191
|
-
nt as isPositive,
|
|
192
|
-
St as isPrimitive,
|
|
193
|
-
Et as isPromise,
|
|
194
|
-
Ot as isRegex,
|
|
195
|
-
yt as isString,
|
|
196
|
-
Nt as isWithin,
|
|
197
|
-
vt as isZero,
|
|
198
|
-
ue as kebabCase,
|
|
199
|
-
Zo as keys,
|
|
200
|
-
Pt as le,
|
|
201
|
-
h as list,
|
|
202
|
-
Ct as lt,
|
|
203
|
-
k as map,
|
|
204
|
-
Eo as max,
|
|
205
|
-
Oo as median,
|
|
206
|
-
Jr as memo,
|
|
207
|
-
Ko as merge,
|
|
208
|
-
go as min,
|
|
209
|
-
Go as multiply,
|
|
210
|
-
Yr as once,
|
|
211
|
-
mr as parallel,
|
|
212
|
-
$o as parseJSON,
|
|
213
|
-
Ee as pascalCase,
|
|
214
|
-
oe as path,
|
|
215
|
-
T as pick,
|
|
216
|
-
Hr as pipe,
|
|
217
|
-
fr as pool,
|
|
218
|
-
ir as predict,
|
|
219
|
-
Vr as proxy,
|
|
220
|
-
zr as prune,
|
|
221
|
-
sr as queue,
|
|
222
|
-
_r as race,
|
|
223
|
-
ae as random,
|
|
224
|
-
No as range,
|
|
225
|
-
vo as rate,
|
|
226
|
-
A as reduce,
|
|
227
|
-
D as remoteList,
|
|
228
|
-
cr as retry,
|
|
229
|
-
Po as round,
|
|
230
|
-
q as search,
|
|
231
|
-
te as seek,
|
|
232
|
-
F as select,
|
|
233
|
-
J as shift,
|
|
234
|
-
Re as shuffle,
|
|
235
|
-
Oe as similarity,
|
|
236
|
-
Sr as sleep,
|
|
237
|
-
ge as snakeCase,
|
|
238
|
-
Y as some,
|
|
239
|
-
H as sort,
|
|
240
|
-
V as substitute,
|
|
241
|
-
Co as subtract,
|
|
242
|
-
Bo as sum,
|
|
243
|
-
Xr as throttle,
|
|
244
|
-
yr as timeDiff,
|
|
245
|
-
Ge as truncate,
|
|
246
|
-
Bt as typeOf,
|
|
247
|
-
z as uniq,
|
|
248
|
-
ne as uuid,
|
|
249
|
-
pe as values,
|
|
250
|
-
dr as waitFor,
|
|
251
|
-
ro as worker
|
|
252
|
-
};
|
|
253
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { assert as e, assertAll as t } from "./function/assert.js";
|
|
2
|
+
import { chunk as n } from "./array/chunk.js";
|
|
3
|
+
import { contains as r } from "./array/contains.js";
|
|
4
|
+
import { fold as i } from "./array/fold.js";
|
|
5
|
+
import { group as a } from "./array/group.js";
|
|
6
|
+
import { keyBy as o } from "./array/keyBy.js";
|
|
7
|
+
import { similarity as s } from "./string/similarity.js";
|
|
8
|
+
import { seek as c } from "./object/seek.js";
|
|
9
|
+
import { search as l } from "./array/search.js";
|
|
10
|
+
import { list as u } from "./array/list.js";
|
|
11
|
+
import { pick as d } from "./array/pick.js";
|
|
12
|
+
import { remoteList as f } from "./array/remoteList.js";
|
|
13
|
+
import { replace as p } from "./array/replace.js";
|
|
14
|
+
import { rotate as m } from "./array/rotate.js";
|
|
15
|
+
import { select as h } from "./array/select.js";
|
|
16
|
+
import { compare as g } from "./function/compare.js";
|
|
17
|
+
import { compareBy as _ } from "./function/compareBy.js";
|
|
18
|
+
import { sort as v } from "./array/sort.js";
|
|
19
|
+
import { toggle as y } from "./array/toggle.js";
|
|
20
|
+
import { uniq as b } from "./array/uniq.js";
|
|
21
|
+
import { sleep as x } from "./async/sleep.js";
|
|
22
|
+
import { retry as S } from "./async/retry.js";
|
|
23
|
+
import { attempt as C } from "./async/attempt.js";
|
|
24
|
+
import { defer as w } from "./async/defer.js";
|
|
25
|
+
import { parallel as T } from "./async/parallel.js";
|
|
26
|
+
import { Scheduler as E, polyfillScheduler as D } from "./async/scheduler.js";
|
|
27
|
+
import { pool as O } from "./async/pool.js";
|
|
28
|
+
import { queue as k } from "./async/queue.js";
|
|
29
|
+
import { race as A } from "./async/race.js";
|
|
30
|
+
import { waitFor as j } from "./async/waitFor.js";
|
|
31
|
+
import { expires as M } from "./date/expires.js";
|
|
32
|
+
import { interval as N } from "./date/interval.js";
|
|
33
|
+
import { timeDiff as P } from "./date/timeDiff.js";
|
|
34
|
+
import { assertParams as F } from "./function/assertParams.js";
|
|
35
|
+
import { compose as I } from "./function/compose.js";
|
|
36
|
+
import { curry as L } from "./function/curry.js";
|
|
37
|
+
import { debounce as R } from "./function/debounce.js";
|
|
38
|
+
import { partial as z } from "./function/fp.js";
|
|
39
|
+
import { memo as B } from "./function/memo.js";
|
|
40
|
+
import { once as V } from "./function/once.js";
|
|
41
|
+
import { pipe as H } from "./function/pipe.js";
|
|
42
|
+
import { throttle as U } from "./function/throttle.js";
|
|
43
|
+
import { abs as W } from "./math/abs.js";
|
|
44
|
+
import { allocate as G } from "./math/allocate.js";
|
|
45
|
+
import { sum as K } from "./math/sum.js";
|
|
46
|
+
import { average as q } from "./math/average.js";
|
|
47
|
+
import { clamp as J } from "./math/clamp.js";
|
|
48
|
+
import { distribute as Y } from "./math/distribute.js";
|
|
49
|
+
import { linspace as X } from "./math/linspace.js";
|
|
50
|
+
import { max as Z } from "./math/max.js";
|
|
51
|
+
import { median as Q } from "./math/median.js";
|
|
52
|
+
import { min as $ } from "./math/min.js";
|
|
53
|
+
import { percent as ee } from "./math/percent.js";
|
|
54
|
+
import { range as te } from "./math/range.js";
|
|
55
|
+
import { round as ne } from "./math/round.js";
|
|
56
|
+
import { currency as re } from "./money/currency.js";
|
|
57
|
+
import { exchange as ie } from "./money/exchange.js";
|
|
58
|
+
import { stash as ae } from "./object/stash.js";
|
|
59
|
+
import { DELETED as oe, diff as se } from "./object/diff.js";
|
|
60
|
+
import { deepMerge as ce, merge as le, shallowMerge as ue } from "./object/merge.js";
|
|
61
|
+
import { parseJSON as de } from "./object/parseJSON.js";
|
|
62
|
+
import { get as fe } from "./object/path.js";
|
|
63
|
+
import { proxy as pe } from "./object/proxy.js";
|
|
64
|
+
import { prune as me } from "./object/prune.js";
|
|
65
|
+
import { random as he } from "./random/random.js";
|
|
66
|
+
import { draw as ge } from "./random/draw.js";
|
|
67
|
+
import { shuffle as _e } from "./random/shuffle.js";
|
|
68
|
+
import { uuid as ve } from "./random/uuid.js";
|
|
69
|
+
import { camelCase as ye } from "./string/camelCase.js";
|
|
70
|
+
import { kebabCase as be } from "./string/kebabCase.js";
|
|
71
|
+
import { pascalCase as xe } from "./string/pascalCase.js";
|
|
72
|
+
import { snakeCase as Se } from "./string/snakeCase.js";
|
|
73
|
+
import { truncate as Ce } from "./string/truncate.js";
|
|
74
|
+
import { is as we } from "./typed/is.js";
|
|
75
|
+
export { oe as DELETED, E as Scheduler, W as abs, G as allocate, e as assert, t as assertAll, F as assertParams, C as attempt, q as average, ye as camelCase, n as chunk, J as clamp, g as compare, _ as compareBy, I as compose, r as contains, re as currency, L as curry, R as debounce, ce as deepMerge, w as defer, se as diff, Y as distribute, ge as draw, ie as exchange, M as expires, i as fold, fe as get, a as group, N as interval, we as is, be as kebabCase, o as keyBy, X as linspace, u as list, Z as max, Q as median, B as memo, le as merge, $ as min, V as once, T as parallel, de as parseJSON, z as partial, xe as pascalCase, ee as percent, d as pick, H as pipe, D as polyfillScheduler, O as pool, pe as proxy, me as prune, k as queue, A as race, he as random, te as range, f as remoteList, p as replace, S as retry, m as rotate, ne as round, l as search, c as seek, h as select, ue as shallowMerge, _e as shuffle, s as similarity, x as sleep, Se as snakeCase, v as sort, ae as stash, K as sum, U as throttle, P as timeDiff, y as toggle, Ce as truncate, b as uniq, ve as uuid, j as waitFor };
|
package/dist/math/abs.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=abs.cjs.map
|
|
1
|
+
function e(e){return typeof e==`bigint`?e<0n?-e:e:Math.abs(e)}exports.abs=e;
|
|
2
|
+
//# sourceMappingURL=abs.cjs.map
|
package/dist/math/abs.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abs.cjs","sources":["../../src/math/abs.ts"],"sourcesContent":["/**\n * Returns the absolute value of a number.\n * Supports both regular numbers and bigint.\n *\n * @example\n * ```ts\n * abs(-5); // 5\n * abs(3); // 3\n * abs(-100n); // 100n\n * ```\n *\n * @param value - The number or bigint to get absolute value of\n * @returns Absolute value\n */\nexport function abs(value: number): number;\nexport function abs(value: bigint): bigint;\nexport function abs(value: number | bigint): number | bigint {\n if (typeof value === 'bigint') {\n return value < 0n ? -value : value;\n }\n return Math.abs(value);\n}\n"],"
|
|
1
|
+
{"version":3,"file":"abs.cjs","names":[],"sources":["../../src/math/abs.ts"],"sourcesContent":["/**\n * Returns the absolute value of a number.\n * Supports both regular numbers and bigint.\n *\n * @example\n * ```ts\n * abs(-5); // 5\n * abs(3); // 3\n * abs(-100n); // 100n\n * ```\n *\n * @param value - The number or bigint to get absolute value of\n * @returns Absolute value\n */\nexport function abs(value: number): number;\nexport function abs(value: bigint): bigint;\nexport function abs(value: number | bigint): number | bigint {\n if (typeof value === 'bigint') {\n return value < 0n ? -value : value;\n }\n\n return Math.abs(value);\n}\n"],"mappings":"AAgBA,SAAgB,EAAI,EAAyC,CAK3D,OAJI,OAAO,GAAU,SACZ,EAAQ,GAAK,CAAC,EAAQ,EAGxB,KAAK,IAAI,EAAM"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the absolute value of a number.
|
|
3
|
+
* Supports both regular numbers and bigint.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* abs(-5); // 5
|
|
8
|
+
* abs(3); // 3
|
|
9
|
+
* abs(-100n); // 100n
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @param value - The number or bigint to get absolute value of
|
|
13
|
+
* @returns Absolute value
|
|
14
|
+
*/
|
|
15
|
+
export declare function abs(value: number): number;
|
|
16
|
+
export declare function abs(value: bigint): bigint;
|
|
17
|
+
//# sourceMappingURL=abs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abs.d.ts","sourceRoot":"","sources":["../../src/math/abs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAC3C,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC"}
|
package/dist/math/abs.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/math/abs.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return typeof e == "bigint" ? e < 0n ? -e : e : Math.abs(e);
|
|
3
4
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=abs.js.map
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as abs };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=abs.js.map
|
package/dist/math/abs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abs.js","sources":["../../src/math/abs.ts"],"sourcesContent":["/**\n * Returns the absolute value of a number.\n * Supports both regular numbers and bigint.\n *\n * @example\n * ```ts\n * abs(-5); // 5\n * abs(3); // 3\n * abs(-100n); // 100n\n * ```\n *\n * @param value - The number or bigint to get absolute value of\n * @returns Absolute value\n */\nexport function abs(value: number): number;\nexport function abs(value: bigint): bigint;\nexport function abs(value: number | bigint): number | bigint {\n if (typeof value === 'bigint') {\n return value < 0n ? -value : value;\n }\n return Math.abs(value);\n}\n"],"
|
|
1
|
+
{"version":3,"file":"abs.js","names":[],"sources":["../../src/math/abs.ts"],"sourcesContent":["/**\n * Returns the absolute value of a number.\n * Supports both regular numbers and bigint.\n *\n * @example\n * ```ts\n * abs(-5); // 5\n * abs(3); // 3\n * abs(-100n); // 100n\n * ```\n *\n * @param value - The number or bigint to get absolute value of\n * @returns Absolute value\n */\nexport function abs(value: number): number;\nexport function abs(value: bigint): bigint;\nexport function abs(value: number | bigint): number | bigint {\n if (typeof value === 'bigint') {\n return value < 0n ? -value : value;\n }\n\n return Math.abs(value);\n}\n"],"mappings":";AAgBA,SAAgB,EAAI,GAAyC;AAK3D,QAJI,OAAO,KAAU,WACZ,IAAQ,KAAK,CAAC,IAAQ,IAGxB,KAAK,IAAI,EAAM"}
|
package/dist/math/allocate.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=allocate.cjs.map
|
|
1
|
+
function e(e,t){if(t.length===0)throw Error(`Ratios array cannot be empty`);if(t.some(e=>e<0))throw Error(`Ratios must be non-negative`);let n=t.reduce((e,t)=>e+t,0);if(n===0)throw Error(`Total ratio cannot be zero`);if(typeof e==`bigint`){let r=[],i=e;for(let a=0;a<t.length-1;a++){let o=e*BigInt(Math.floor(t[a]*1e6))/BigInt(Math.floor(n*1e6));r.push(o),i-=o}return r.push(i),r}let r=Array.from({length:t.length-1},(r,i)=>Math.floor(e*t[i]/n));return r.push(e-r.reduce((e,t)=>e+t,0)),r}exports.allocate=e;
|
|
2
|
+
//# sourceMappingURL=allocate.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allocate.cjs","sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3\n * allocate(100, [1, 2, 3]);\n * // [17, 33, 50] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3334n, 3333n, 3333n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution\n * @returns Array of allocated amounts (sum equals original amount)\n * @throws {Error} If ratios array is empty or contains negative values\n */\nexport function allocate(amount: number, ratios: number[]): number[];\nexport function allocate(amount: bigint, ratios: number[]): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[]): (number | bigint)[] {\n if (ratios.length === 0) {\n throw new Error('Ratios array cannot be empty');\n }\n\n if (ratios.some((r) => r < 0)) {\n throw new Error('Ratios must be non-negative');\n }\n\n const totalRatio = ratios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new Error('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const results: bigint[] = [];\n let remainder = amount;\n\n for (let i = 0; i < ratios.length - 1; i++) {\n const share = (amount * BigInt(Math.floor(ratios[i] * 1000000))) / BigInt(Math.floor(totalRatio * 1000000));\n results.push(share);\n remainder -= share;\n }\n\n // Last allocation gets the remainder to ensure exact sum\n results.push(remainder);\n return results;\n }\n\n // Handle number type\n const results
|
|
1
|
+
{"version":3,"file":"allocate.cjs","names":[],"sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3\n * allocate(100, [1, 2, 3]);\n * // [17, 33, 50] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3334n, 3333n, 3333n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution\n * @returns Array of allocated amounts (sum equals original amount)\n * @throws {Error} If ratios array is empty or contains negative values\n */\nexport function allocate(amount: number, ratios: number[]): number[];\nexport function allocate(amount: bigint, ratios: number[]): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[]): (number | bigint)[] {\n if (ratios.length === 0) {\n throw new Error('Ratios array cannot be empty');\n }\n\n if (ratios.some((r) => r < 0)) {\n throw new Error('Ratios must be non-negative');\n }\n\n const totalRatio = ratios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new Error('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const results: bigint[] = [];\n let remainder = amount;\n\n for (let i = 0; i < ratios.length - 1; i++) {\n const share = (amount * BigInt(Math.floor(ratios[i] * 1000000))) / BigInt(Math.floor(totalRatio * 1000000));\n\n results.push(share);\n remainder -= share;\n }\n\n // Last allocation gets the remainder to ensure exact sum\n results.push(remainder);\n\n return results;\n }\n\n // Handle number type\n const results = Array.from({ length: ratios.length - 1 }, (_, i) => Math.floor((amount * ratios[i]) / totalRatio));\n\n results.push(amount - results.reduce((s, v) => s + v, 0));\n\n return results;\n}\n"],"mappings":"AAuBA,SAAgB,EAAS,EAAyB,EAAuC,CACvF,GAAI,EAAO,SAAW,EACpB,MAAU,MAAM,+BAA+B,CAGjD,GAAI,EAAO,KAAM,GAAM,EAAI,EAAE,CAC3B,MAAU,MAAM,8BAA8B,CAGhD,IAAM,EAAa,EAAO,QAAQ,EAAK,IAAU,EAAM,EAAO,EAAE,CAEhE,GAAI,IAAe,EACjB,MAAU,MAAM,6BAA6B,CAG/C,GAAI,OAAO,GAAW,SAAU,CAC9B,IAAM,EAAoB,EAAE,CACxB,EAAY,EAEhB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAS,EAAG,IAAK,CAC1C,IAAM,EAAS,EAAS,OAAO,KAAK,MAAM,EAAO,GAAK,IAAQ,CAAC,CAAI,OAAO,KAAK,MAAM,EAAa,IAAQ,CAAC,CAE3G,EAAQ,KAAK,EAAM,CACnB,GAAa,EAMf,OAFA,EAAQ,KAAK,EAAU,CAEhB,EAIT,IAAM,EAAU,MAAM,KAAK,CAAE,OAAQ,EAAO,OAAS,EAAG,EAAG,EAAG,IAAM,KAAK,MAAO,EAAS,EAAO,GAAM,EAAW,CAAC,CAIlH,OAFA,EAAQ,KAAK,EAAS,EAAQ,QAAQ,EAAG,IAAM,EAAI,EAAG,EAAE,CAAC,CAElD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distributes an amount proportionally according to given ratios.
|
|
3
|
+
* Handles rounding to ensure the sum equals the original amount exactly.
|
|
4
|
+
* Critical for financial operations like splitting payments to avoid rounding errors.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* // Split $100 in ratio 1:2:3
|
|
9
|
+
* allocate(100, [1, 2, 3]);
|
|
10
|
+
* // [17, 33, 50] - sum is exactly 100
|
|
11
|
+
*
|
|
12
|
+
* // Split with bigint (e.g., cents)
|
|
13
|
+
* allocate(10000n, [1, 1, 1]);
|
|
14
|
+
* // [3334n, 3333n, 3333n] - sum is exactly 10000n
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param amount - Total amount to allocate
|
|
18
|
+
* @param ratios - Array of ratios for distribution
|
|
19
|
+
* @returns Array of allocated amounts (sum equals original amount)
|
|
20
|
+
* @throws {Error} If ratios array is empty or contains negative values
|
|
21
|
+
*/
|
|
22
|
+
export declare function allocate(amount: number, ratios: number[]): number[];
|
|
23
|
+
export declare function allocate(amount: bigint, ratios: number[]): bigint[];
|
|
24
|
+
//# sourceMappingURL=allocate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allocate.d.ts","sourceRoot":"","sources":["../../src/math/allocate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AACrE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC"}
|
package/dist/math/allocate.js
CHANGED
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
const l = [];
|
|
19
|
-
let s = o;
|
|
20
|
-
for (let e = 0; e < t.length - 1; e++) {
|
|
21
|
-
const r = Math.floor(o * t[e] / n);
|
|
22
|
-
l.push(r), s -= r;
|
|
23
|
-
}
|
|
24
|
-
return l.push(s), l;
|
|
1
|
+
//#region src/math/allocate.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (t.length === 0) throw Error("Ratios array cannot be empty");
|
|
4
|
+
if (t.some((e) => e < 0)) throw Error("Ratios must be non-negative");
|
|
5
|
+
let n = t.reduce((e, t) => e + t, 0);
|
|
6
|
+
if (n === 0) throw Error("Total ratio cannot be zero");
|
|
7
|
+
if (typeof e == "bigint") {
|
|
8
|
+
let r = [], i = e;
|
|
9
|
+
for (let a = 0; a < t.length - 1; a++) {
|
|
10
|
+
let o = e * BigInt(Math.floor(t[a] * 1e6)) / BigInt(Math.floor(n * 1e6));
|
|
11
|
+
r.push(o), i -= o;
|
|
12
|
+
}
|
|
13
|
+
return r.push(i), r;
|
|
14
|
+
}
|
|
15
|
+
let r = Array.from({ length: t.length - 1 }, (r, i) => Math.floor(e * t[i] / n));
|
|
16
|
+
return r.push(e - r.reduce((e, t) => e + t, 0)), r;
|
|
25
17
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=allocate.js.map
|
|
18
|
+
//#endregion
|
|
19
|
+
export { e as allocate };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=allocate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allocate.js","sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3\n * allocate(100, [1, 2, 3]);\n * // [17, 33, 50] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3334n, 3333n, 3333n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution\n * @returns Array of allocated amounts (sum equals original amount)\n * @throws {Error} If ratios array is empty or contains negative values\n */\nexport function allocate(amount: number, ratios: number[]): number[];\nexport function allocate(amount: bigint, ratios: number[]): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[]): (number | bigint)[] {\n if (ratios.length === 0) {\n throw new Error('Ratios array cannot be empty');\n }\n\n if (ratios.some((r) => r < 0)) {\n throw new Error('Ratios must be non-negative');\n }\n\n const totalRatio = ratios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new Error('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const results: bigint[] = [];\n let remainder = amount;\n\n for (let i = 0; i < ratios.length - 1; i++) {\n const share = (amount * BigInt(Math.floor(ratios[i] * 1000000))) / BigInt(Math.floor(totalRatio * 1000000));\n results.push(share);\n remainder -= share;\n }\n\n // Last allocation gets the remainder to ensure exact sum\n results.push(remainder);\n return results;\n }\n\n // Handle number type\n const results
|
|
1
|
+
{"version":3,"file":"allocate.js","names":[],"sources":["../../src/math/allocate.ts"],"sourcesContent":["/**\n * Distributes an amount proportionally according to given ratios.\n * Handles rounding to ensure the sum equals the original amount exactly.\n * Critical for financial operations like splitting payments to avoid rounding errors.\n *\n * @example\n * ```ts\n * // Split $100 in ratio 1:2:3\n * allocate(100, [1, 2, 3]);\n * // [17, 33, 50] - sum is exactly 100\n *\n * // Split with bigint (e.g., cents)\n * allocate(10000n, [1, 1, 1]);\n * // [3334n, 3333n, 3333n] - sum is exactly 10000n\n * ```\n *\n * @param amount - Total amount to allocate\n * @param ratios - Array of ratios for distribution\n * @returns Array of allocated amounts (sum equals original amount)\n * @throws {Error} If ratios array is empty or contains negative values\n */\nexport function allocate(amount: number, ratios: number[]): number[];\nexport function allocate(amount: bigint, ratios: number[]): bigint[];\nexport function allocate(amount: number | bigint, ratios: number[]): (number | bigint)[] {\n if (ratios.length === 0) {\n throw new Error('Ratios array cannot be empty');\n }\n\n if (ratios.some((r) => r < 0)) {\n throw new Error('Ratios must be non-negative');\n }\n\n const totalRatio = ratios.reduce((sum, ratio) => sum + ratio, 0);\n\n if (totalRatio === 0) {\n throw new Error('Total ratio cannot be zero');\n }\n\n if (typeof amount === 'bigint') {\n const results: bigint[] = [];\n let remainder = amount;\n\n for (let i = 0; i < ratios.length - 1; i++) {\n const share = (amount * BigInt(Math.floor(ratios[i] * 1000000))) / BigInt(Math.floor(totalRatio * 1000000));\n\n results.push(share);\n remainder -= share;\n }\n\n // Last allocation gets the remainder to ensure exact sum\n results.push(remainder);\n\n return results;\n }\n\n // Handle number type\n const results = Array.from({ length: ratios.length - 1 }, (_, i) => Math.floor((amount * ratios[i]) / totalRatio));\n\n results.push(amount - results.reduce((s, v) => s + v, 0));\n\n return results;\n}\n"],"mappings":";AAuBA,SAAgB,EAAS,GAAyB,GAAuC;AACvF,KAAI,EAAO,WAAW,EACpB,OAAU,MAAM,+BAA+B;AAGjD,KAAI,EAAO,MAAM,MAAM,IAAI,EAAE,CAC3B,OAAU,MAAM,8BAA8B;CAGhD,IAAM,IAAa,EAAO,QAAQ,GAAK,MAAU,IAAM,GAAO,EAAE;AAEhE,KAAI,MAAe,EACjB,OAAU,MAAM,6BAA6B;AAG/C,KAAI,OAAO,KAAW,UAAU;EAC9B,IAAM,IAAoB,EAAE,EACxB,IAAY;AAEhB,OAAK,IAAI,IAAI,GAAG,IAAI,EAAO,SAAS,GAAG,KAAK;GAC1C,IAAM,IAAS,IAAS,OAAO,KAAK,MAAM,EAAO,KAAK,IAAQ,CAAC,GAAI,OAAO,KAAK,MAAM,IAAa,IAAQ,CAAC;AAG3G,GADA,EAAQ,KAAK,EAAM,EACnB,KAAa;;AAMf,SAFA,EAAQ,KAAK,EAAU,EAEhB;;CAIT,IAAM,IAAU,MAAM,KAAK,EAAE,QAAQ,EAAO,SAAS,GAAG,GAAG,GAAG,MAAM,KAAK,MAAO,IAAS,EAAO,KAAM,EAAW,CAAC;AAIlH,QAFA,EAAQ,KAAK,IAAS,EAAQ,QAAQ,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,EAElD"}
|
package/dist/math/average.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=average.cjs.map
|
|
1
|
+
const e=require(`./sum.cjs`);function t(t,n){if(t.length!==0)try{let r=e.sum(t,n)/t.length;return Number.isNaN(r)?void 0:r}catch{return}}exports.average=t;
|
|
2
|
+
//# sourceMappingURL=average.cjs.map
|
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"average.cjs","names":[],"sources":["../../src/math/average.ts"],"sourcesContent":["import { sum } from './sum';\n\n/**\n * Calculates the average of an array of numbers.\n *\n * @example\n * ```ts\n * const arr = [1, 2, 3, 4, 5];\n * average(arr); // 3\n * average(arr, (num) => num * 2); // 6\n * ```\n *\n * @param array - The array to average.\n * @param callback - (optional) A callback function to map each item to a number.\n * @returns The average, or `undefined` if the array is empty or contains non-numeric values.\n */\nexport function average<T>(array: T[], callback?: (item: T) => number): number | undefined {\n if (array.length === 0) return undefined;\n\n try {\n const result = sum(array, callback) / array.length;\n\n return Number.isNaN(result) ? undefined : result;\n } catch {\n return undefined;\n }\n}\n"],"mappings":"6BAgBA,SAAgB,EAAW,EAAY,EAAoD,CACrF,KAAM,SAAW,EAErB,GAAI,CACF,IAAM,EAAS,EAAA,IAAI,EAAO,EAAS,CAAG,EAAM,OAE5C,OAAO,OAAO,MAAM,EAAO,CAAG,IAAA,GAAY,OACpC,CACN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the average of an array of numbers.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const arr = [1, 2, 3, 4, 5];
|
|
7
|
+
* average(arr); // 3
|
|
8
|
+
* average(arr, (num) => num * 2); // 6
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @param array - The array to average.
|
|
12
|
+
* @param callback - (optional) A callback function to map each item to a number.
|
|
13
|
+
* @returns The average, or `undefined` if the array is empty or contains non-numeric values.
|
|
14
|
+
*/
|
|
15
|
+
export declare function average<T>(array: T[], callback?: (item: T) => number): number | undefined;
|
|
16
|
+
//# sourceMappingURL=average.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"average.d.ts","sourceRoot":"","sources":["../../src/math/average.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAUzF"}
|
package/dist/math/average.js
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import { sum as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, 0);
|
|
11
|
-
return new Date(e / t.length);
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
const e = s(t, n);
|
|
15
|
-
if (typeof e == "number")
|
|
16
|
-
return e / t.length;
|
|
17
|
-
} catch (e) {
|
|
18
|
-
if (e instanceof TypeError) return;
|
|
19
|
-
throw e;
|
|
20
|
-
}
|
|
1
|
+
import { sum as e } from "./sum.js";
|
|
2
|
+
//#region src/math/average.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
if (t.length !== 0) try {
|
|
5
|
+
let r = e(t, n) / t.length;
|
|
6
|
+
return Number.isNaN(r) ? void 0 : r;
|
|
7
|
+
} catch {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
21
10
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=average.js.map
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as average };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=average.js.map
|