@vielzeug/arsenal 3.0.0 → 26.10.1
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 +2 -2
- package/dist/_common/_lruMap.cjs +1 -1
- package/dist/_common/_lruMap.cjs.map +1 -1
- package/dist/_common/_lruMap.d.ts +1 -1
- package/dist/_common/_lruMap.js +1 -17
- package/dist/_common/_lruMap.js.map +1 -1
- package/dist/_common/_selectorSet.cjs +1 -1
- package/dist/_common/_selectorSet.cjs.map +1 -1
- package/dist/_common/_selectorSet.js +1 -15
- package/dist/_common/_selectorSet.js.map +1 -1
- package/dist/_common/unsafePaths.cjs +1 -1
- package/dist/_common/unsafePaths.cjs.map +1 -1
- package/dist/_common/unsafePaths.d.ts +1 -1
- package/dist/_common/unsafePaths.js +1 -12
- package/dist/_common/unsafePaths.js.map +1 -1
- package/dist/_dev.cjs +1 -1
- package/dist/_dev.cjs.map +1 -1
- package/dist/_dev.js +1 -5
- package/dist/_dev.js.map +1 -1
- package/dist/array/chunk.cjs +1 -1
- package/dist/array/chunk.cjs.map +1 -1
- package/dist/array/chunk.js +1 -9
- package/dist/array/chunk.js.map +1 -1
- package/dist/array/compact.cjs +1 -1
- package/dist/array/compact.cjs.map +1 -1
- package/dist/array/compact.js +1 -7
- package/dist/array/compact.js.map +1 -1
- package/dist/array/compare.cjs +1 -1
- package/dist/array/compare.cjs.map +1 -1
- package/dist/array/compare.js +1 -18
- package/dist/array/compare.js.map +1 -1
- package/dist/array/compareBy.cjs +1 -1
- package/dist/array/compareBy.cjs.map +1 -1
- package/dist/array/compareBy.js +1 -15
- package/dist/array/compareBy.js.map +1 -1
- package/dist/array/contains.cjs +1 -1
- package/dist/array/contains.cjs.map +1 -1
- package/dist/array/contains.js +1 -8
- package/dist/array/contains.js.map +1 -1
- package/dist/array/countBy.cjs +1 -1
- package/dist/array/countBy.cjs.map +1 -1
- package/dist/array/countBy.js +1 -13
- package/dist/array/countBy.js.map +1 -1
- package/dist/array/difference.cjs +1 -1
- package/dist/array/difference.cjs.map +1 -1
- package/dist/array/difference.js +1 -13
- package/dist/array/difference.js.map +1 -1
- package/dist/array/drop.cjs +1 -1
- package/dist/array/drop.cjs.map +1 -1
- package/dist/array/drop.js +1 -8
- package/dist/array/drop.js.map +1 -1
- package/dist/array/dropLast.cjs +1 -1
- package/dist/array/dropLast.cjs.map +1 -1
- package/dist/array/dropLast.js +1 -8
- package/dist/array/dropLast.js.map +1 -1
- package/dist/array/filterMap.cjs +1 -1
- package/dist/array/filterMap.cjs.map +1 -1
- package/dist/array/filterMap.js +1 -12
- package/dist/array/filterMap.js.map +1 -1
- package/dist/array/first.cjs +1 -1
- package/dist/array/first.cjs.map +1 -1
- package/dist/array/first.js +1 -7
- package/dist/array/first.js.map +1 -1
- package/dist/array/groupBy.cjs +1 -1
- package/dist/array/groupBy.cjs.map +1 -1
- package/dist/array/groupBy.js +1 -13
- package/dist/array/groupBy.js.map +1 -1
- package/dist/array/index.js +1 -28
- package/dist/array/indexBy.cjs +1 -1
- package/dist/array/indexBy.cjs.map +1 -1
- package/dist/array/indexBy.js +1 -13
- package/dist/array/indexBy.js.map +1 -1
- package/dist/array/intersection.cjs +1 -1
- package/dist/array/intersection.cjs.map +1 -1
- package/dist/array/intersection.js +1 -13
- package/dist/array/intersection.js.map +1 -1
- package/dist/array/last.cjs +1 -1
- package/dist/array/last.cjs.map +1 -1
- package/dist/array/last.js +1 -7
- package/dist/array/last.js.map +1 -1
- package/dist/array/partition.cjs +1 -1
- package/dist/array/partition.cjs.map +1 -1
- package/dist/array/partition.js +1 -9
- package/dist/array/partition.js.map +1 -1
- package/dist/array/replace.cjs +1 -1
- package/dist/array/replace.cjs.map +1 -1
- package/dist/array/replace.js +1 -12
- package/dist/array/replace.js.map +1 -1
- package/dist/array/rotate.cjs +1 -1
- package/dist/array/rotate.cjs.map +1 -1
- package/dist/array/rotate.js +1 -9
- package/dist/array/rotate.js.map +1 -1
- package/dist/array/search.cjs +1 -1
- package/dist/array/search.cjs.map +1 -1
- package/dist/array/search.js +1 -29
- package/dist/array/search.js.map +1 -1
- package/dist/array/sort.cjs +1 -1
- package/dist/array/sort.cjs.map +1 -1
- package/dist/array/sort.d.ts +1 -1
- package/dist/array/sort.js +1 -14
- package/dist/array/sort.js.map +1 -1
- package/dist/array/take.cjs +1 -1
- package/dist/array/take.cjs.map +1 -1
- package/dist/array/take.js +1 -8
- package/dist/array/take.js.map +1 -1
- package/dist/array/takeLast.cjs +1 -1
- package/dist/array/takeLast.cjs.map +1 -1
- package/dist/array/takeLast.js +1 -8
- package/dist/array/takeLast.js.map +1 -1
- package/dist/array/toggle.cjs +1 -1
- package/dist/array/toggle.cjs.map +1 -1
- package/dist/array/toggle.js +1 -8
- package/dist/array/toggle.js.map +1 -1
- package/dist/array/union.cjs +1 -1
- package/dist/array/union.cjs.map +1 -1
- package/dist/array/union.js +1 -8
- package/dist/array/union.js.map +1 -1
- package/dist/array/uniq.cjs +1 -1
- package/dist/array/uniq.cjs.map +1 -1
- package/dist/array/uniq.js +1 -8
- package/dist/array/uniq.js.map +1 -1
- package/dist/array/unzip.cjs +1 -1
- package/dist/array/unzip.cjs.map +1 -1
- package/dist/array/unzip.js +1 -10
- package/dist/array/unzip.js.map +1 -1
- package/dist/array/zip.cjs +1 -1
- package/dist/array/zip.cjs.map +1 -1
- package/dist/array/zip.js +1 -10
- package/dist/array/zip.js.map +1 -1
- package/dist/arsenal.cjs +1 -1
- package/dist/arsenal.cjs.map +1 -1
- package/dist/arsenal.iife.js +1 -1
- package/dist/arsenal.iife.js.map +1 -1
- package/dist/arsenal.js +1 -1
- package/dist/arsenal.js.map +1 -1
- package/dist/async/abortError.cjs +1 -1
- package/dist/async/abortError.cjs.map +1 -1
- package/dist/async/abortError.js +1 -7
- package/dist/async/abortError.js.map +1 -1
- package/dist/async/abortable.cjs +1 -1
- package/dist/async/abortable.cjs.map +1 -1
- package/dist/async/abortable.d.ts +1 -1
- package/dist/async/abortable.js +1 -11
- package/dist/async/abortable.js.map +1 -1
- package/dist/async/attempt.cjs +1 -1
- package/dist/async/attempt.cjs.map +1 -1
- package/dist/async/attempt.d.ts +1 -1
- package/dist/async/attempt.js +1 -23
- package/dist/async/attempt.js.map +1 -1
- package/dist/async/backoff.cjs +1 -1
- package/dist/async/backoff.cjs.map +1 -1
- package/dist/async/backoff.d.ts +1 -1
- package/dist/async/backoff.js +1 -7
- package/dist/async/backoff.js.map +1 -1
- package/dist/async/index.js +1 -10
- package/dist/async/parallel.cjs +1 -1
- package/dist/async/parallel.cjs.map +1 -1
- package/dist/async/parallel.js +1 -24
- package/dist/async/parallel.js.map +1 -1
- package/dist/async/retry.cjs +1 -1
- package/dist/async/retry.cjs.map +1 -1
- package/dist/async/retry.d.ts +5 -7
- package/dist/async/retry.d.ts.map +1 -1
- package/dist/async/retry.js +1 -24
- package/dist/async/retry.js.map +1 -1
- package/dist/async/sleep.cjs +1 -1
- package/dist/async/sleep.cjs.map +1 -1
- package/dist/async/sleep.js +1 -15
- package/dist/async/sleep.js.map +1 -1
- package/dist/async/taskPool.cjs +1 -1
- package/dist/async/taskPool.cjs.map +1 -1
- package/dist/async/taskPool.js +1 -50
- package/dist/async/taskPool.js.map +1 -1
- package/dist/async/waitFor.cjs +1 -1
- package/dist/async/waitFor.cjs.map +1 -1
- package/dist/async/waitFor.js +1 -12
- package/dist/async/waitFor.js.map +1 -1
- package/dist/cache/cache.cjs +1 -1
- package/dist/cache/cache.cjs.map +1 -1
- package/dist/cache/cache.js +1 -59
- package/dist/cache/cache.js.map +1 -1
- package/dist/cache/index.js +1 -3
- package/dist/cache/memo.cjs +1 -1
- package/dist/cache/memo.cjs.map +1 -1
- package/dist/cache/memo.d.ts +1 -1
- package/dist/cache/memo.js +1 -37
- package/dist/cache/memo.js.map +1 -1
- package/dist/encoding/base64url.cjs +2 -0
- package/dist/encoding/base64url.cjs.map +1 -0
- package/dist/encoding/base64url.d.ts +9 -0
- package/dist/encoding/base64url.d.ts.map +1 -0
- package/dist/encoding/base64url.js +2 -0
- package/dist/encoding/base64url.js.map +1 -0
- package/dist/encoding/index.cjs +1 -0
- package/dist/encoding/index.d.ts +2 -0
- package/dist/encoding/index.d.ts.map +1 -0
- package/dist/encoding/index.js +1 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -9
- package/dist/errors.js.map +1 -1
- package/dist/function/assert.cjs +1 -1
- package/dist/function/assert.cjs.map +1 -1
- package/dist/function/assert.d.ts +1 -0
- package/dist/function/assert.d.ts.map +1 -1
- package/dist/function/assert.js +1 -7
- package/dist/function/assert.js.map +1 -1
- package/dist/function/debounce.cjs +1 -1
- package/dist/function/debounce.cjs.map +1 -1
- package/dist/function/debounce.d.ts +2 -2
- package/dist/function/debounce.js +1 -26
- package/dist/function/debounce.js.map +1 -1
- package/dist/function/index.cjs +1 -1
- package/dist/function/index.d.ts +1 -0
- package/dist/function/index.d.ts.map +1 -1
- package/dist/function/index.js +1 -8
- package/dist/function/once.cjs +1 -1
- package/dist/function/once.cjs.map +1 -1
- package/dist/function/once.d.ts +3 -3
- package/dist/function/once.js +1 -10
- package/dist/function/once.js.map +1 -1
- package/dist/function/pipe.cjs +1 -1
- package/dist/function/pipe.cjs.map +1 -1
- package/dist/function/pipe.d.ts +1 -1
- package/dist/function/pipe.js +1 -9
- package/dist/function/pipe.js.map +1 -1
- package/dist/function/runAll.cjs +1 -1
- package/dist/function/runAll.cjs.map +1 -1
- package/dist/function/runAll.js +1 -18
- package/dist/function/runAll.js.map +1 -1
- package/dist/function/tap.cjs +1 -1
- package/dist/function/tap.cjs.map +1 -1
- package/dist/function/tap.js +1 -7
- package/dist/function/tap.js.map +1 -1
- package/dist/function/tapper.cjs +2 -0
- package/dist/function/tapper.cjs.map +1 -0
- package/dist/function/tapper.d.ts +27 -0
- package/dist/function/tapper.d.ts.map +1 -0
- package/dist/function/tapper.js +2 -0
- package/dist/function/tapper.js.map +1 -0
- package/dist/function/throttle.cjs +1 -1
- package/dist/function/throttle.cjs.map +1 -1
- package/dist/function/throttle.js +1 -35
- package/dist/function/throttle.js.map +1 -1
- package/dist/guards/combinators.cjs +1 -1
- package/dist/guards/combinators.cjs.map +1 -1
- package/dist/guards/combinators.d.ts +1 -1
- package/dist/guards/combinators.js +1 -16
- package/dist/guards/combinators.js.map +1 -1
- package/dist/guards/index.js +1 -17
- package/dist/guards/isAbortError.cjs +1 -1
- package/dist/guards/isAbortError.cjs.map +1 -1
- package/dist/guards/isAbortError.d.ts +2 -2
- package/dist/guards/isAbortError.js +1 -7
- package/dist/guards/isAbortError.js.map +1 -1
- package/dist/guards/isDate.cjs +1 -1
- package/dist/guards/isDate.cjs.map +1 -1
- package/dist/guards/isDate.js +1 -7
- package/dist/guards/isDate.js.map +1 -1
- package/dist/guards/isDefined.cjs +1 -1
- package/dist/guards/isDefined.cjs.map +1 -1
- package/dist/guards/isDefined.js +1 -7
- package/dist/guards/isDefined.js.map +1 -1
- package/dist/guards/isEmpty.cjs +1 -1
- package/dist/guards/isEmpty.cjs.map +1 -1
- package/dist/guards/isEmpty.js +1 -8
- package/dist/guards/isEmpty.js.map +1 -1
- package/dist/guards/isEqual.cjs +1 -1
- package/dist/guards/isEqual.cjs.map +1 -1
- package/dist/guards/isEqual.d.ts +1 -1
- package/dist/guards/isEqual.js +1 -33
- package/dist/guards/isEqual.js.map +1 -1
- package/dist/guards/isError.cjs +1 -1
- package/dist/guards/isError.cjs.map +1 -1
- package/dist/guards/isError.js +1 -7
- package/dist/guards/isError.js.map +1 -1
- package/dist/guards/isFunction.cjs +1 -1
- package/dist/guards/isFunction.cjs.map +1 -1
- package/dist/guards/isFunction.js +1 -7
- package/dist/guards/isFunction.js.map +1 -1
- package/dist/guards/isMatch.cjs +1 -1
- package/dist/guards/isMatch.cjs.map +1 -1
- package/dist/guards/isMatch.js +1 -22
- package/dist/guards/isMatch.js.map +1 -1
- package/dist/guards/isNil.cjs +1 -1
- package/dist/guards/isNil.cjs.map +1 -1
- package/dist/guards/isNil.js +1 -7
- package/dist/guards/isNil.js.map +1 -1
- package/dist/guards/isNumber.cjs +1 -1
- package/dist/guards/isNumber.cjs.map +1 -1
- package/dist/guards/isNumber.js +1 -7
- package/dist/guards/isNumber.js.map +1 -1
- package/dist/guards/isPlainObject.cjs +1 -1
- package/dist/guards/isPlainObject.cjs.map +1 -1
- package/dist/guards/isPlainObject.d.ts +1 -1
- package/dist/guards/isPlainObject.js +1 -9
- package/dist/guards/isPlainObject.js.map +1 -1
- package/dist/guards/isPrimitive.cjs +1 -1
- package/dist/guards/isPrimitive.cjs.map +1 -1
- package/dist/guards/isPrimitive.js +1 -7
- package/dist/guards/isPrimitive.js.map +1 -1
- package/dist/guards/isPromise.cjs +1 -1
- package/dist/guards/isPromise.cjs.map +1 -1
- package/dist/guards/isPromise.js +1 -7
- package/dist/guards/isPromise.js.map +1 -1
- package/dist/guards/isRegex.cjs +1 -1
- package/dist/guards/isRegex.cjs.map +1 -1
- package/dist/guards/isRegex.js +1 -7
- package/dist/guards/isRegex.js.map +1 -1
- package/dist/guards/shallowEqual.cjs +1 -1
- package/dist/guards/shallowEqual.cjs.map +1 -1
- package/dist/guards/shallowEqual.d.ts +3 -3
- package/dist/guards/shallowEqual.js +1 -19
- package/dist/guards/shallowEqual.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -35
- package/dist/math/allocate.cjs +1 -1
- package/dist/math/allocate.cjs.map +1 -1
- package/dist/math/allocate.js +1 -18
- package/dist/math/allocate.js.map +1 -1
- package/dist/math/average.cjs +1 -1
- package/dist/math/average.cjs.map +1 -1
- package/dist/math/average.js +1 -8
- package/dist/math/average.js.map +1 -1
- package/dist/math/clamp.cjs +1 -1
- package/dist/math/clamp.cjs.map +1 -1
- package/dist/math/clamp.d.ts +6 -6
- package/dist/math/clamp.js +1 -7
- package/dist/math/clamp.js.map +1 -1
- package/dist/math/gcd.cjs +1 -1
- package/dist/math/gcd.cjs.map +1 -1
- package/dist/math/gcd.d.ts +1 -1
- package/dist/math/gcd.js +1 -13
- package/dist/math/gcd.js.map +1 -1
- package/dist/math/index.js +1 -16
- package/dist/math/lcm.cjs +1 -1
- package/dist/math/lcm.cjs.map +1 -1
- package/dist/math/lcm.js +1 -12
- package/dist/math/lcm.js.map +1 -1
- package/dist/math/lerp.cjs +1 -1
- package/dist/math/lerp.cjs.map +1 -1
- package/dist/math/lerp.d.ts +1 -1
- package/dist/math/lerp.js +1 -7
- package/dist/math/lerp.js.map +1 -1
- package/dist/math/linspace.cjs +1 -1
- package/dist/math/linspace.cjs.map +1 -1
- package/dist/math/linspace.js +1 -11
- package/dist/math/linspace.js.map +1 -1
- package/dist/math/median.cjs +1 -1
- package/dist/math/median.cjs.map +1 -1
- package/dist/math/median.js +1 -11
- package/dist/math/median.js.map +1 -1
- package/dist/math/mod.cjs +1 -1
- package/dist/math/mod.cjs.map +1 -1
- package/dist/math/mod.d.ts +1 -1
- package/dist/math/mod.js +1 -8
- package/dist/math/mod.js.map +1 -1
- package/dist/math/normalize.cjs +1 -1
- package/dist/math/normalize.cjs.map +1 -1
- package/dist/math/normalize.js +1 -8
- package/dist/math/normalize.js.map +1 -1
- package/dist/math/range.cjs +1 -1
- package/dist/math/range.cjs.map +1 -1
- package/dist/math/range.js +1 -25
- package/dist/math/range.js.map +1 -1
- package/dist/math/round.cjs +1 -1
- package/dist/math/round.cjs.map +1 -1
- package/dist/math/round.js +1 -9
- package/dist/math/round.js.map +1 -1
- package/dist/math/standardDeviation.cjs +1 -1
- package/dist/math/standardDeviation.cjs.map +1 -1
- package/dist/math/standardDeviation.js +1 -8
- package/dist/math/standardDeviation.js.map +1 -1
- package/dist/math/sum.cjs +1 -1
- package/dist/math/sum.cjs.map +1 -1
- package/dist/math/sum.js +1 -11
- package/dist/math/sum.js.map +1 -1
- package/dist/math/variance.cjs +1 -1
- package/dist/math/variance.cjs.map +1 -1
- package/dist/math/variance.js +1 -10
- package/dist/math/variance.js.map +1 -1
- package/dist/object/defaults.cjs +1 -1
- package/dist/object/defaults.cjs.map +1 -1
- package/dist/object/defaults.d.ts +1 -1
- package/dist/object/defaults.js +1 -11
- package/dist/object/defaults.js.map +1 -1
- package/dist/object/diff.cjs +1 -1
- package/dist/object/diff.cjs.map +1 -1
- package/dist/object/diff.d.ts +1 -1
- package/dist/object/diff.js +1 -26
- package/dist/object/diff.js.map +1 -1
- package/dist/object/filterValues.cjs +1 -1
- package/dist/object/filterValues.cjs.map +1 -1
- package/dist/object/filterValues.js +1 -10
- package/dist/object/filterValues.js.map +1 -1
- package/dist/object/flattenPaths.cjs +1 -1
- package/dist/object/flattenPaths.cjs.map +1 -1
- package/dist/object/flattenPaths.js +1 -30
- package/dist/object/flattenPaths.js.map +1 -1
- package/dist/object/getPath.cjs +1 -1
- package/dist/object/getPath.cjs.map +1 -1
- package/dist/object/getPath.js +1 -25
- package/dist/object/getPath.js.map +1 -1
- package/dist/object/hash.cjs +1 -1
- package/dist/object/hash.cjs.map +1 -1
- package/dist/object/hash.d.ts +2 -2
- package/dist/object/hash.js +1 -27
- package/dist/object/hash.js.map +1 -1
- package/dist/object/index.js +1 -15
- package/dist/object/invert.cjs +1 -1
- package/dist/object/invert.cjs.map +1 -1
- package/dist/object/invert.js +1 -10
- package/dist/object/invert.js.map +1 -1
- package/dist/object/mapKeys.cjs +1 -1
- package/dist/object/mapKeys.cjs.map +1 -1
- package/dist/object/mapKeys.js +1 -14
- package/dist/object/mapKeys.js.map +1 -1
- package/dist/object/mapValues.cjs +1 -1
- package/dist/object/mapValues.cjs.map +1 -1
- package/dist/object/mapValues.js +1 -10
- package/dist/object/mapValues.js.map +1 -1
- package/dist/object/merge.cjs +1 -1
- package/dist/object/merge.cjs.map +1 -1
- package/dist/object/merge.js +1 -25
- package/dist/object/merge.js.map +1 -1
- package/dist/object/omit.cjs +1 -1
- package/dist/object/omit.cjs.map +1 -1
- package/dist/object/omit.js +1 -10
- package/dist/object/omit.js.map +1 -1
- package/dist/object/pick.cjs +1 -1
- package/dist/object/pick.cjs.map +1 -1
- package/dist/object/pick.d.ts +1 -1
- package/dist/object/pick.js +1 -10
- package/dist/object/pick.js.map +1 -1
- package/dist/object/prune.cjs +1 -1
- package/dist/object/prune.cjs.map +1 -1
- package/dist/object/prune.js +1 -33
- package/dist/object/prune.js.map +1 -1
- package/dist/object/tryParseJson.cjs +1 -1
- package/dist/object/tryParseJson.cjs.map +1 -1
- package/dist/object/tryParseJson.js +1 -17
- package/dist/object/tryParseJson.js.map +1 -1
- package/dist/random/_index.cjs +1 -1
- package/dist/random/_index.cjs.map +1 -1
- package/dist/random/_index.js +1 -8
- package/dist/random/_index.js.map +1 -1
- package/dist/random/draw.cjs +1 -1
- package/dist/random/draw.cjs.map +1 -1
- package/dist/random/draw.js +1 -20
- package/dist/random/draw.js.map +1 -1
- package/dist/random/index.js +1 -5
- package/dist/random/random.cjs +1 -1
- package/dist/random/random.cjs.map +1 -1
- package/dist/random/random.js +1 -9
- package/dist/random/random.js.map +1 -1
- package/dist/random/shuffle.cjs +1 -1
- package/dist/random/shuffle.cjs.map +1 -1
- package/dist/random/shuffle.js +1 -13
- package/dist/random/shuffle.js.map +1 -1
- package/dist/random/source.cjs +1 -1
- package/dist/random/source.cjs.map +1 -1
- package/dist/random/source.js +1 -9
- package/dist/random/source.js.map +1 -1
- package/dist/string/_caseUtils.cjs +1 -1
- package/dist/string/_caseUtils.cjs.map +1 -1
- package/dist/string/_caseUtils.js +1 -12
- package/dist/string/_caseUtils.js.map +1 -1
- package/dist/string/camelCase.cjs +1 -1
- package/dist/string/camelCase.cjs.map +1 -1
- package/dist/string/camelCase.js +1 -8
- package/dist/string/camelCase.js.map +1 -1
- package/dist/string/escape.cjs +1 -1
- package/dist/string/escape.cjs.map +1 -1
- package/dist/string/escape.js +1 -14
- package/dist/string/escape.js.map +1 -1
- package/dist/string/index.js +1 -12
- package/dist/string/kebabCase.cjs +1 -1
- package/dist/string/kebabCase.cjs.map +1 -1
- package/dist/string/kebabCase.js +1 -8
- package/dist/string/kebabCase.js.map +1 -1
- package/dist/string/padCenter.cjs +1 -1
- package/dist/string/padCenter.cjs.map +1 -1
- package/dist/string/padCenter.js +1 -9
- package/dist/string/padCenter.js.map +1 -1
- package/dist/string/pascalCase.cjs +1 -1
- package/dist/string/pascalCase.cjs.map +1 -1
- package/dist/string/pascalCase.js +1 -8
- package/dist/string/pascalCase.js.map +1 -1
- package/dist/string/similarity.cjs +1 -1
- package/dist/string/similarity.cjs.map +1 -1
- package/dist/string/similarity.js +1 -22
- package/dist/string/similarity.js.map +1 -1
- package/dist/string/snakeCase.cjs +1 -1
- package/dist/string/snakeCase.cjs.map +1 -1
- package/dist/string/snakeCase.js +1 -8
- package/dist/string/snakeCase.js.map +1 -1
- package/dist/string/titleCase.cjs +1 -1
- package/dist/string/titleCase.cjs.map +1 -1
- package/dist/string/titleCase.js +1 -8
- package/dist/string/titleCase.js.map +1 -1
- package/dist/string/truncate.cjs +1 -1
- package/dist/string/truncate.cjs.map +1 -1
- package/dist/string/truncate.js +1 -15
- package/dist/string/truncate.js.map +1 -1
- package/dist/string/unescape.cjs +1 -1
- package/dist/string/unescape.cjs.map +1 -1
- package/dist/string/unescape.js +1 -14
- package/dist/string/unescape.js.map +1 -1
- package/dist/string/words.cjs +1 -1
- package/dist/string/words.cjs.map +1 -1
- package/dist/string/words.js +1 -9
- package/dist/string/words.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.cjs","names":[],"sources":["../../src/array/toggle.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Either adds or removes an item from an array, based on whether it already\n * exists in the array (toggle behaviour).\n *\n * @example\n * ```ts\n * toggle([1, 2, 3], 4) // [1, 2, 3, 4]\n * toggle([1, 2, 3], 2) // [1, 3]\n *\n * toggle(\n * [{ id: 1 }, { id: 2 }],\n * { id: 3 },\n * (obj) => obj.id,\n * { strategy: 'prepend' }\n * ) // [{ id: 3 }, { id: 1 }, { id: 2 }]\n * ```\n *\n * @param array - The array to modify.\n * @param item - The item to add or remove.\n * @param selector - A function to determine item identity.\n * @param [options] - Options for the toggle operation.\n * @param [options.strategy] - Where to insert when adding: 'prepend' or 'append' (default).\n * @returns A new array with the item toggled.\n */\nexport function toggle<T>(\n array: readonly T[],\n item: T,\n selector?: (item: T) => Primitive,\n options: { strategy?: 'prepend' | 'append' } = {},\n): T[] {\n const { strategy = 'append' } = options;\n const compareFn = selector ? (el: T) => selector(el) === selector(item) : (el: T) => el === item;\n\n const index = array.findIndex(compareFn);\n\n if (index !== -1) {\n return [...array.slice(0, index), ...array.slice(index + 1)];\n }\n\n return strategy === 'prepend' ? [item, ...array] : [...array, item];\n}\n"],"mappings":"AA0BA,SAAgB,
|
|
1
|
+
{"version":3,"file":"toggle.cjs","names":[],"sources":["../../src/array/toggle.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Either adds or removes an item from an array, based on whether it already\n * exists in the array (toggle behaviour).\n *\n * @example\n * ```ts\n * toggle([1, 2, 3], 4) // [1, 2, 3, 4]\n * toggle([1, 2, 3], 2) // [1, 3]\n *\n * toggle(\n * [{ id: 1 }, { id: 2 }],\n * { id: 3 },\n * (obj) => obj.id,\n * { strategy: 'prepend' }\n * ) // [{ id: 3 }, { id: 1 }, { id: 2 }]\n * ```\n *\n * @param array - The array to modify.\n * @param item - The item to add or remove.\n * @param selector - A function to determine item identity.\n * @param [options] - Options for the toggle operation.\n * @param [options.strategy] - Where to insert when adding: 'prepend' or 'append' (default).\n * @returns A new array with the item toggled.\n */\nexport function toggle<T>(\n array: readonly T[],\n item: T,\n selector?: (item: T) => Primitive,\n options: { strategy?: 'prepend' | 'append' } = {},\n): T[] {\n const { strategy = 'append' } = options;\n const compareFn = selector ? (el: T) => selector(el) === selector(item) : (el: T) => el === item;\n\n const index = array.findIndex(compareFn);\n\n if (index !== -1) {\n return [...array.slice(0, index), ...array.slice(index + 1)];\n }\n\n return strategy === 'prepend' ? [item, ...array] : [...array, item];\n}\n"],"mappings":"AA0BA,SAAgB,OACd,EACA,EACA,EACA,EAA+C,CAAC,EAC3C,CACL,GAAM,CAAE,WAAW,UAAa,EAC1B,EAAY,EAAY,GAAU,EAAS,CAAE,IAAM,EAAS,CAAI,EAAK,GAAU,IAAO,EAEtF,EAAQ,EAAM,UAAU,CAAS,EAMvC,OAJI,IAAU,GAIP,IAAa,UAAY,CAAC,EAAM,GAAG,CAAK,EAAI,CAAC,GAAG,EAAO,CAAI,EAHzD,CAAC,GAAG,EAAM,MAAM,EAAG,CAAK,EAAG,GAAG,EAAM,MAAM,EAAQ,CAAC,CAAC,CAI/D"}
|
package/dist/array/toggle.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
function e(e, t, n, r = {}) {
|
|
3
|
-
let { strategy: i = "append" } = r, a = n ? (e) => n(e) === n(t) : (e) => e === t, o = e.findIndex(a);
|
|
4
|
-
return o === -1 ? i === "prepend" ? [t, ...e] : [...e, t] : [...e.slice(0, o), ...e.slice(o + 1)];
|
|
5
|
-
}
|
|
6
|
-
//#endregion
|
|
7
|
-
export { e as toggle };
|
|
8
|
-
|
|
1
|
+
function toggle(e,t,n,r={}){let{strategy:i=`append`}=r,a=n?e=>n(e)===n(t):e=>e===t,o=e.findIndex(a);return o===-1?i===`prepend`?[t,...e]:[...e,t]:[...e.slice(0,o),...e.slice(o+1)]}export{toggle};
|
|
9
2
|
//# sourceMappingURL=toggle.js.map
|
package/dist/array/toggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","names":[],"sources":["../../src/array/toggle.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Either adds or removes an item from an array, based on whether it already\n * exists in the array (toggle behaviour).\n *\n * @example\n * ```ts\n * toggle([1, 2, 3], 4) // [1, 2, 3, 4]\n * toggle([1, 2, 3], 2) // [1, 3]\n *\n * toggle(\n * [{ id: 1 }, { id: 2 }],\n * { id: 3 },\n * (obj) => obj.id,\n * { strategy: 'prepend' }\n * ) // [{ id: 3 }, { id: 1 }, { id: 2 }]\n * ```\n *\n * @param array - The array to modify.\n * @param item - The item to add or remove.\n * @param selector - A function to determine item identity.\n * @param [options] - Options for the toggle operation.\n * @param [options.strategy] - Where to insert when adding: 'prepend' or 'append' (default).\n * @returns A new array with the item toggled.\n */\nexport function toggle<T>(\n array: readonly T[],\n item: T,\n selector?: (item: T) => Primitive,\n options: { strategy?: 'prepend' | 'append' } = {},\n): T[] {\n const { strategy = 'append' } = options;\n const compareFn = selector ? (el: T) => selector(el) === selector(item) : (el: T) => el === item;\n\n const index = array.findIndex(compareFn);\n\n if (index !== -1) {\n return [...array.slice(0, index), ...array.slice(index + 1)];\n }\n\n return strategy === 'prepend' ? [item, ...array] : [...array, item];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toggle.js","names":[],"sources":["../../src/array/toggle.ts"],"sourcesContent":["import type { Primitive } from '../types';\n\n/**\n * Either adds or removes an item from an array, based on whether it already\n * exists in the array (toggle behaviour).\n *\n * @example\n * ```ts\n * toggle([1, 2, 3], 4) // [1, 2, 3, 4]\n * toggle([1, 2, 3], 2) // [1, 3]\n *\n * toggle(\n * [{ id: 1 }, { id: 2 }],\n * { id: 3 },\n * (obj) => obj.id,\n * { strategy: 'prepend' }\n * ) // [{ id: 3 }, { id: 1 }, { id: 2 }]\n * ```\n *\n * @param array - The array to modify.\n * @param item - The item to add or remove.\n * @param selector - A function to determine item identity.\n * @param [options] - Options for the toggle operation.\n * @param [options.strategy] - Where to insert when adding: 'prepend' or 'append' (default).\n * @returns A new array with the item toggled.\n */\nexport function toggle<T>(\n array: readonly T[],\n item: T,\n selector?: (item: T) => Primitive,\n options: { strategy?: 'prepend' | 'append' } = {},\n): T[] {\n const { strategy = 'append' } = options;\n const compareFn = selector ? (el: T) => selector(el) === selector(item) : (el: T) => el === item;\n\n const index = array.findIndex(compareFn);\n\n if (index !== -1) {\n return [...array.slice(0, index), ...array.slice(index + 1)];\n }\n\n return strategy === 'prepend' ? [item, ...array] : [...array, item];\n}\n"],"mappings":"AA0BA,SAAgB,OACd,EACA,EACA,EACA,EAA+C,CAAC,EAC3C,CACL,GAAM,CAAE,WAAW,UAAa,EAC1B,EAAY,EAAY,GAAU,EAAS,CAAE,IAAM,EAAS,CAAI,EAAK,GAAU,IAAO,EAEtF,EAAQ,EAAM,UAAU,CAAS,EAMvC,OAJI,IAAU,GAIP,IAAa,UAAY,CAAC,EAAM,GAAG,CAAK,EAAI,CAAC,GAAG,EAAO,CAAI,EAHzD,CAAC,GAAG,EAAM,MAAM,EAAG,CAAK,EAAG,GAAG,EAAM,MAAM,EAAQ,CAAC,CAAC,CAI/D"}
|
package/dist/array/union.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../_common/_selectorSet.cjs");function
|
|
1
|
+
const e=require("../_common/_selectorSet.cjs");function union(t,n,r){return r?e.dedupeBySelector([...t,...n],r):[...new Set([...t,...n])]}exports.union=union;
|
|
2
2
|
//# sourceMappingURL=union.cjs.map
|
package/dist/array/union.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.cjs","names":[],"sources":["../../src/array/union.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns a deduplicated union of `source` and `other`.\n *\n * Allocates a new `Set` (or selector-keyed dedup structure) and a new result array.\n */\nexport function union<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n return [...new Set([...source, ...other])];\n }\n\n return dedupeBySelector([...source, ...other], selector);\n}\n"],"mappings":"+CAQA,SAAgB,
|
|
1
|
+
{"version":3,"file":"union.cjs","names":[],"sources":["../../src/array/union.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns a deduplicated union of `source` and `other`.\n *\n * Allocates a new `Set` (or selector-keyed dedup structure) and a new result array.\n */\nexport function union<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n return [...new Set([...source, ...other])];\n }\n\n return dedupeBySelector([...source, ...other], selector);\n}\n"],"mappings":"+CAQA,SAAgB,MAAS,EAAsB,EAAqB,EAAwC,CAK1G,OAJK,EAIE,EAAA,iBAAiB,CAAC,GAAG,EAAQ,GAAG,CAAK,EAAG,CAAQ,EAH9C,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAQ,GAAG,CAAK,CAAC,CAAC,CAI7C"}
|
package/dist/array/union.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/array/union.ts
|
|
3
|
-
function t(t, n, r) {
|
|
4
|
-
return r ? e([...t, ...n], r) : [.../* @__PURE__ */ new Set([...t, ...n])];
|
|
5
|
-
}
|
|
6
|
-
//#endregion
|
|
7
|
-
export { t as union };
|
|
8
|
-
|
|
1
|
+
import{dedupeBySelector as e}from"../_common/_selectorSet.js";function union(t,n,r){return r?e([...t,...n],r):[...new Set([...t,...n])]}export{union};
|
|
9
2
|
//# sourceMappingURL=union.js.map
|
package/dist/array/union.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.js","names":[],"sources":["../../src/array/union.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns a deduplicated union of `source` and `other`.\n *\n * Allocates a new `Set` (or selector-keyed dedup structure) and a new result array.\n */\nexport function union<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n return [...new Set([...source, ...other])];\n }\n\n return dedupeBySelector([...source, ...other], selector);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"union.js","names":[],"sources":["../../src/array/union.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Returns a deduplicated union of `source` and `other`.\n *\n * Allocates a new `Set` (or selector-keyed dedup structure) and a new result array.\n */\nexport function union<T>(source: readonly T[], other: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (!selector) {\n return [...new Set([...source, ...other])];\n }\n\n return dedupeBySelector([...source, ...other], selector);\n}\n"],"mappings":"8DAQA,SAAgB,MAAS,EAAsB,EAAqB,EAAwC,CAK1G,OAJK,EAIE,EAAiB,CAAC,GAAG,EAAQ,GAAG,CAAK,EAAG,CAAQ,EAH9C,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAQ,GAAG,CAAK,CAAC,CAAC,CAI7C"}
|
package/dist/array/uniq.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../_common/_selectorSet.cjs");function
|
|
1
|
+
const e=require("../_common/_selectorSet.cjs");function uniq(t,n){return t.length<=1?[...t]:n?e.dedupeBySelector(t,n):[...new Set(t)]}exports.uniq=uniq;
|
|
2
2
|
//# sourceMappingURL=uniq.cjs.map
|
package/dist/array/uniq.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniq.cjs","names":[],"sources":["../../src/array/uniq.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Creates a new array with duplicate values removed.\n *\n * @example\n * ```ts\n * uniq([1, 2, 2, 3, 3, 3]); // [1, 2, 3]\n * const arrObj = [{ id: 1 }, { id: 2 }, { id: 2 }, { id: 3 }, { id: 3 }, { id: 3 }];\n * uniq(arrObj, item => item.id); // [{ id: 1 }, { id: 2 }, { id: 3 }]\n * ```\n *\n * @param array - The array to process.\n * @param [selector] - Function used to generate comparison values for each item.\n\n * @returns A new duplicate-free array.\n */\nexport function uniq<T>(array: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (array.length <= 1) {\n return [...array];\n }\n\n if (!selector) {\n return [...new Set(array)];\n }\n\n return dedupeBySelector(array, selector);\n}\n"],"mappings":"+CAkBA,SAAgB,
|
|
1
|
+
{"version":3,"file":"uniq.cjs","names":[],"sources":["../../src/array/uniq.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Creates a new array with duplicate values removed.\n *\n * @example\n * ```ts\n * uniq([1, 2, 2, 3, 3, 3]); // [1, 2, 3]\n * const arrObj = [{ id: 1 }, { id: 2 }, { id: 2 }, { id: 3 }, { id: 3 }, { id: 3 }];\n * uniq(arrObj, item => item.id); // [{ id: 1 }, { id: 2 }, { id: 3 }]\n * ```\n *\n * @param array - The array to process.\n * @param [selector] - Function used to generate comparison values for each item.\n\n * @returns A new duplicate-free array.\n */\nexport function uniq<T>(array: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (array.length <= 1) {\n return [...array];\n }\n\n if (!selector) {\n return [...new Set(array)];\n }\n\n return dedupeBySelector(array, selector);\n}\n"],"mappings":"+CAkBA,SAAgB,KAAQ,EAAqB,EAAwC,CASnF,OARI,EAAM,QAAU,EACX,CAAC,GAAG,CAAK,EAGb,EAIE,EAAA,iBAAiB,EAAO,CAAQ,EAH9B,CAAC,GAAG,IAAI,IAAI,CAAK,CAAC,CAI7B"}
|
package/dist/array/uniq.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/array/uniq.ts
|
|
3
|
-
function t(t, n) {
|
|
4
|
-
return t.length <= 1 ? [...t] : n ? e(t, n) : [...new Set(t)];
|
|
5
|
-
}
|
|
6
|
-
//#endregion
|
|
7
|
-
export { t as uniq };
|
|
8
|
-
|
|
1
|
+
import{dedupeBySelector as e}from"../_common/_selectorSet.js";function uniq(t,n){return t.length<=1?[...t]:n?e(t,n):[...new Set(t)]}export{uniq};
|
|
9
2
|
//# sourceMappingURL=uniq.js.map
|
package/dist/array/uniq.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniq.js","names":[],"sources":["../../src/array/uniq.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Creates a new array with duplicate values removed.\n *\n * @example\n * ```ts\n * uniq([1, 2, 2, 3, 3, 3]); // [1, 2, 3]\n * const arrObj = [{ id: 1 }, { id: 2 }, { id: 2 }, { id: 3 }, { id: 3 }, { id: 3 }];\n * uniq(arrObj, item => item.id); // [{ id: 1 }, { id: 2 }, { id: 3 }]\n * ```\n *\n * @param array - The array to process.\n * @param [selector] - Function used to generate comparison values for each item.\n\n * @returns A new duplicate-free array.\n */\nexport function uniq<T>(array: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (array.length <= 1) {\n return [...array];\n }\n\n if (!selector) {\n return [...new Set(array)];\n }\n\n return dedupeBySelector(array, selector);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"uniq.js","names":[],"sources":["../../src/array/uniq.ts"],"sourcesContent":["import { dedupeBySelector } from '../_common/_selectorSet';\nimport type { Primitive } from '../types';\n\n/**\n * Creates a new array with duplicate values removed.\n *\n * @example\n * ```ts\n * uniq([1, 2, 2, 3, 3, 3]); // [1, 2, 3]\n * const arrObj = [{ id: 1 }, { id: 2 }, { id: 2 }, { id: 3 }, { id: 3 }, { id: 3 }];\n * uniq(arrObj, item => item.id); // [{ id: 1 }, { id: 2 }, { id: 3 }]\n * ```\n *\n * @param array - The array to process.\n * @param [selector] - Function used to generate comparison values for each item.\n\n * @returns A new duplicate-free array.\n */\nexport function uniq<T>(array: readonly T[], selector?: (item: T) => Primitive): T[] {\n if (array.length <= 1) {\n return [...array];\n }\n\n if (!selector) {\n return [...new Set(array)];\n }\n\n return dedupeBySelector(array, selector);\n}\n"],"mappings":"8DAkBA,SAAgB,KAAQ,EAAqB,EAAwC,CASnF,OARI,EAAM,QAAU,EACX,CAAC,GAAG,CAAK,EAGb,EAIE,EAAiB,EAAO,CAAQ,EAH9B,CAAC,GAAG,IAAI,IAAI,CAAK,CAAC,CAI7B"}
|
package/dist/array/unzip.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function unzip(e){if(e.length===0)return[];let t=e[0].length,n=Array.from({length:t},()=>[]);for(let r of e)for(let e=0;e<t;e++)n[e].push(r[e]);return n}exports.unzip=unzip;
|
|
2
2
|
//# sourceMappingURL=unzip.cjs.map
|
package/dist/array/unzip.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unzip.cjs","names":[],"sources":["../../src/array/unzip.ts"],"sourcesContent":["/**\n * Transposes an array of tuples into tuple arrays.\n */\nexport function unzip<T extends readonly unknown[]>(rows: readonly T[]): { [K in keyof T]: Array<T[K]> } {\n if (rows.length === 0) return [] as unknown as { [K in keyof T]: Array<T[K]> };\n\n const width = rows[0].length;\n const out = Array.from({ length: width }, () => [] as unknown[]);\n\n for (const row of rows) {\n for (let index = 0; index < width; index++) {\n out[index].push(row[index]);\n }\n }\n\n return out as { [K in keyof T]: Array<T[K]> };\n}\n"],"mappings":"AAGA,SAAgB,
|
|
1
|
+
{"version":3,"file":"unzip.cjs","names":[],"sources":["../../src/array/unzip.ts"],"sourcesContent":["/**\n * Transposes an array of tuples into tuple arrays.\n */\nexport function unzip<T extends readonly unknown[]>(rows: readonly T[]): { [K in keyof T]: Array<T[K]> } {\n if (rows.length === 0) return [] as unknown as { [K in keyof T]: Array<T[K]> };\n\n const width = rows[0].length;\n const out = Array.from({ length: width }, () => [] as unknown[]);\n\n for (const row of rows) {\n for (let index = 0; index < width; index++) {\n out[index].push(row[index]);\n }\n }\n\n return out as { [K in keyof T]: Array<T[K]> };\n}\n"],"mappings":"AAGA,SAAgB,MAAoC,EAAqD,CACvG,GAAI,EAAK,SAAW,EAAG,MAAO,CAAC,EAE/B,IAAM,EAAQ,EAAK,EAAE,CAAC,OAChB,EAAM,MAAM,KAAK,CAAE,OAAQ,CAAM,MAAS,CAAC,CAAc,EAE/D,IAAK,IAAM,KAAO,EAChB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAO,IACjC,EAAI,EAAM,CAAC,KAAK,EAAI,EAAM,EAI9B,OAAO,CACT"}
|
package/dist/array/unzip.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
function e(e) {
|
|
3
|
-
if (e.length === 0) return [];
|
|
4
|
-
let t = e[0].length, n = Array.from({ length: t }, () => []);
|
|
5
|
-
for (let r of e) for (let e = 0; e < t; e++) n[e].push(r[e]);
|
|
6
|
-
return n;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as unzip };
|
|
10
|
-
|
|
1
|
+
function unzip(e){if(e.length===0)return[];let t=e[0].length,n=Array.from({length:t},()=>[]);for(let r of e)for(let e=0;e<t;e++)n[e].push(r[e]);return n}export{unzip};
|
|
11
2
|
//# sourceMappingURL=unzip.js.map
|
package/dist/array/unzip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unzip.js","names":[],"sources":["../../src/array/unzip.ts"],"sourcesContent":["/**\n * Transposes an array of tuples into tuple arrays.\n */\nexport function unzip<T extends readonly unknown[]>(rows: readonly T[]): { [K in keyof T]: Array<T[K]> } {\n if (rows.length === 0) return [] as unknown as { [K in keyof T]: Array<T[K]> };\n\n const width = rows[0].length;\n const out = Array.from({ length: width }, () => [] as unknown[]);\n\n for (const row of rows) {\n for (let index = 0; index < width; index++) {\n out[index].push(row[index]);\n }\n }\n\n return out as { [K in keyof T]: Array<T[K]> };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"unzip.js","names":[],"sources":["../../src/array/unzip.ts"],"sourcesContent":["/**\n * Transposes an array of tuples into tuple arrays.\n */\nexport function unzip<T extends readonly unknown[]>(rows: readonly T[]): { [K in keyof T]: Array<T[K]> } {\n if (rows.length === 0) return [] as unknown as { [K in keyof T]: Array<T[K]> };\n\n const width = rows[0].length;\n const out = Array.from({ length: width }, () => [] as unknown[]);\n\n for (const row of rows) {\n for (let index = 0; index < width; index++) {\n out[index].push(row[index]);\n }\n }\n\n return out as { [K in keyof T]: Array<T[K]> };\n}\n"],"mappings":"AAGA,SAAgB,MAAoC,EAAqD,CACvG,GAAI,EAAK,SAAW,EAAG,MAAO,CAAC,EAE/B,IAAM,EAAQ,EAAK,EAAE,CAAC,OAChB,EAAM,MAAM,KAAK,CAAE,OAAQ,CAAM,MAAS,CAAC,CAAc,EAE/D,IAAK,IAAM,KAAO,EAChB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAO,IACjC,EAAI,EAAM,CAAC,KAAK,EAAI,EAAM,EAI9B,OAAO,CACT"}
|
package/dist/array/zip.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function zip(...e){if(e.length===0)return[];let t=Math.max(...e.map(e=>e.length)),n=Array(t);for(let r=0;r<t;r++)n[r]=e.map(e=>e[r]);return n}exports.zip=zip;
|
|
2
2
|
//# sourceMappingURL=zip.cjs.map
|
package/dist/array/zip.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zip.cjs","names":[],"sources":["../../src/array/zip.ts"],"sourcesContent":["/**\n * Zips multiple arrays by index.\n */\nexport function zip<T extends readonly (readonly unknown[])[]>(\n ...arrays: T\n): Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }> {\n if (arrays.length === 0) return [];\n\n const length = Math.max(...arrays.map((arr) => arr.length));\n const out = new Array(length);\n\n for (let index = 0; index < length; index++) {\n out[index] = arrays.map((array) => array[index]);\n }\n\n return out as Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }>;\n}\n"],"mappings":"AAGA,SAAgB,
|
|
1
|
+
{"version":3,"file":"zip.cjs","names":[],"sources":["../../src/array/zip.ts"],"sourcesContent":["/**\n * Zips multiple arrays by index.\n */\nexport function zip<T extends readonly (readonly unknown[])[]>(\n ...arrays: T\n): Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }> {\n if (arrays.length === 0) return [];\n\n const length = Math.max(...arrays.map((arr) => arr.length));\n const out = new Array(length);\n\n for (let index = 0; index < length; index++) {\n out[index] = arrays.map((array) => array[index]);\n }\n\n return out as Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }>;\n}\n"],"mappings":"AAGA,SAAgB,IACd,GAAG,EACmF,CACtF,GAAI,EAAO,SAAW,EAAG,MAAO,CAAC,EAEjC,IAAM,EAAS,KAAK,IAAI,GAAG,EAAO,IAAK,GAAQ,EAAI,MAAM,CAAC,EACpD,EAAU,MAAM,CAAM,EAE5B,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAQ,IAClC,EAAI,GAAS,EAAO,IAAK,GAAU,EAAM,EAAM,EAGjD,OAAO,CACT"}
|
package/dist/array/zip.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
function e(...e) {
|
|
3
|
-
if (e.length === 0) return [];
|
|
4
|
-
let t = Math.max(...e.map((e) => e.length)), n = Array(t);
|
|
5
|
-
for (let r = 0; r < t; r++) n[r] = e.map((e) => e[r]);
|
|
6
|
-
return n;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { e as zip };
|
|
10
|
-
|
|
1
|
+
function zip(...e){if(e.length===0)return[];let t=Math.max(...e.map(e=>e.length)),n=Array(t);for(let r=0;r<t;r++)n[r]=e.map(e=>e[r]);return n}export{zip};
|
|
11
2
|
//# sourceMappingURL=zip.js.map
|
package/dist/array/zip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zip.js","names":[],"sources":["../../src/array/zip.ts"],"sourcesContent":["/**\n * Zips multiple arrays by index.\n */\nexport function zip<T extends readonly (readonly unknown[])[]>(\n ...arrays: T\n): Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }> {\n if (arrays.length === 0) return [];\n\n const length = Math.max(...arrays.map((arr) => arr.length));\n const out = new Array(length);\n\n for (let index = 0; index < length; index++) {\n out[index] = arrays.map((array) => array[index]);\n }\n\n return out as Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }>;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"zip.js","names":[],"sources":["../../src/array/zip.ts"],"sourcesContent":["/**\n * Zips multiple arrays by index.\n */\nexport function zip<T extends readonly (readonly unknown[])[]>(\n ...arrays: T\n): Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }> {\n if (arrays.length === 0) return [];\n\n const length = Math.max(...arrays.map((arr) => arr.length));\n const out = new Array(length);\n\n for (let index = 0; index < length; index++) {\n out[index] = arrays.map((array) => array[index]);\n }\n\n return out as Array<{ [K in keyof T]: T[K] extends readonly (infer U)[] ? U | undefined : never }>;\n}\n"],"mappings":"AAGA,SAAgB,IACd,GAAG,EACmF,CACtF,GAAI,EAAO,SAAW,EAAG,MAAO,CAAC,EAEjC,IAAM,EAAS,KAAK,IAAI,GAAG,EAAO,IAAK,GAAQ,EAAI,MAAM,CAAC,EACpD,EAAU,MAAM,CAAM,EAE5B,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAQ,IAClC,EAAI,GAAS,EAAO,IAAK,GAAU,EAAM,EAAM,EAGjD,OAAO,CACT"}
|
package/dist/arsenal.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,t=2){if(!Array.isArray(e)&&typeof e!=`string`)throw TypeError(`chunk: argument must be an array or string`);if(!Number.isInteger(t)||t<1)throw RangeError(`chunk: size must be a positive integer`);return Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,r*t+t))}function t(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);i!==void 0&&n.push(i)}return n}var n=new Set([`__proto__`,`constructor`,`prototype`]);function r(e){return typeof e==`string`&&n.has(e)}function i(e,t){let n={};for(let i of e){let e=t(i),a=e==null?`_`:String(e);r(a)||(n[a]||(n[a]=[]),n[a].push(i))}return n}function a(e,t){let n={};for(let i of e){let e=String(t(i));r(e)||(n[e]=i)}return n}function o(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)t(e[i],i,e)?n.push(e[i]):r.push(e[i]);return[n,r]}var s=(e,t)=>{if(e===t)return 0;if(e===void 0)return 1;if(t===void 0)return-1;if(e===null)return t===null?0:-1;if(t===null)return 1;if(typeof e==`string`&&typeof t==`string`)return e.localeCompare(t);if(typeof e==`number`&&typeof t==`number`)return e===t?0:e>t?1:-1;if(e instanceof Date&&t instanceof Date){let n=e.getTime(),r=t.getTime();return n===r?0:n>r?1:-1}throw TypeError(`compare: unsupported types "${typeof e}" and "${typeof t}". Supported: number, string, Date, null, undefined.`)},c=e=>{let t=Object.entries(e);return(e,n)=>{for(let[r,i]of t){let t=e[r],a=n[r],o=i===`desc`?-1:1,c=s(t,a);if(c!==0)return c*o}return 0}};function l(e,t,n=`asc`){if(!Array.isArray(e))throw TypeError(`sort: first argument must be an array`);if(typeof t==`function`){let r=n===`desc`?-1:1;return[...e].sort((e,n)=>s(t(e),t(n))*r)}return[...e].sort(c(t))}function u(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}function d(e,t){return e.length<=1?[...e]:t?u(e,t):[...new Set(e)]}function f(e,t=`Aborted`){return e?.reason??new DOMException(t,`AbortError`)}function p(e,t){return t.aborted?Promise.reject(f(t)):new Promise((n,r)=>{let i=()=>r(f(t));t.addEventListener(`abort`,i,{once:!0}),e.then(e=>n(e)).catch(e=>r(e)).finally(()=>t.removeEventListener(`abort`,i))})}function m(e){return e.ok===!0}function h(e){return e.ok===!1}async function g(e){try{return{ok:!0,value:await e()}}catch(e){return{error:e,ok:!1}}}function _(e,t=3e4){return Math.min(1e3*2**Math.max(0,Number.isNaN(e)?0:Math.floor(e)),t)}async function v(e,t,n={}){let{abortOnError:r=!1,limit:i=1/0,signal:a}=n;if(i<1)throw RangeError(`parallel: limit must be at least 1, got ${i}`);if(a?.aborted)throw f(a);if(e.length===0)return[];let o=Array(e.length),s=0,c=r?new AbortController:void 0,l=async()=>{for(;;){if(a?.aborted)throw f(a);if(c?.signal.aborted||s>=e.length)return;let n=s++;try{o[n]=await t(e[n],n,e)}catch(e){throw c?.abort(),e}}},u=Math.min(i,e.length),d=Array.from({length:u},()=>l());return await Promise.all(d),o}async function y(e,t){return t?t.aborted?Promise.reject(f(t)):new Promise((n,r)=>{let i=setTimeout(()=>{t.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),t.removeEventListener(`abort`,a),r(f(t))};t.addEventListener(`abort`,a)}):new Promise(t=>setTimeout(t,e))}function b(e,t){let n=[e===void 0?void 0:AbortSignal.timeout(e),t].filter(e=>e!=null);if(n.length!==0)return n.length===1?n[0]:AbortSignal.any(n)}async function x(e,{delay:t=250,onError:n,shouldRetry:r,signal:i,timeout:a,times:o=3}={}){if(!Number.isInteger(o)||o<1)throw RangeError(`retry: times must be a positive integer, got ${o}`);for(let s=1;s<=o;s++){if(i?.aborted)throw f(i);let c=b(a,i);try{return await e(c)}catch(e){if(s===o||r&&!r(e,s-1))throw n?.(e),e;let a=typeof t==`function`?t(s-1):t;a>0&&await y(a,i)}}}var S=class extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}},C=class extends S{};function w(e,t=300,n={leading:!1,trailing:!0}){let r=n.leading??!1,i=n.trailing??!0,a,o,s,c=!1,l=()=>{a!==void 0&&(clearTimeout(a),a=void 0)},u=()=>{if(l(),c=!1,!o)return;let t=o;return o=void 0,s=e(...t),s};return Object.assign((...n)=>(o=n,r&&!c&&(c=!0,s=e(...n),o=void 0,!i)?(a=setTimeout(()=>{a=void 0,c=!1},t),s):r&&!i&&c?s:(l(),a=setTimeout(u,t),s)),{cancel:()=>{l(),o=void 0,c=!1},flush:()=>u(),pending:()=>a!==void 0})}var T=e=>{let t,n=!1,r=((...r)=>(n||=(t=e(...r),!0),t));return r.reset=()=>{t=void 0,n=!1},r};function E(...e){if(e.length===0)return e=>e;let[t,...n]=e;return(...e)=>n.reduce((e,t)=>t(e),t(...e))}function D(e,t=700,n={leading:!0,trailing:!1}){let r=n.leading??!0,i=n.trailing??!1,a,o=-1/0,s,c,l=()=>{a!==void 0&&(clearTimeout(a),a=void 0)},u=e=>{a=setTimeout(p,e)},d=t=>{if(o=t,l(),!s)return;let n=s;return s=void 0,c=e(...n),c},f=e=>t-(e-o),p=()=>{let e=Date.now();s&&f(e)<=0?d(e):s?u(f(e)):l()};return Object.assign((...e)=>{let t=Date.now();o===-1/0&&!r&&(o=t),s=e;let n=f(t);return n<=0?d(t):(i&&!a&&u(n),c)},{cancel:()=>{l(),s=void 0,o=-1/0},flush:()=>{if(s)return d(Date.now())},pending:()=>s!==void 0||a!==void 0})}function O(...e){return t=>e.every(e=>e(t))}function k(...e){return t=>e.some(e=>e(t))}function A(...e){return t=>e.every(e=>!e(t))}function j(e){return t=>!e(t)}function M(e){return e!==void 0}function N(e,t){return P(e,t,new WeakMap)}function P(e,t,n){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||typeof t!=`object`)return!1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,r)=>P(e,t[r],n));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,i]of e)if(!t.has(r)||!P(i,t.get(r),n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;let r=[...t];for(let i of e)if(typeof i==`string`||typeof i==`number`||typeof i==`boolean`||i==null){if(!t.has(i))return!1}else if(!r.some(e=>P(i,e,n)))return!1;return!0}if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.source===t.source&&e.flags===t.flags;if(e instanceof Map||t instanceof Map||e instanceof Set||t instanceof Set)return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let i of r)if(!Object.hasOwn(t,i)||!P(e[i],t[i],n))return!1;return!0}function F(e){return e==null}function I(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function L(e,t){if(typeof t==`number`&&(!Number.isInteger(t)||t<1))throw RangeError(`allocate: parts must be a positive integer, got ${t}`);let n=Array.isArray(t)?t:Array(t).fill(1);if(n.length===0)throw RangeError(`Ratios array cannot be empty`);if(n.some(e=>e<0))throw RangeError(`Ratios must be non-negative`);let r=n.reduce((e,t)=>e+t,0);if(r===0)throw RangeError(`Total ratio cannot be zero`);if(typeof e==`bigint`){let t=BigInt(r),i=Array.from({length:n.length-1},(r,i)=>e*BigInt(n[i])/t);return i.push(e-i.reduce((e,t)=>e+t,0n)),i}let i=Array.from({length:n.length-1},(t,i)=>Math.floor(e*n[i]/r));return i.push(e-i.reduce((e,t)=>e+t,0)),i}function ee(e,t,n){return t!=null&&e<t?t:n!=null&&e>n?n:e}function R(e,t,n){let[r,i,a]=t===void 0?[0,e,1]:n===void 0?[e,t,1]:[e,t,n];if(!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))throw RangeError(`range: start, stop, and step must be finite numbers`);if(a===0)throw RangeError(`range: step cannot be 0`);if(r===i)return[];let o=(i-r)/a,s=Math.max(0,Number.isInteger(o)?o:Math.ceil(o+2**-52));if(s>1e7)throw RangeError(`range: exceeds maximum allowed size of 10,000,000`);return Array.from({length:s},(e,t)=>r+t*a)}function z(e){return e.replace(/\[(\d+)\]/g,`.$1`).replace(/^\.|\.$/g,``).split(`.`).filter(Boolean)}function B(e,t){let r=e;for(let e of z(t))if(n.has(e)||typeof r!=`object`||!r||(r=r[e],r===void 0))return;return r}function V(e,t){return B(e,t)}function H(e,t,n){let r=B(e,t);return r===void 0?n:r}function U(e,t){let n=B(e,t);if(n===void 0)throw TypeError(`Path does not exist: '${t}'`);return n}function W(e,t,n){if(e===void 0)return`undefined`;if(e===null)return`null`;if(typeof e==`bigint`)return`${e}n`;if(typeof e!=`object`)return JSON.stringify(e);if(n.has(e))return`[Circular]`;if(n.add(e),e instanceof Date)return`[Date:${Number.isNaN(e.getTime())?`Invalid`:e.toISOString()}]`;if(e instanceof RegExp)return`[RegExp:${e.source}/${e.flags}]`;if(e instanceof Set)return`[Set:${[...e].map(e=>W(e,t,n)).sort().join(`,`)}]`;if(e instanceof Map)return`[Map:${[...e.entries()].map(([e,r])=>[W(e,t,n),W(r,t,n)]).sort(([e,t],[n,r])=>e===n?t.localeCompare(r):e.localeCompare(n)).map(([e,t])=>`${e}=>${t}`).join(`,`)}]`;if(Array.isArray(e))return`[${e.map(e=>W(e,t,n)).join(`,`)}]`;let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null){if(t?.onClassInstance===`throw`)throw new C(`hash: unsupported type ${e.constructor?.name??`unknown`}`);return String(e)}let i=e;return`{${Object.keys(i).filter(e=>i[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${W(i[e],t,n)}`).join(`,`)}}`}function G(e,t){return W(e,t,new Set)}function K(e,t){let n=new Set(t),i={};for(let t of Object.keys(e))r(t)||n.has(t)||(i[t]=e[t]);return i}function q(e,t){let n={};for(let i of t)r(i)||Object.hasOwn(e,i)&&(n[i]=e[i]);return n}function J(e){let t=e?.next()??crypto.getRandomValues(new Uint32Array(1))[0]/4294967296;if(!Number.isFinite(t)||t<0||t>=1)throw RangeError(`random source must return a finite number in [0, 1)`);return t}function Y(e,t){return Math.floor(J(t)*e)}function X(e,t,n){if(e>t)throw RangeError(`random: minimum value must not be greater than maximum value`);return Y(t-e+1,n)+e}var Z=/(\p{Ll})(\p{Lu}|\p{N})|(\p{Lu}|\p{N})(\p{Lu}\p{Ll})|(\p{N})(\p{L})/gu;function Q(e){return e.replace(/[.*+?^${}()|[\]\\/-]/g,`\\$&`)}function $(e,t=` `){let n=Q(t);return e.trim().replace(Z,`$1$3$5${t}$2$4$6`).replace(/[^\p{L}\p{N}]+/gu,t).replace(RegExp(`^(?:${n})+|(?:${n})+$`,`g`),``)}function te(e){return $(e,` `).replace(/[^\p{L}\p{N}]+(.)/gu,(e,t)=>t.toUpperCase()).replace(/^./,e=>e.toLowerCase())}exports.ArsenalError=S,exports.ArsenalSerializationError=C,exports.abortError=f,exports.abortable=p,exports.allOf=O,exports.allocate=L,exports.anyOf=k,exports.attempt=g,exports.backoff=_,exports.camelCase=te,exports.chunk=e,exports.clamp=ee,exports.debounce=w,exports.filterMap=t,exports.getPath=V,exports.getPathOr=H,exports.groupBy=i,exports.hash=G,exports.indexBy=a,exports.isDefined=M,exports.isEqual=N,exports.isFail=h,exports.isNil=F,exports.isOk=m,exports.isPlainObject=I,exports.noneOf=A,exports.not=j,exports.omit=K,exports.once=T,exports.parallel=v,exports.partition=o,exports.pick=q,exports.pipe=E,exports.random=X,exports.randomFloat=J,exports.range=R,exports.requirePath=U,exports.retry=x,exports.sleep=y,exports.sort=l,exports.throttle=D,exports.uniq=d;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function chunk(e,t=2){if(!Array.isArray(e)&&typeof e!=`string`)throw TypeError(`chunk: argument must be an array or string`);if(!Number.isInteger(t)||t<1)throw RangeError(`chunk: size must be a positive integer`);return Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,r*t+t))}function filterMap(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);i!==void 0&&n.push(i)}return n}var e=new Set([`__proto__`,`constructor`,`prototype`]);function isUnsafeKey(t){return typeof t==`string`&&e.has(t)}function groupBy(e,t){let n={};for(let r of e){let e=t(r),i=e==null?`_`:String(e);isUnsafeKey(i)||(n[i]||(n[i]=[]),n[i].push(r))}return n}function indexBy(e,t){let n={};for(let r of e){let e=String(t(r));isUnsafeKey(e)||(n[e]=r)}return n}function partition(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)t(e[i],i,e)?n.push(e[i]):r.push(e[i]);return[n,r]}var compare=(e,t)=>{if(e===t)return 0;if(e===void 0)return 1;if(t===void 0)return-1;if(e===null)return t===null?0:-1;if(t===null)return 1;if(typeof e==`string`&&typeof t==`string`)return e.localeCompare(t);if(typeof e==`number`&&typeof t==`number`)return e===t?0:e>t?1:-1;if(e instanceof Date&&t instanceof Date){let n=e.getTime(),r=t.getTime();return n===r?0:n>r?1:-1}throw TypeError(`compare: unsupported types "${typeof e}" and "${typeof t}". Supported: number, string, Date, null, undefined.`)},compareBy=e=>{let t=Object.entries(e);return(e,n)=>{for(let[r,i]of t){let t=e[r],a=n[r],o=i===`desc`?-1:1,s=compare(t,a);if(s!==0)return s*o}return 0}};function sort(e,t,n=`asc`){if(!Array.isArray(e))throw TypeError(`sort: first argument must be an array`);if(typeof t==`function`){let r=n===`desc`?-1:1;return[...e].sort((e,n)=>compare(t(e),t(n))*r)}return[...e].sort(compareBy(t))}function dedupeBySelector(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}function uniq(e,t){return e.length<=1?[...e]:t?dedupeBySelector(e,t):[...new Set(e)]}function abortError(e,t=`Aborted`){return e?.reason??new DOMException(t,`AbortError`)}function abortable(e,t){return t.aborted?Promise.reject(abortError(t)):new Promise((n,r)=>{let onAbort=()=>r(abortError(t));t.addEventListener(`abort`,onAbort,{once:!0}),e.then(e=>n(e)).catch(e=>r(e)).finally(()=>t.removeEventListener(`abort`,onAbort))})}function isOk(e){return e.ok===!0}function isFail(e){return e.ok===!1}async function attempt(e){try{return{ok:!0,value:await e()}}catch(e){return{error:e,ok:!1}}}function backoff(e,t=3e4){return Math.min(1e3*2**Math.max(0,Number.isNaN(e)?0:Math.floor(e)),t)}async function parallel(e,t,n={}){let{abortOnError:r=!1,limit:i=1/0,signal:a}=n;if(i<1)throw RangeError(`parallel: limit must be at least 1, got ${i}`);if(a?.aborted)throw abortError(a);if(e.length===0)return[];let o=Array(e.length),s=0,c=r?new AbortController:void 0,worker=async()=>{for(;;){if(a?.aborted)throw abortError(a);if(c?.signal.aborted||s>=e.length)return;let n=s++;try{o[n]=await t(e[n],n,e)}catch(e){throw c?.abort(),e}}},l=Math.min(i,e.length),u=Array.from({length:l},()=>worker());return await Promise.all(u),o}async function sleep(e,t){return t?t.aborted?Promise.reject(abortError(t)):new Promise((n,r)=>{let i=setTimeout(()=>{t.removeEventListener(`abort`,onAbort),n()},e),onAbort=()=>{clearTimeout(i),t.removeEventListener(`abort`,onAbort),r(abortError(t))};t.addEventListener(`abort`,onAbort)}):new Promise(t=>setTimeout(t,e))}function buildSignal(e,t){let n=[e===void 0?void 0:AbortSignal.timeout(e),t].filter(e=>e!=null);if(n.length!==0)return n.length===1?n[0]:AbortSignal.any(n)}async function retry(e,{delay:t=250,shouldRetry:n,signal:r,timeout:i,times:a=3}={}){if(!Number.isInteger(a)||a<1)throw RangeError(`retry: times must be a positive integer, got ${a}`);for(let o=1;o<=a;o++){if(r?.aborted)throw abortError(r);let s=buildSignal(i,r);try{return await e(s)}catch(e){if(o===a||n&&!n(e,o-1))throw e;let i=typeof t==`function`?t(o-1):t;i>0&&await sleep(i,r)}}}function taskPool({concurrency:e=1}={}){if(!Number.isInteger(e)||e<1)throw RangeError(`taskPool: concurrency must be a positive integer`);let t=new AbortController,n=[],r=0,i=!1,a,resolveIdle=()=>{r===0&&n.length===0&&(a?.resolve(),a=void 0)},start=()=>{for(;r<e&&n.length>0;){let e=n.shift();r++,Promise.resolve().then(()=>e.run(t.signal)).then(e.resolve,e.reject).finally(()=>{r--,start(),resolveIdle()})}};return{get active(){return r},get disposalSignal(){return t.signal},dispose:(e=new DOMException(`Task pool disposed`,`AbortError`))=>{if(!i){i=!0,t.abort(e);for(let t of n.splice(0))t.reject(e);resolveIdle()}},get disposed(){return i},idle:()=>r===0&&n.length===0?Promise.resolve():(a??=Promise.withResolvers(),a.promise),get pending(){return n.length},run:e=>{let r=Promise.withResolvers();return i?(r.reject(t.signal.reason),r.promise):(n.push({reject:r.reject,resolve:r.resolve,run:e}),start(),r.promise)},[Symbol.dispose](){this.dispose()}}}async function waitFor(e,{interval:t=100,signal:n,timeout:r=5e3}={}){let i=AbortSignal.timeout(r),a=n?AbortSignal.any([n,i]):i;for(a.throwIfAborted();;){if(a.throwIfAborted(),await e(a))return;await sleep(t,a)}}function cache({capacity:e=1/0,now:t=Date.now,ttlMs:n}={}){if(e!==1/0&&(!Number.isInteger(e)||e<1))throw RangeError(`cache: capacity must be a positive integer or Infinity, got ${e}`);let r=new Map,i=new Map,a=new Map,o=0,advanceRevision=e=>{let t=(a.get(e)??0)+1;return a.set(e,t),t},expiresAt=e=>{if(e!==void 0&&e!==1/0){if(!Number.isFinite(e)||e<0)throw RangeError(`cache: ttlMs must be a non-negative finite number or Infinity, got ${e}`);return t()+e}},read=e=>{let n=r.get(e);if(n){if(n.expiresAt!==void 0&&n.expiresAt<=t()){r.delete(e);return}return n.value}},trim=()=>{for(let[e,n]of r)n.expiresAt!==void 0&&n.expiresAt<=t()&&r.delete(e);for(;r.size>e;){let e=r.keys().next().value;if(e===void 0)return;r.delete(e)}},set=(e,t,i={})=>{advanceRevision(e),r.delete(e),r.set(e,{expiresAt:expiresAt(i.ttlMs??n),value:t}),trim()},getOrLoad=(e,t)=>{let n=read(e);if(n!==void 0||r.has(e))return Promise.resolve(n);let s=i.get(e);if(s)return s;let c=o,l=advanceRevision(e),u=t().then(t=>(i.get(e)===u&&i.delete(e),o===c&&a.get(e)===l&&set(e,t),t),t=>{throw i.get(e)===u&&i.delete(e),t});return i.set(e,u),u};return{clear:()=>{o++,r.clear(),i.clear(),a.clear()},delete:e=>(i.delete(e),advanceRevision(e),r.delete(e)),entries:()=>(trim(),[...r].map(([e,t])=>[e,t.value])),get:read,getOrLoad,set,get size(){return r.size}}}var LruMap=class extends Map{maxSize;constructor(e){super(),this.maxSize=e}set(e,t){return this.has(e)&&this.delete(e),super.set(e,t),this.size>this.maxSize&&this.evictOldest(),this}evictOldest(e=()=>!0){for(let[t,n]of this)if(e(t,n))return this.delete(t),!0;return!1}},ArsenalError=class extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}},ArsenalSerializationError=class extends ArsenalError{},t=`\0undefined\0`,n=`\0NaN\0`,r=`\0+Infinity\0`,i=`\0-Infinity\0`,a=`\0function\0`,o=0,s=new WeakMap;function idForFunction(e){let t=s.get(e);return t===void 0&&(t=o++,s.set(e,t)),t}var defaultKey=e=>{try{return JSON.stringify(e,(e,o)=>o===void 0?t:typeof o==`number`&&Number.isNaN(o)?n:o===1/0?r:o===-1/0?i:typeof o==`function`?`${a}${idForFunction(o)}`:o)}catch(e){throw new ArsenalSerializationError(`[arsenal/memo] Failed to serialize memo arguments. Provide options.key for non-serializable arguments.${e instanceof Error&&e.message?` Reason: ${e.message}`:``}`,{cause:e})}};function memo(e,{key:t,maxSize:n=1/0}={}){if(n!==1/0&&(!Number.isInteger(n)||n<1))throw RangeError(`memo: maxSize must be a positive integer or Infinity, got ${n}`);let r=new LruMap(n),resolveKey=(...e)=>t?t(...e):defaultKey(e),memoized=(...t)=>{let n=resolveKey(...t);if(r.has(n)){let e=r.get(n);return r.set(n,e),e}let i=e(...t);return r.set(n,i),i},i=Object.assign(memoized,{clear:()=>r.clear(),invalidate:(...e)=>{r.delete(resolveKey(...e))}});return Object.defineProperty(i,"size",{get:()=>r.size}),i}var c=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,l=new Map([...c].map((e,t)=>[e,t]));function bytesToBase64Url(e){let t=``;for(let n=0;n<e.length;n+=3){let r=e[n],i=e[n+1],a=e[n+2];t+=c[r>>2],t+=c[(r&3)<<4|(i??0)>>4],i!==void 0&&(t+=c[(i&15)<<2|(a??0)>>6]),a!==void 0&&(t+=c[a&63])}return t}function base64UrlToBytes(e){let t=[],n=0,r=0;for(let i of e){let e=l.get(i);if(e===void 0)throw Error(`Invalid base64url character "${i}"`);n=n<<6|e,r+=6,r>=8&&(r-=8,t.push(n>>r&255))}return new Uint8Array(t)}var u=new TextEncoder,d=new TextDecoder;function textToBase64Url(e){return bytesToBase64Url(u.encode(e))}function base64UrlToText(e){return d.decode(base64UrlToBytes(e))}function utf8Bytes(e){return u.encode(e).length}function debounce(e,t=300,n={leading:!1,trailing:!0}){let r=n.leading??!1,i=n.trailing??!0,a,o,s,c=!1,clearTimer=()=>{a!==void 0&&(clearTimeout(a),a=void 0)},invokeTrailing=()=>{if(clearTimer(),c=!1,!o)return;let t=o;return o=void 0,s=e(...t),s};return Object.assign((...n)=>(o=n,r&&!c&&(c=!0,s=e(...n),o=void 0,!i)?(a=setTimeout(()=>{a=void 0,c=!1},t),s):r&&!i&&c?s:(clearTimer(),a=setTimeout(invokeTrailing,t),s)),{cancel:()=>{clearTimer(),o=void 0,c=!1},flush:()=>invokeTrailing(),pending:()=>a!==void 0})}var once=e=>{let t,n=!1,wrappedFn=((...r)=>(n||=(t=e(...r),!0),t));return wrappedFn.reset=()=>{t=void 0,n=!1},wrappedFn};function pipe(...e){if(e.length===0)return e=>e;let[t,...n]=e;return(...e)=>n.reduce((e,t)=>t(e),t(...e))}var noop=()=>{};function tapper(){let e=new Set;return{clear(){e.clear()},emit(t){if(e.size!==0)for(let n of[...e])try{n(t)}catch{}},get size(){return e.size},tap(t,n){let r=n?.signal;if(r?.aborted)return noop;e.add(t);let detach=()=>{e.delete(t),r?.removeEventListener(`abort`,detach)};return r?.addEventListener(`abort`,detach,{once:!0}),detach}}}function throttle(e,t=700,n={leading:!0,trailing:!1}){let r=n.leading??!0,i=n.trailing??!1,a,o=-1/0,s,c,clearTimer=()=>{a!==void 0&&(clearTimeout(a),a=void 0)},scheduleTimer=e=>{a=setTimeout(timerExpired,e)},invoke=t=>{if(o=t,clearTimer(),!s)return;let n=s;return s=void 0,c=e(...n),c},remaining=e=>t-(e-o),timerExpired=()=>{let e=Date.now();s&&remaining(e)<=0?invoke(e):s?scheduleTimer(remaining(e)):clearTimer()};return Object.assign((...e)=>{let t=Date.now();o===-1/0&&!r&&(o=t),s=e;let n=remaining(t);return n<=0?invoke(t):(i&&!a&&scheduleTimer(n),c)},{cancel:()=>{clearTimer(),s=void 0,o=-1/0},flush:()=>{if(s)return invoke(Date.now())},pending:()=>s!==void 0||a!==void 0})}function allOf(...e){return t=>e.every(e=>e(t))}function anyOf(...e){return t=>e.some(e=>e(t))}function noneOf(...e){return t=>e.every(e=>!e(t))}function not(e){return t=>!e(t)}function isDefined(e){return e!==void 0}function isEqual(e,t){return safeIsEqual(e,t,new WeakMap)}function safeIsEqual(e,t,n){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||typeof t!=`object`)return!1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,r)=>safeIsEqual(e,t[r],n));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,i]of e)if(!t.has(r)||!safeIsEqual(i,t.get(r),n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;let r=[...t];for(let i of e)if(typeof i==`string`||typeof i==`number`||typeof i==`boolean`||i==null){if(!t.has(i))return!1}else if(!r.some(e=>safeIsEqual(i,e,n)))return!1;return!0}if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.source===t.source&&e.flags===t.flags;if(e instanceof Map||t instanceof Map||e instanceof Set||t instanceof Set)return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let i of r)if(!Object.hasOwn(t,i)||!safeIsEqual(e[i],t[i],n))return!1;return!0}function isNil(e){return e==null}function isPlainObject(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function allocate(e,t){if(typeof t==`number`&&(!Number.isInteger(t)||t<1))throw RangeError(`allocate: parts must be a positive integer, got ${t}`);let n=Array.isArray(t)?t:Array(t).fill(1);if(n.length===0)throw RangeError(`Ratios array cannot be empty`);if(n.some(e=>e<0))throw RangeError(`Ratios must be non-negative`);let r=n.reduce((e,t)=>e+t,0);if(r===0)throw RangeError(`Total ratio cannot be zero`);if(typeof e==`bigint`){let t=BigInt(r),i=Array.from({length:n.length-1},(r,i)=>e*BigInt(n[i])/t);return i.push(e-i.reduce((e,t)=>e+t,0n)),i}let i=Array.from({length:n.length-1},(t,i)=>Math.floor(e*n[i]/r));return i.push(e-i.reduce((e,t)=>e+t,0)),i}function clamp(e,t,n){return t!=null&&e<t?t:n!=null&&e>n?n:e}function range(e,t,n){let[r,i,a]=t===void 0?[0,e,1]:n===void 0?[e,t,1]:[e,t,n];if(!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))throw RangeError(`range: start, stop, and step must be finite numbers`);if(a===0)throw RangeError(`range: step cannot be 0`);if(r===i)return[];let o=(i-r)/a,s=Math.max(0,Number.isInteger(o)?o:Math.ceil(o+2**-52));if(s>1e7)throw RangeError(`range: exceeds maximum allowed size of 10,000,000`);return Array.from({length:s},(e,t)=>r+t*a)}function pathSegments(e){return e.replace(/\[(\d+)\]/g,`.$1`).replace(/^\.|\.$/g,``).split(`.`).filter(Boolean)}function readPath(t,n){let r=t;for(let t of pathSegments(n))if(e.has(t)||typeof r!=`object`||!r||(r=r[t],r===void 0))return;return r}function getPath(e,t){return readPath(e,t)}function getPathOr(e,t,n){let r=readPath(e,t);return r===void 0?n:r}function requirePath(e,t){let n=readPath(e,t);if(n===void 0)throw TypeError(`Path does not exist: '${t}'`);return n}function _hash(e,t,n){if(e===void 0)return`undefined`;if(e===null)return`null`;if(typeof e==`bigint`)return`${e}n`;if(typeof e!=`object`)return JSON.stringify(e);if(n.has(e))return`[Circular]`;if(n.add(e),e instanceof Date)return`[Date:${Number.isNaN(e.getTime())?`Invalid`:e.toISOString()}]`;if(e instanceof RegExp)return`[RegExp:${e.source}/${e.flags}]`;if(e instanceof Set)return`[Set:${[...e].map(e=>_hash(e,t,n)).sort().join(`,`)}]`;if(e instanceof Map)return`[Map:${[...e.entries()].map(([e,r])=>[_hash(e,t,n),_hash(r,t,n)]).sort(([e,t],[n,r])=>e===n?t.localeCompare(r):e.localeCompare(n)).map(([e,t])=>`${e}=>${t}`).join(`,`)}]`;if(Array.isArray(e))return`[${e.map(e=>_hash(e,t,n)).join(`,`)}]`;let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null){if(t?.onClassInstance===`throw`)throw new ArsenalSerializationError(`hash: unsupported type ${e.constructor?.name??`unknown`}`);return String(e)}let i=e;return`{${Object.keys(i).filter(e=>i[e]!==void 0).sort().map(e=>`${JSON.stringify(e)}:${_hash(i[e],t,n)}`).join(`,`)}}`}function hash(e,t){return _hash(e,t,new Set)}function omit(e,t){let n=new Set(t),r={};for(let t of Object.keys(e))isUnsafeKey(t)||n.has(t)||(r[t]=e[t]);return r}function pick(e,t){let n={};for(let r of t)isUnsafeKey(r)||Object.hasOwn(e,r)&&(n[r]=e[r]);return n}function randomFloat(e){let t=e?.next()??crypto.getRandomValues(new Uint32Array(1))[0]/4294967296;if(!Number.isFinite(t)||t<0||t>=1)throw RangeError(`random source must return a finite number in [0, 1)`);return t}function randomIndex(e,t){return Math.floor(randomFloat(t)*e)}function random(e,t,n){if(e>t)throw RangeError(`random: minimum value must not be greater than maximum value`);return randomIndex(t-e+1,n)+e}var f=/(\p{Ll})(\p{Lu}|\p{N})|(\p{Lu}|\p{N})(\p{Lu}\p{Ll})|(\p{N})(\p{L})/gu;function escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\/-]/g,`\\$&`)}function normalizeCase(e,t=` `){let n=escapeRegex(t);return e.trim().replace(f,`$1$3$5${t}$2$4$6`).replace(/[^\p{L}\p{N}]+/gu,t).replace(RegExp(`^(?:${n})+|(?:${n})+$`,`g`),``)}function camelCase(e){return normalizeCase(e,` `).replace(/[^\p{L}\p{N}]+(.)/gu,(e,t)=>t.toUpperCase()).replace(/^./,e=>e.toLowerCase())}exports.ArsenalError=ArsenalError,exports.ArsenalSerializationError=ArsenalSerializationError,exports.abortError=abortError,exports.abortable=abortable,exports.allOf=allOf,exports.allocate=allocate,exports.anyOf=anyOf,exports.attempt=attempt,exports.backoff=backoff,exports.base64UrlToBytes=base64UrlToBytes,exports.base64UrlToText=base64UrlToText,exports.bytesToBase64Url=bytesToBase64Url,exports.cache=cache,exports.camelCase=camelCase,exports.chunk=chunk,exports.clamp=clamp,exports.debounce=debounce,exports.filterMap=filterMap,exports.getPath=getPath,exports.getPathOr=getPathOr,exports.groupBy=groupBy,exports.hash=hash,exports.indexBy=indexBy,exports.isDefined=isDefined,exports.isEqual=isEqual,exports.isFail=isFail,exports.isNil=isNil,exports.isOk=isOk,exports.isPlainObject=isPlainObject,exports.memo=memo,exports.noneOf=noneOf,exports.not=not,exports.omit=omit,exports.once=once,exports.parallel=parallel,exports.partition=partition,exports.pick=pick,exports.pipe=pipe,exports.random=random,exports.randomFloat=randomFloat,exports.range=range,exports.requirePath=requirePath,exports.retry=retry,exports.sleep=sleep,exports.sort=sort,exports.tapper=tapper,exports.taskPool=taskPool,exports.textToBase64Url=textToBase64Url,exports.throttle=throttle,exports.uniq=uniq,exports.utf8Bytes=utf8Bytes,exports.waitFor=waitFor;
|
|
2
2
|
//# sourceMappingURL=arsenal.cjs.map
|