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