@vielzeug/toolkit 1.1.3 → 2.0.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
package/dist/async/parallel.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
async
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return c;
|
|
1
|
+
//#region src/async/parallel.ts
|
|
2
|
+
async function e(e, t, n, r) {
|
|
3
|
+
if (e < 1) throw Error("Limit must be at least 1");
|
|
4
|
+
if (r?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
5
|
+
let i = Array(t.length), a = 0, o = !1, s, c = async () => {
|
|
6
|
+
for (; a < t.length && !o;) {
|
|
7
|
+
if (r?.aborted) {
|
|
8
|
+
o = !0, s = new DOMException("Aborted", "AbortError");
|
|
9
|
+
break;
|
|
10
|
+
}
|
|
11
|
+
let e = a++;
|
|
12
|
+
try {
|
|
13
|
+
i[e] = await n(t[e], e, t);
|
|
14
|
+
} catch (e) {
|
|
15
|
+
o = !0, s = e;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}, l = [], u = Math.min(e, t.length);
|
|
20
|
+
for (let e = 0; e < u; e++) l.push(c());
|
|
21
|
+
if (await Promise.all(l), o) throw s;
|
|
22
|
+
return i;
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=parallel.js.map
|
|
24
|
+
//#endregion
|
|
25
|
+
export { e as parallel };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=parallel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallel.js","sources":["../../src/async/parallel.ts"],"sourcesContent":["/**\n * Processes an array with an async callback with controlled parallelism.\n * Similar to Promise.all, but limits how many items are processed concurrently.\n * Returns an ordered array of results.\n *\n * @example\n * ```ts\n * // Process 3 items at a time\n * const results = await parallel(3, [1, 2, 3, 4, 5], async (n) => {\n * await delay(100);\n * return n * 2;\n * });\n * // [2, 4, 6, 8, 10]\n *\n * // With abort signal\n * const controller = new AbortController();\n * const results = await parallel(2, items, async (item) => {\n * return processItem(item);\n * }, controller.signal);\n * ```\n *\n * @param limit - Maximum number of concurrent operations (must be >= 1)\n * @param array - Array of items to process\n * @param callback - Async function to process each item\n * @param signal - Optional AbortSignal to cancel processing\n * @returns Promise resolving to an ordered array of results\n * @throws {Error} If limit is less than 1\n * @throws {DOMException} If aborted via signal\n */\nexport async function parallel<T, R>(\n limit: number,\n array: T[],\n callback: (item: T, index: number, array: T[]) => Promise<R>,\n signal?: AbortSignal,\n): Promise<R[]> {\n if (limit < 1) {\n throw new Error('Limit must be at least 1');\n }\n\n if (signal?.aborted) {\n throw new DOMException('Aborted', 'AbortError');\n }\n\n const results: R[] = new Array(array.length);\n let currentIndex = 0;\n let hasError = false;\n let error: unknown;\n\n
|
|
1
|
+
{"version":3,"file":"parallel.js","names":[],"sources":["../../src/async/parallel.ts"],"sourcesContent":["/**\n * Processes an array with an async callback with controlled parallelism.\n * Similar to Promise.all, but limits how many items are processed concurrently.\n * Returns an ordered array of results.\n *\n * @example\n * ```ts\n * // Process 3 items at a time\n * const results = await parallel(3, [1, 2, 3, 4, 5], async (n) => {\n * await delay(100);\n * return n * 2;\n * });\n * // [2, 4, 6, 8, 10]\n *\n * // With abort signal\n * const controller = new AbortController();\n * const results = await parallel(2, items, async (item) => {\n * return processItem(item);\n * }, controller.signal);\n * ```\n *\n * @param limit - Maximum number of concurrent operations (must be >= 1)\n * @param array - Array of items to process\n * @param callback - Async function to process each item\n * @param signal - Optional AbortSignal to cancel processing\n * @returns Promise resolving to an ordered array of results\n * @throws {Error} If limit is less than 1\n * @throws {DOMException} If aborted via signal\n */\nexport async function parallel<T, R>(\n limit: number,\n array: T[],\n callback: (item: T, index: number, array: T[]) => Promise<R>,\n signal?: AbortSignal,\n): Promise<R[]> {\n if (limit < 1) {\n throw new Error('Limit must be at least 1');\n }\n\n if (signal?.aborted) {\n throw new DOMException('Aborted', 'AbortError');\n }\n\n const results: R[] = new Array(array.length);\n let currentIndex = 0;\n let hasError = false;\n let error: unknown;\n\n const worker = async (): Promise<void> => {\n while (currentIndex < array.length && !hasError) {\n if (signal?.aborted) {\n hasError = true;\n error = new DOMException('Aborted', 'AbortError');\n break;\n }\n\n const index = currentIndex++;\n\n try {\n results[index] = await callback(array[index], index, array);\n } catch (err) {\n hasError = true;\n error = err;\n break;\n }\n }\n };\n\n // Create workers up to the limit\n const workers: Promise<void>[] = [];\n const workerCount = Math.min(limit, array.length);\n\n for (let i = 0; i < workerCount; i++) {\n workers.push(worker());\n }\n\n // Wait for all workers to complete\n await Promise.all(workers);\n\n // If there was an error, throw it\n if (hasError) {\n throw error;\n }\n\n return results;\n}\n"],"mappings":";AA6BA,eAAsB,EACpB,GACA,GACA,GACA,GACc;AACd,KAAI,IAAQ,EACV,OAAU,MAAM,2BAA2B;AAG7C,KAAI,GAAQ,QACV,OAAM,IAAI,aAAa,WAAW,aAAa;CAGjD,IAAM,IAAmB,MAAM,EAAM,OAAO,EACxC,IAAe,GACf,IAAW,IACX,GAEE,IAAS,YAA2B;AACxC,SAAO,IAAe,EAAM,UAAU,CAAC,IAAU;AAC/C,OAAI,GAAQ,SAAS;AAEnB,IADA,IAAW,IACX,IAAQ,IAAI,aAAa,WAAW,aAAa;AACjD;;GAGF,IAAM,IAAQ;AAEd,OAAI;AACF,MAAQ,KAAS,MAAM,EAAS,EAAM,IAAQ,GAAO,EAAM;YACpD,GAAK;AAEZ,IADA,IAAW,IACX,IAAQ;AACR;;;IAMA,IAA2B,EAAE,EAC7B,IAAc,KAAK,IAAI,GAAO,EAAM,OAAO;AAEjD,MAAK,IAAI,IAAI,GAAG,IAAI,GAAa,IAC/B,GAAQ,KAAK,GAAQ,CAAC;AAOxB,KAHA,MAAM,QAAQ,IAAI,EAAQ,EAGtB,EACF,OAAM;AAGR,QAAO"}
|
package/dist/async/pool.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=pool.cjs.map
|
|
1
|
+
const e=require(`../function/assert.cjs`);function t(t){e.assert(t>=1,`Pool limit must be at least 1`,{args:{limit:t},type:RangeError});let n=0,r=[],i=()=>{r.length>0&&n<t&&r.shift()?.()};return async e=>{for(;n>=t;)await new Promise(e=>r.push(e));n++;try{return await e()}finally{n--,i()}}}exports.pool=t;
|
|
2
|
+
//# sourceMappingURL=pool.cjs.map
|
package/dist/async/pool.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.cjs","sources":["../../src/async/pool.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Creates a promise pool that limits the number of concurrent promises.\n * Useful for rate limiting API calls or controlling resource usage.\n *\n * @example\n * ```ts\n * const requestPool = pool(3);\n *\n * const results = await Promise.all([\n * requestPool(() => fetch('/api/1')),\n * requestPool(() => fetch('/api/2')),\n * requestPool(() => fetch('/api/3')),\n * requestPool(() => fetch('/api/4')), // Will wait for one of the above to finish\n * ]);\n * ```\n *\n * @param limit - Maximum number of concurrent promises\n * @returns Function that accepts a promise-returning function and executes it when a slot is available\n */\nexport function pool(limit: number): <T>(fn: () => Promise<T>) => Promise<T> {\n assert(limit >= 1, 'Pool limit must be at least 1', { args: { limit }, type: RangeError });\n\n let activeCount = 0;\n const queue: Array<() => void> = [];\n\n const dequeue = (): void => {\n if (queue.length > 0 && activeCount < limit) {\n const next = queue.shift();\n next?.();\n }\n };\n\n return async <T>(fn: () => Promise<T>): Promise<T> => {\n while (activeCount >= limit) {\n await new Promise<void>((resolve) => queue.push(resolve));\n }\n\n activeCount++;\n\n try {\n return await fn();\n } finally {\n activeCount--;\n dequeue();\n }\n };\n}\n"],"
|
|
1
|
+
{"version":3,"file":"pool.cjs","names":[],"sources":["../../src/async/pool.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Creates a promise pool that limits the number of concurrent promises.\n * Useful for rate limiting API calls or controlling resource usage.\n *\n * @example\n * ```ts\n * const requestPool = pool(3);\n *\n * const results = await Promise.all([\n * requestPool(() => fetch('/api/1')),\n * requestPool(() => fetch('/api/2')),\n * requestPool(() => fetch('/api/3')),\n * requestPool(() => fetch('/api/4')), // Will wait for one of the above to finish\n * ]);\n * ```\n *\n * @param limit - Maximum number of concurrent promises\n * @returns Function that accepts a promise-returning function and executes it when a slot is available\n */\nexport function pool(limit: number): <T>(fn: () => Promise<T>) => Promise<T> {\n assert(limit >= 1, 'Pool limit must be at least 1', { args: { limit }, type: RangeError });\n\n let activeCount = 0;\n const queue: Array<() => void> = [];\n\n const dequeue = (): void => {\n if (queue.length > 0 && activeCount < limit) {\n const next = queue.shift();\n\n next?.();\n }\n };\n\n return async <T>(fn: () => Promise<T>): Promise<T> => {\n while (activeCount >= limit) {\n await new Promise<void>((resolve) => queue.push(resolve));\n }\n\n activeCount++;\n\n try {\n return await fn();\n } finally {\n activeCount--;\n dequeue();\n }\n };\n}\n"],"mappings":"0CAqBA,SAAgB,EAAK,EAAwD,CAC3E,EAAA,OAAO,GAAS,EAAG,gCAAiC,CAAE,KAAM,CAAE,QAAO,CAAE,KAAM,WAAY,CAAC,CAE1F,IAAI,EAAc,EACZ,EAA2B,EAAE,CAE7B,MAAsB,CACtB,EAAM,OAAS,GAAK,EAAc,GACvB,EAAM,OAAO,IAElB,EAIZ,OAAO,KAAU,IAAqC,CACpD,KAAO,GAAe,GACpB,MAAM,IAAI,QAAe,GAAY,EAAM,KAAK,EAAQ,CAAC,CAG3D,IAEA,GAAI,CACF,OAAO,MAAM,GAAI,QACT,CACR,IACA,GAAS"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a promise pool that limits the number of concurrent promises.
|
|
3
|
+
* Useful for rate limiting API calls or controlling resource usage.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const requestPool = pool(3);
|
|
8
|
+
*
|
|
9
|
+
* const results = await Promise.all([
|
|
10
|
+
* requestPool(() => fetch('/api/1')),
|
|
11
|
+
* requestPool(() => fetch('/api/2')),
|
|
12
|
+
* requestPool(() => fetch('/api/3')),
|
|
13
|
+
* requestPool(() => fetch('/api/4')), // Will wait for one of the above to finish
|
|
14
|
+
* ]);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param limit - Maximum number of concurrent promises
|
|
18
|
+
* @returns Function that accepts a promise-returning function and executes it when a slot is available
|
|
19
|
+
*/
|
|
20
|
+
export declare function pool(limit: number): <T>(fn: () => Promise<T>) => Promise<T>;
|
|
21
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/async/pool.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CA4B3E"}
|
package/dist/async/pool.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { assert as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { assert as e } from "../function/assert.js";
|
|
2
|
+
//#region src/async/pool.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
e(t >= 1, "Pool limit must be at least 1", {
|
|
5
|
+
args: { limit: t },
|
|
6
|
+
type: RangeError
|
|
7
|
+
});
|
|
8
|
+
let n = 0, r = [], i = () => {
|
|
9
|
+
r.length > 0 && n < t && r.shift()?.();
|
|
10
|
+
};
|
|
11
|
+
return async (e) => {
|
|
12
|
+
for (; n >= t;) await new Promise((e) => r.push(e));
|
|
13
|
+
n++;
|
|
14
|
+
try {
|
|
15
|
+
return await e();
|
|
16
|
+
} finally {
|
|
17
|
+
n--, i();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=pool.js.map
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as pool };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=pool.js.map
|
package/dist/async/pool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.js","sources":["../../src/async/pool.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Creates a promise pool that limits the number of concurrent promises.\n * Useful for rate limiting API calls or controlling resource usage.\n *\n * @example\n * ```ts\n * const requestPool = pool(3);\n *\n * const results = await Promise.all([\n * requestPool(() => fetch('/api/1')),\n * requestPool(() => fetch('/api/2')),\n * requestPool(() => fetch('/api/3')),\n * requestPool(() => fetch('/api/4')), // Will wait for one of the above to finish\n * ]);\n * ```\n *\n * @param limit - Maximum number of concurrent promises\n * @returns Function that accepts a promise-returning function and executes it when a slot is available\n */\nexport function pool(limit: number): <T>(fn: () => Promise<T>) => Promise<T> {\n assert(limit >= 1, 'Pool limit must be at least 1', { args: { limit }, type: RangeError });\n\n let activeCount = 0;\n const queue: Array<() => void> = [];\n\n const dequeue = (): void => {\n if (queue.length > 0 && activeCount < limit) {\n const next = queue.shift();\n next?.();\n }\n };\n\n return async <T>(fn: () => Promise<T>): Promise<T> => {\n while (activeCount >= limit) {\n await new Promise<void>((resolve) => queue.push(resolve));\n }\n\n activeCount++;\n\n try {\n return await fn();\n } finally {\n activeCount--;\n dequeue();\n }\n };\n}\n"],"
|
|
1
|
+
{"version":3,"file":"pool.js","names":[],"sources":["../../src/async/pool.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Creates a promise pool that limits the number of concurrent promises.\n * Useful for rate limiting API calls or controlling resource usage.\n *\n * @example\n * ```ts\n * const requestPool = pool(3);\n *\n * const results = await Promise.all([\n * requestPool(() => fetch('/api/1')),\n * requestPool(() => fetch('/api/2')),\n * requestPool(() => fetch('/api/3')),\n * requestPool(() => fetch('/api/4')), // Will wait for one of the above to finish\n * ]);\n * ```\n *\n * @param limit - Maximum number of concurrent promises\n * @returns Function that accepts a promise-returning function and executes it when a slot is available\n */\nexport function pool(limit: number): <T>(fn: () => Promise<T>) => Promise<T> {\n assert(limit >= 1, 'Pool limit must be at least 1', { args: { limit }, type: RangeError });\n\n let activeCount = 0;\n const queue: Array<() => void> = [];\n\n const dequeue = (): void => {\n if (queue.length > 0 && activeCount < limit) {\n const next = queue.shift();\n\n next?.();\n }\n };\n\n return async <T>(fn: () => Promise<T>): Promise<T> => {\n while (activeCount >= limit) {\n await new Promise<void>((resolve) => queue.push(resolve));\n }\n\n activeCount++;\n\n try {\n return await fn();\n } finally {\n activeCount--;\n dequeue();\n }\n };\n}\n"],"mappings":";;AAqBA,SAAgB,EAAK,GAAwD;AAC3E,GAAO,KAAS,GAAG,iCAAiC;EAAE,MAAM,EAAE,UAAO;EAAE,MAAM;EAAY,CAAC;CAE1F,IAAI,IAAc,GACZ,IAA2B,EAAE,EAE7B,UAAsB;AAC1B,EAAI,EAAM,SAAS,KAAK,IAAc,KACvB,EAAM,OAAO,IAElB;;AAIZ,QAAO,OAAU,MAAqC;AACpD,SAAO,KAAe,GACpB,OAAM,IAAI,SAAe,MAAY,EAAM,KAAK,EAAQ,CAAC;AAG3D;AAEA,MAAI;AACF,UAAO,MAAM,GAAI;YACT;AAER,GADA,KACA,GAAS"}
|
package/dist/async/predict.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=predict.cjs.map
|
|
1
|
+
function e(e,t={}){let{signal:n,timeout:r=7e3}=t,i=n?AbortSignal.any([AbortSignal.timeout(r),n]):AbortSignal.timeout(r);return Promise.race([e(i),new Promise((e,t)=>{i.addEventListener(`abort`,()=>t(i.reason),{once:!0})})])}exports.predict=e;
|
|
2
|
+
//# sourceMappingURL=predict.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict.cjs","sources":["../../src/async/predict.ts"],"sourcesContent":["/**\n * Creates a Promise that can be aborted using an AbortController.\n *\n * @example\n * ```ts\n * const slowFn = () => new Promise(resolve => setTimeout(() => resolve('slow'), 10000));\n * const fastFn = () => new Promise(resolve => setTimeout(() => resolve('fast'), 5000));\n *\n * predict(slowFn); // rejects after 7 seconds\n * predict(fastFn); // resolves with 'fast' after 5 seconds\n * ```\n *\n * @param fn - The function to execute, which receives an AbortSignal.\n * @param options - The options for the abortable function.\n * @param [options.signal] - The AbortSignal to use for aborting the Promise.\n * @param [options.timeout=7000] - The timeout in milliseconds after which the Promise will be aborted.\n *\n * @returns - A Promise that resolves with the result of the callback or rejects if aborted.\n */\nexport function predict<T>(\n fn: (signal: AbortSignal) => Promise<T>,\n options: { signal?: AbortSignal; timeout?: number } = {},\n): Promise<T> {\n const { signal, timeout = 7000 } = options;\n const abortSignal = signal ? AbortSignal.any([AbortSignal.timeout(timeout), signal]) : AbortSignal.timeout(timeout);\n\n return Promise.race([\n fn(abortSignal),\n new Promise<never>((_, reject) => {\n abortSignal.addEventListener('abort', () => reject(
|
|
1
|
+
{"version":3,"file":"predict.cjs","names":[],"sources":["../../src/async/predict.ts"],"sourcesContent":["/**\n * Creates a Promise that can be aborted using an AbortController.\n *\n * @example\n * ```ts\n * const slowFn = () => new Promise(resolve => setTimeout(() => resolve('slow'), 10000));\n * const fastFn = () => new Promise(resolve => setTimeout(() => resolve('fast'), 5000));\n *\n * predict(slowFn); // rejects after 7 seconds\n * predict(fastFn); // resolves with 'fast' after 5 seconds\n * ```\n *\n * @param fn - The function to execute, which receives an AbortSignal.\n * @param options - The options for the abortable function.\n * @param [options.signal] - The AbortSignal to use for aborting the Promise.\n * @param [options.timeout=7000] - The timeout in milliseconds after which the Promise will be aborted.\n *\n * @returns - A Promise that resolves with the result of the callback or rejects if aborted.\n */\nexport function predict<T>(\n fn: (signal: AbortSignal) => Promise<T>,\n options: { signal?: AbortSignal; timeout?: number } = {},\n): Promise<T> {\n const { signal, timeout = 7000 } = options;\n const abortSignal = signal ? AbortSignal.any([AbortSignal.timeout(timeout), signal]) : AbortSignal.timeout(timeout);\n\n return Promise.race([\n fn(abortSignal),\n new Promise<never>((_, reject) => {\n abortSignal.addEventListener('abort', () => reject(abortSignal.reason), { once: true });\n }),\n ]);\n}\n"],"mappings":"AAmBA,SAAgB,EACd,EACA,EAAsD,EAAE,CAC5C,CACZ,GAAM,CAAE,SAAQ,UAAU,KAAS,EAC7B,EAAc,EAAS,YAAY,IAAI,CAAC,YAAY,QAAQ,EAAQ,CAAE,EAAO,CAAC,CAAG,YAAY,QAAQ,EAAQ,CAEnH,OAAO,QAAQ,KAAK,CAClB,EAAG,EAAY,CACf,IAAI,SAAgB,EAAG,IAAW,CAChC,EAAY,iBAAiB,YAAe,EAAO,EAAY,OAAO,CAAE,CAAE,KAAM,GAAM,CAAC,EACvF,CACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a Promise that can be aborted using an AbortController.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const slowFn = () => new Promise(resolve => setTimeout(() => resolve('slow'), 10000));
|
|
7
|
+
* const fastFn = () => new Promise(resolve => setTimeout(() => resolve('fast'), 5000));
|
|
8
|
+
*
|
|
9
|
+
* predict(slowFn); // rejects after 7 seconds
|
|
10
|
+
* predict(fastFn); // resolves with 'fast' after 5 seconds
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param fn - The function to execute, which receives an AbortSignal.
|
|
14
|
+
* @param options - The options for the abortable function.
|
|
15
|
+
* @param [options.signal] - The AbortSignal to use for aborting the Promise.
|
|
16
|
+
* @param [options.timeout=7000] - The timeout in milliseconds after which the Promise will be aborted.
|
|
17
|
+
*
|
|
18
|
+
* @returns - A Promise that resolves with the result of the callback or rejects if aborted.
|
|
19
|
+
*/
|
|
20
|
+
export declare function predict<T>(fn: (signal: AbortSignal) => Promise<T>, options?: {
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
timeout?: number;
|
|
23
|
+
}): Promise<T>;
|
|
24
|
+
//# sourceMappingURL=predict.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predict.d.ts","sourceRoot":"","sources":["../../src/async/predict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,EAAE,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EACvC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACvD,OAAO,CAAC,CAAC,CAAC,CAUZ"}
|
package/dist/async/predict.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})
|
|
8
|
-
]);
|
|
1
|
+
//#region src/async/predict.ts
|
|
2
|
+
function e(e, t = {}) {
|
|
3
|
+
let { signal: n, timeout: r = 7e3 } = t, i = n ? AbortSignal.any([AbortSignal.timeout(r), n]) : AbortSignal.timeout(r);
|
|
4
|
+
return Promise.race([e(i), new Promise((e, t) => {
|
|
5
|
+
i.addEventListener("abort", () => t(i.reason), { once: !0 });
|
|
6
|
+
})]);
|
|
9
7
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=predict.js.map
|
|
8
|
+
//#endregion
|
|
9
|
+
export { e as predict };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=predict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict.js","sources":["../../src/async/predict.ts"],"sourcesContent":["/**\n * Creates a Promise that can be aborted using an AbortController.\n *\n * @example\n * ```ts\n * const slowFn = () => new Promise(resolve => setTimeout(() => resolve('slow'), 10000));\n * const fastFn = () => new Promise(resolve => setTimeout(() => resolve('fast'), 5000));\n *\n * predict(slowFn); // rejects after 7 seconds\n * predict(fastFn); // resolves with 'fast' after 5 seconds\n * ```\n *\n * @param fn - The function to execute, which receives an AbortSignal.\n * @param options - The options for the abortable function.\n * @param [options.signal] - The AbortSignal to use for aborting the Promise.\n * @param [options.timeout=7000] - The timeout in milliseconds after which the Promise will be aborted.\n *\n * @returns - A Promise that resolves with the result of the callback or rejects if aborted.\n */\nexport function predict<T>(\n fn: (signal: AbortSignal) => Promise<T>,\n options: { signal?: AbortSignal; timeout?: number } = {},\n): Promise<T> {\n const { signal, timeout = 7000 } = options;\n const abortSignal = signal ? AbortSignal.any([AbortSignal.timeout(timeout), signal]) : AbortSignal.timeout(timeout);\n\n return Promise.race([\n fn(abortSignal),\n new Promise<never>((_, reject) => {\n abortSignal.addEventListener('abort', () => reject(
|
|
1
|
+
{"version":3,"file":"predict.js","names":[],"sources":["../../src/async/predict.ts"],"sourcesContent":["/**\n * Creates a Promise that can be aborted using an AbortController.\n *\n * @example\n * ```ts\n * const slowFn = () => new Promise(resolve => setTimeout(() => resolve('slow'), 10000));\n * const fastFn = () => new Promise(resolve => setTimeout(() => resolve('fast'), 5000));\n *\n * predict(slowFn); // rejects after 7 seconds\n * predict(fastFn); // resolves with 'fast' after 5 seconds\n * ```\n *\n * @param fn - The function to execute, which receives an AbortSignal.\n * @param options - The options for the abortable function.\n * @param [options.signal] - The AbortSignal to use for aborting the Promise.\n * @param [options.timeout=7000] - The timeout in milliseconds after which the Promise will be aborted.\n *\n * @returns - A Promise that resolves with the result of the callback or rejects if aborted.\n */\nexport function predict<T>(\n fn: (signal: AbortSignal) => Promise<T>,\n options: { signal?: AbortSignal; timeout?: number } = {},\n): Promise<T> {\n const { signal, timeout = 7000 } = options;\n const abortSignal = signal ? AbortSignal.any([AbortSignal.timeout(timeout), signal]) : AbortSignal.timeout(timeout);\n\n return Promise.race([\n fn(abortSignal),\n new Promise<never>((_, reject) => {\n abortSignal.addEventListener('abort', () => reject(abortSignal.reason), { once: true });\n }),\n ]);\n}\n"],"mappings":";AAmBA,SAAgB,EACd,GACA,IAAsD,EAAE,EAC5C;CACZ,IAAM,EAAE,WAAQ,aAAU,QAAS,GAC7B,IAAc,IAAS,YAAY,IAAI,CAAC,YAAY,QAAQ,EAAQ,EAAE,EAAO,CAAC,GAAG,YAAY,QAAQ,EAAQ;AAEnH,QAAO,QAAQ,KAAK,CAClB,EAAG,EAAY,EACf,IAAI,SAAgB,GAAG,MAAW;AAChC,IAAY,iBAAiB,eAAe,EAAO,EAAY,OAAO,EAAE,EAAE,MAAM,IAAM,CAAC;GACvF,CACH,CAAC"}
|
package/dist/async/queue.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=queue.cjs.map
|
|
1
|
+
const e=require(`../function/assert.cjs`),t=require(`./scheduler.cjs`);function n(n={}){let{concurrency:r=1}=n;e.assert(r>=1,`Concurrency must be at least 1`,{args:{concurrency:r},type:RangeError});let i=0,a=null,o=null,s=[],c=!1,l=()=>{c||(c=!0,new t.Scheduler().postTask(()=>{c=!1,u()},{priority:`user-visible`}))},u=()=>{if(i<r&&s.length>0){let e=s.shift();i++,e.fn().then(e.resolve).catch(e.reject).finally(()=>{i--,l(),i===0&&s.length===0&&o&&(o(),a=null,o=null)})}};return{add:e=>{let{promise:t,reject:n,resolve:r}=Promise.withResolvers();return s.push({fn:e,reject:n,resolve:r}),l(),t},clear:()=>{s.length=0},onIdle:()=>{if(i===0&&s.length===0)return Promise.resolve();if(!a){let e=Promise.withResolvers();a=e.promise,o=e.resolve}return a},get pending(){return i},get size(){return s.length}}}exports.queue=n;
|
|
2
|
+
//# sourceMappingURL=queue.cjs.map
|
package/dist/async/queue.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.cjs","sources":["../../src/async/queue.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Creates a promise queue that processes promises sequentially with optional concurrency limit.\n *\n * @example\n * ```ts\n * const requestQueue = queue({ concurrency: 2 });\n *\n * requestQueue.add(() => fetch('/api/1'));\n * requestQueue.add(() => fetch('/api/2'));\n * requestQueue.add(() => fetch('/api/3'));\n *\n * await requestQueue.onIdle(); // Wait for all tasks to complete\n * ```\n *\n * @param options - Queue configuration\n * @param options.concurrency - Maximum number of concurrent promises (default: 1)\n * @returns Queue instance with add, onIdle, and clear methods\n */\nexport function queue(options: { concurrency?: number } = {}) {\n const { concurrency = 1 } = options;\n\n assert(concurrency >= 1, 'Concurrency must be at least 1', {\n args: { concurrency },\n type: RangeError,\n });\n\n let activeCount = 0;\n let idlePromise: Promise<void> | null = null;\n let idleResolve: (() => void) | null = null;\n\n const
|
|
1
|
+
{"version":3,"file":"queue.cjs","names":[],"sources":["../../src/async/queue.ts"],"sourcesContent":["import { assert } from '../function/assert';\nimport { Scheduler } from './scheduler';\n\n/**\n * Creates a promise queue that processes promises sequentially with optional concurrency limit.\n *\n * @example\n * ```ts\n * const requestQueue = queue({ concurrency: 2 });\n *\n * requestQueue.add(() => fetch('/api/1'));\n * requestQueue.add(() => fetch('/api/2'));\n * requestQueue.add(() => fetch('/api/3'));\n *\n * await requestQueue.onIdle(); // Wait for all tasks to complete\n * ```\n *\n * @param options - Queue configuration\n * @param options.concurrency - Maximum number of concurrent promises (default: 1)\n * @returns Queue instance with add, onIdle, and clear methods\n */\nexport function queue(options: { concurrency?: number } = {}) {\n const { concurrency = 1 } = options;\n\n assert(concurrency >= 1, 'Concurrency must be at least 1', {\n args: { concurrency },\n type: RangeError,\n });\n\n let activeCount = 0;\n let idlePromise: Promise<void> | null = null;\n let idleResolve: (() => void) | null = null;\n\n const tasks: Array<{\n fn: () => Promise<unknown>;\n reject: (error: unknown) => void;\n resolve: (value: unknown) => void;\n }> = [];\n\n let flushQueued = false;\n\n const scheduleNext = (): void => {\n if (flushQueued) return;\n\n flushQueued = true;\n\n const scheduler = new Scheduler();\n\n void scheduler.postTask(\n () => {\n flushQueued = false;\n next();\n },\n { priority: 'user-visible' },\n );\n };\n\n const next = (): void => {\n if (activeCount < concurrency && tasks.length > 0) {\n const task = tasks.shift()!;\n\n activeCount++;\n\n task\n .fn()\n .then(task.resolve)\n .catch(task.reject)\n .finally(() => {\n activeCount--;\n scheduleNext();\n\n if (activeCount === 0 && tasks.length === 0 && idleResolve) {\n idleResolve();\n idlePromise = null;\n idleResolve = null;\n }\n });\n }\n };\n\n return {\n /**\n * Adds a promise-returning function to the queue\n */\n add: <T>(fn: () => Promise<T>): Promise<T> => {\n const { promise, reject, resolve } = Promise.withResolvers<T>();\n\n tasks.push({\n fn: fn as () => Promise<unknown>,\n reject,\n resolve: resolve as (value: unknown) => void,\n });\n scheduleNext();\n\n return promise;\n },\n\n /**\n * Clears all pending tasks from the queue\n */\n clear: (): void => {\n tasks.length = 0;\n },\n\n /**\n * Returns a promise that resolves when the queue becomes idle\n */\n onIdle: (): Promise<void> => {\n if (activeCount === 0 && tasks.length === 0) {\n return Promise.resolve();\n }\n\n if (!idlePromise) {\n const deferred = Promise.withResolvers<void>();\n\n idlePromise = deferred.promise;\n idleResolve = deferred.resolve;\n }\n\n return idlePromise;\n },\n\n /**\n * Returns the number of currently active promises\n */\n get pending(): number {\n return activeCount;\n },\n\n /**\n * Returns the current size of the queue\n */\n get size(): number {\n return tasks.length;\n },\n };\n}\n"],"mappings":"uEAqBA,SAAgB,EAAM,EAAoC,EAAE,CAAE,CAC5D,GAAM,CAAE,cAAc,GAAM,EAE5B,EAAA,OAAO,GAAe,EAAG,iCAAkC,CACzD,KAAM,CAAE,cAAa,CACrB,KAAM,WACP,CAAC,CAEF,IAAI,EAAc,EACd,EAAoC,KACpC,EAAmC,KAEjC,EAID,EAAE,CAEH,EAAc,GAEZ,MAA2B,CAC3B,IAEJ,EAAc,GAEI,IAAI,EAAA,WAAW,CAElB,aACP,CACJ,EAAc,GACd,GAAM,EAER,CAAE,SAAU,eAAgB,CAC7B,GAGG,MAAmB,CACvB,GAAI,EAAc,GAAe,EAAM,OAAS,EAAG,CACjD,IAAM,EAAO,EAAM,OAAO,CAE1B,IAEA,EACG,IAAI,CACJ,KAAK,EAAK,QAAQ,CAClB,MAAM,EAAK,OAAO,CAClB,YAAc,CACb,IACA,GAAc,CAEV,IAAgB,GAAK,EAAM,SAAW,GAAK,IAC7C,GAAa,CACb,EAAc,KACd,EAAc,OAEhB,GAIR,MAAO,CAIL,IAAS,GAAqC,CAC5C,GAAM,CAAE,UAAS,SAAQ,WAAY,QAAQ,eAAkB,CAS/D,OAPA,EAAM,KAAK,CACL,KACJ,SACS,UACV,CAAC,CACF,GAAc,CAEP,GAMT,UAAmB,CACjB,EAAM,OAAS,GAMjB,WAA6B,CAC3B,GAAI,IAAgB,GAAK,EAAM,SAAW,EACxC,OAAO,QAAQ,SAAS,CAG1B,GAAI,CAAC,EAAa,CAChB,IAAM,EAAW,QAAQ,eAAqB,CAE9C,EAAc,EAAS,QACvB,EAAc,EAAS,QAGzB,OAAO,GAMT,IAAI,SAAkB,CACpB,OAAO,GAMT,IAAI,MAAe,CACjB,OAAO,EAAM,QAEhB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a promise queue that processes promises sequentially with optional concurrency limit.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const requestQueue = queue({ concurrency: 2 });
|
|
7
|
+
*
|
|
8
|
+
* requestQueue.add(() => fetch('/api/1'));
|
|
9
|
+
* requestQueue.add(() => fetch('/api/2'));
|
|
10
|
+
* requestQueue.add(() => fetch('/api/3'));
|
|
11
|
+
*
|
|
12
|
+
* await requestQueue.onIdle(); // Wait for all tasks to complete
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param options - Queue configuration
|
|
16
|
+
* @param options.concurrency - Maximum number of concurrent promises (default: 1)
|
|
17
|
+
* @returns Queue instance with add, onIdle, and clear methods
|
|
18
|
+
*/
|
|
19
|
+
export declare function queue(options?: {
|
|
20
|
+
concurrency?: number;
|
|
21
|
+
}): {
|
|
22
|
+
/**
|
|
23
|
+
* Adds a promise-returning function to the queue
|
|
24
|
+
*/
|
|
25
|
+
add: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Clears all pending tasks from the queue
|
|
28
|
+
*/
|
|
29
|
+
clear: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Returns a promise that resolves when the queue becomes idle
|
|
32
|
+
*/
|
|
33
|
+
onIdle: () => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the number of currently active promises
|
|
36
|
+
*/
|
|
37
|
+
readonly pending: number;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the current size of the queue
|
|
40
|
+
*/
|
|
41
|
+
readonly size: number;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/async/queue.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,KAAK,CAAC,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO;IA4DxD;;OAEG;UACG,CAAC,MAAM,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAAC;IAa1C;;OAEG;iBACQ,IAAI;IAIf;;OAEG;kBACS,OAAO,CAAC,IAAI,CAAC;IAezB;;OAEG;sBACY,MAAM;IAIrB;;OAEG;mBACS,MAAM;EAIrB"}
|
package/dist/async/queue.js
CHANGED
|
@@ -1,57 +1,53 @@
|
|
|
1
|
-
import { assert as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
get size() {
|
|
50
|
-
return e.length;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
1
|
+
import { assert as e } from "../function/assert.js";
|
|
2
|
+
import { Scheduler as t } from "./scheduler.js";
|
|
3
|
+
//#region src/async/queue.ts
|
|
4
|
+
function n(n = {}) {
|
|
5
|
+
let { concurrency: r = 1 } = n;
|
|
6
|
+
e(r >= 1, "Concurrency must be at least 1", {
|
|
7
|
+
args: { concurrency: r },
|
|
8
|
+
type: RangeError
|
|
9
|
+
});
|
|
10
|
+
let i = 0, a = null, o = null, s = [], c = !1, l = () => {
|
|
11
|
+
c || (c = !0, new t().postTask(() => {
|
|
12
|
+
c = !1, u();
|
|
13
|
+
}, { priority: "user-visible" }));
|
|
14
|
+
}, u = () => {
|
|
15
|
+
if (i < r && s.length > 0) {
|
|
16
|
+
let e = s.shift();
|
|
17
|
+
i++, e.fn().then(e.resolve).catch(e.reject).finally(() => {
|
|
18
|
+
i--, l(), i === 0 && s.length === 0 && o && (o(), a = null, o = null);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
add: (e) => {
|
|
24
|
+
let { promise: t, reject: n, resolve: r } = Promise.withResolvers();
|
|
25
|
+
return s.push({
|
|
26
|
+
fn: e,
|
|
27
|
+
reject: n,
|
|
28
|
+
resolve: r
|
|
29
|
+
}), l(), t;
|
|
30
|
+
},
|
|
31
|
+
clear: () => {
|
|
32
|
+
s.length = 0;
|
|
33
|
+
},
|
|
34
|
+
onIdle: () => {
|
|
35
|
+
if (i === 0 && s.length === 0) return Promise.resolve();
|
|
36
|
+
if (!a) {
|
|
37
|
+
let e = Promise.withResolvers();
|
|
38
|
+
a = e.promise, o = e.resolve;
|
|
39
|
+
}
|
|
40
|
+
return a;
|
|
41
|
+
},
|
|
42
|
+
get pending() {
|
|
43
|
+
return i;
|
|
44
|
+
},
|
|
45
|
+
get size() {
|
|
46
|
+
return s.length;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
53
49
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//# sourceMappingURL=queue.js.map
|
|
50
|
+
//#endregion
|
|
51
|
+
export { n as queue };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=queue.js.map
|
package/dist/async/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sources":["../../src/async/queue.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Creates a promise queue that processes promises sequentially with optional concurrency limit.\n *\n * @example\n * ```ts\n * const requestQueue = queue({ concurrency: 2 });\n *\n * requestQueue.add(() => fetch('/api/1'));\n * requestQueue.add(() => fetch('/api/2'));\n * requestQueue.add(() => fetch('/api/3'));\n *\n * await requestQueue.onIdle(); // Wait for all tasks to complete\n * ```\n *\n * @param options - Queue configuration\n * @param options.concurrency - Maximum number of concurrent promises (default: 1)\n * @returns Queue instance with add, onIdle, and clear methods\n */\nexport function queue(options: { concurrency?: number } = {}) {\n const { concurrency = 1 } = options;\n\n assert(concurrency >= 1, 'Concurrency must be at least 1', {\n args: { concurrency },\n type: RangeError,\n });\n\n let activeCount = 0;\n let idlePromise: Promise<void> | null = null;\n let idleResolve: (() => void) | null = null;\n\n const
|
|
1
|
+
{"version":3,"file":"queue.js","names":[],"sources":["../../src/async/queue.ts"],"sourcesContent":["import { assert } from '../function/assert';\nimport { Scheduler } from './scheduler';\n\n/**\n * Creates a promise queue that processes promises sequentially with optional concurrency limit.\n *\n * @example\n * ```ts\n * const requestQueue = queue({ concurrency: 2 });\n *\n * requestQueue.add(() => fetch('/api/1'));\n * requestQueue.add(() => fetch('/api/2'));\n * requestQueue.add(() => fetch('/api/3'));\n *\n * await requestQueue.onIdle(); // Wait for all tasks to complete\n * ```\n *\n * @param options - Queue configuration\n * @param options.concurrency - Maximum number of concurrent promises (default: 1)\n * @returns Queue instance with add, onIdle, and clear methods\n */\nexport function queue(options: { concurrency?: number } = {}) {\n const { concurrency = 1 } = options;\n\n assert(concurrency >= 1, 'Concurrency must be at least 1', {\n args: { concurrency },\n type: RangeError,\n });\n\n let activeCount = 0;\n let idlePromise: Promise<void> | null = null;\n let idleResolve: (() => void) | null = null;\n\n const tasks: Array<{\n fn: () => Promise<unknown>;\n reject: (error: unknown) => void;\n resolve: (value: unknown) => void;\n }> = [];\n\n let flushQueued = false;\n\n const scheduleNext = (): void => {\n if (flushQueued) return;\n\n flushQueued = true;\n\n const scheduler = new Scheduler();\n\n void scheduler.postTask(\n () => {\n flushQueued = false;\n next();\n },\n { priority: 'user-visible' },\n );\n };\n\n const next = (): void => {\n if (activeCount < concurrency && tasks.length > 0) {\n const task = tasks.shift()!;\n\n activeCount++;\n\n task\n .fn()\n .then(task.resolve)\n .catch(task.reject)\n .finally(() => {\n activeCount--;\n scheduleNext();\n\n if (activeCount === 0 && tasks.length === 0 && idleResolve) {\n idleResolve();\n idlePromise = null;\n idleResolve = null;\n }\n });\n }\n };\n\n return {\n /**\n * Adds a promise-returning function to the queue\n */\n add: <T>(fn: () => Promise<T>): Promise<T> => {\n const { promise, reject, resolve } = Promise.withResolvers<T>();\n\n tasks.push({\n fn: fn as () => Promise<unknown>,\n reject,\n resolve: resolve as (value: unknown) => void,\n });\n scheduleNext();\n\n return promise;\n },\n\n /**\n * Clears all pending tasks from the queue\n */\n clear: (): void => {\n tasks.length = 0;\n },\n\n /**\n * Returns a promise that resolves when the queue becomes idle\n */\n onIdle: (): Promise<void> => {\n if (activeCount === 0 && tasks.length === 0) {\n return Promise.resolve();\n }\n\n if (!idlePromise) {\n const deferred = Promise.withResolvers<void>();\n\n idlePromise = deferred.promise;\n idleResolve = deferred.resolve;\n }\n\n return idlePromise;\n },\n\n /**\n * Returns the number of currently active promises\n */\n get pending(): number {\n return activeCount;\n },\n\n /**\n * Returns the current size of the queue\n */\n get size(): number {\n return tasks.length;\n },\n };\n}\n"],"mappings":";;;AAqBA,SAAgB,EAAM,IAAoC,EAAE,EAAE;CAC5D,IAAM,EAAE,iBAAc,MAAM;AAE5B,GAAO,KAAe,GAAG,kCAAkC;EACzD,MAAM,EAAE,gBAAa;EACrB,MAAM;EACP,CAAC;CAEF,IAAI,IAAc,GACd,IAAoC,MACpC,IAAmC,MAEjC,IAID,EAAE,EAEH,IAAc,IAEZ,UAA2B;AAC3B,QAEJ,IAAc,IAEI,IAAI,GAAW,CAElB,eACP;AAEJ,GADA,IAAc,IACd,GAAM;KAER,EAAE,UAAU,gBAAgB,CAC7B;IAGG,UAAmB;AACvB,MAAI,IAAc,KAAe,EAAM,SAAS,GAAG;GACjD,IAAM,IAAO,EAAM,OAAO;AAI1B,GAFA,KAEA,EACG,IAAI,CACJ,KAAK,EAAK,QAAQ,CAClB,MAAM,EAAK,OAAO,CAClB,cAAc;AAIb,IAHA,KACA,GAAc,EAEV,MAAgB,KAAK,EAAM,WAAW,KAAK,MAC7C,GAAa,EACb,IAAc,MACd,IAAc;KAEhB;;;AAIR,QAAO;EAIL,MAAS,MAAqC;GAC5C,IAAM,EAAE,YAAS,WAAQ,eAAY,QAAQ,eAAkB;AAS/D,UAPA,EAAM,KAAK;IACL;IACJ;IACS;IACV,CAAC,EACF,GAAc,EAEP;;EAMT,aAAmB;AACjB,KAAM,SAAS;;EAMjB,cAA6B;AAC3B,OAAI,MAAgB,KAAK,EAAM,WAAW,EACxC,QAAO,QAAQ,SAAS;AAG1B,OAAI,CAAC,GAAa;IAChB,IAAM,IAAW,QAAQ,eAAqB;AAG9C,IADA,IAAc,EAAS,SACvB,IAAc,EAAS;;AAGzB,UAAO;;EAMT,IAAI,UAAkB;AACpB,UAAO;;EAMT,IAAI,OAAe;AACjB,UAAO,EAAM;;EAEhB"}
|
package/dist/async/race.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=race.cjs.map
|
|
1
|
+
async function e(e,t){let n=new Promise(e=>setTimeout(e,t)),r=await e;return await n,r}exports.race=e;
|
|
2
|
+
//# sourceMappingURL=race.cjs.map
|
package/dist/async/race.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"race.cjs","sources":["../../src/async/race.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"race.cjs","names":[],"sources":["../../src/async/race.ts"],"sourcesContent":["/**\n * Races a promise against a minimum delay, ensuring the result is not returned\n * before the minimum duration has elapsed. Useful for preventing loading flicker.\n *\n * @example\n * ```ts\n * // Show loading spinner for at least 500ms\n * const result = await race(fetchData(), 500);\n * ```\n *\n * @param promise - The promise to race\n * @param minDelay - Minimum delay in milliseconds before resolving\n * @returns Promise that resolves with the result after the minimum delay\n */\nexport async function race<T>(promise: Promise<T>, minDelay: number): Promise<T> {\n const minDelayPromise = new Promise<void>((resolve) => setTimeout(resolve, minDelay));\n\n const result = await promise;\n\n await minDelayPromise;\n\n return result;\n}\n"],"mappings":"AAcA,eAAsB,EAAQ,EAAqB,EAA8B,CAC/E,IAAM,EAAkB,IAAI,QAAe,GAAY,WAAW,EAAS,EAAS,CAAC,CAE/E,EAAS,MAAM,EAIrB,OAFA,MAAM,EAEC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Races a promise against a minimum delay, ensuring the result is not returned
|
|
3
|
+
* before the minimum duration has elapsed. Useful for preventing loading flicker.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* // Show loading spinner for at least 500ms
|
|
8
|
+
* const result = await race(fetchData(), 500);
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @param promise - The promise to race
|
|
12
|
+
* @param minDelay - Minimum delay in milliseconds before resolving
|
|
13
|
+
* @returns Promise that resolves with the result after the minimum delay
|
|
14
|
+
*/
|
|
15
|
+
export declare function race<T>(promise: Promise<T>, minDelay: number): Promise<T>;
|
|
16
|
+
//# sourceMappingURL=race.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"race.d.ts","sourceRoot":"","sources":["../../src/async/race.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAQ/E"}
|
package/dist/async/race.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
async
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/async/race.ts
|
|
2
|
+
async function e(e, t) {
|
|
3
|
+
let n = new Promise((e) => setTimeout(e, t)), r = await e;
|
|
4
|
+
return await n, r;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=race.js.map
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as race };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=race.js.map
|
package/dist/async/race.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"race.js","sources":["../../src/async/race.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"race.js","names":[],"sources":["../../src/async/race.ts"],"sourcesContent":["/**\n * Races a promise against a minimum delay, ensuring the result is not returned\n * before the minimum duration has elapsed. Useful for preventing loading flicker.\n *\n * @example\n * ```ts\n * // Show loading spinner for at least 500ms\n * const result = await race(fetchData(), 500);\n * ```\n *\n * @param promise - The promise to race\n * @param minDelay - Minimum delay in milliseconds before resolving\n * @returns Promise that resolves with the result after the minimum delay\n */\nexport async function race<T>(promise: Promise<T>, minDelay: number): Promise<T> {\n const minDelayPromise = new Promise<void>((resolve) => setTimeout(resolve, minDelay));\n\n const result = await promise;\n\n await minDelayPromise;\n\n return result;\n}\n"],"mappings":";AAcA,eAAsB,EAAQ,GAAqB,GAA8B;CAC/E,IAAM,IAAkB,IAAI,SAAe,MAAY,WAAW,GAAS,EAAS,CAAC,EAE/E,IAAS,MAAM;AAIrB,QAFA,MAAM,GAEC"}
|
package/dist/async/retry.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=retry.cjs.map
|
|
1
|
+
const e=require(`./sleep.cjs`);async function t(t,{backoff:n=1,delay:r=250,retryDelay:i,shouldRetry:a,signal:o,times:s=3}={}){let c=r;for(let r=1;r<=s;r++){if(o?.aborted)throw o.reason??new DOMException(`Retry aborted`,`AbortError`);try{return await t()}catch(t){if(r===s||a&&!a(t,r-1))throw t;let o=i?i(r-1):c;o>0&&await e.sleep(o),i||(c=typeof n==`function`?n(r,c):c*n)}}throw Error(`Retry failed unexpectedly`)}exports.retry=t;
|
|
2
|
+
//# sourceMappingURL=retry.cjs.map
|