es-toolkit 1.13.1 → 1.14.0-dev.399
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/CHANGELOG.md +9 -1
- package/dist/_chunk/index-CwRt_M.js +46 -0
- package/dist/_chunk/initial-BTrQy1.js +514 -0
- package/dist/_chunk/isFunction-Cw_tLG.js +246 -0
- package/dist/_chunk/isTypedArray-BBEkFl.js +43 -0
- package/dist/_chunk/randomInt-CF7bZK.js +19 -0
- package/dist/array/chunk.mjs +15 -8
- package/dist/array/compact.d.mts +1 -1
- package/dist/array/compact.d.ts +1 -1
- package/dist/array/compact.mjs +11 -8
- package/dist/array/countBy.mjs +10 -8
- package/dist/array/difference.mjs +6 -8
- package/dist/array/differenceBy.mjs +8 -8
- package/dist/array/differenceWith.mjs +9 -8
- package/dist/array/drop.mjs +6 -8
- package/dist/array/dropRight.mjs +9 -8
- package/dist/array/dropRightWhile.mjs +10 -8
- package/dist/array/dropWhile.mjs +9 -8
- package/dist/array/fill.d.mts +1 -0
- package/dist/array/fill.d.ts +1 -0
- package/dist/array/fill.mjs +11 -8
- package/dist/array/flatMap.mjs +7 -9
- package/dist/array/flatten.mjs +18 -8
- package/dist/array/flattenDeep.mjs +7 -9
- package/dist/array/forEachRight.mjs +8 -8
- package/dist/array/groupBy.mjs +13 -8
- package/dist/array/head.d.mts +1 -0
- package/dist/array/head.d.ts +1 -0
- package/dist/array/head.mjs +5 -8
- package/dist/array/index.d.mts +1 -0
- package/dist/array/index.d.ts +1 -0
- package/dist/array/index.js +58 -652
- package/dist/array/index.mjs +52 -211
- package/dist/array/initial.mjs +8 -8
- package/dist/array/intersection.mjs +8 -8
- package/dist/array/intersectionBy.mjs +6 -8
- package/dist/array/intersectionWith.mjs +9 -8
- package/dist/array/isSubset.d.mts +26 -0
- package/dist/array/isSubset.d.ts +26 -0
- package/dist/array/isSubset.mjs +7 -0
- package/dist/array/keyBy.mjs +10 -8
- package/dist/array/last.d.mts +1 -0
- package/dist/array/last.d.ts +1 -0
- package/dist/array/last.mjs +5 -8
- package/dist/array/maxBy.mjs +14 -8
- package/dist/array/minBy.mjs +14 -8
- package/dist/array/orderBy.mjs +25 -8
- package/dist/array/partition.mjs +15 -8
- package/dist/array/sample.mjs +6 -8
- package/dist/array/sampleSize.mjs +20 -10
- package/dist/array/shuffle.mjs +10 -8
- package/dist/array/tail.d.mts +9 -4
- package/dist/array/tail.d.ts +9 -4
- package/dist/array/tail.mjs +13 -8
- package/dist/array/take.mjs +5 -8
- package/dist/array/takeRight.d.mts +2 -2
- package/dist/array/takeRight.d.ts +2 -2
- package/dist/array/takeRight.mjs +8 -8
- package/dist/array/takeRightWhile.mjs +10 -8
- package/dist/array/takeWhile.mjs +12 -8
- package/dist/array/toFilled.d.mts +5 -3
- package/dist/array/toFilled.d.ts +5 -3
- package/dist/array/toFilled.mjs +12 -8
- package/dist/array/union.mjs +7 -9
- package/dist/array/unionBy.mjs +12 -8
- package/dist/array/unionWith.mjs +7 -9
- package/dist/array/uniq.mjs +5 -8
- package/dist/array/uniqBy.mjs +12 -8
- package/dist/array/uniqWith.mjs +12 -8
- package/dist/array/unzip.d.mts +3 -2
- package/dist/array/unzip.d.ts +3 -2
- package/dist/array/unzip.mjs +18 -8
- package/dist/array/unzipWith.mjs +14 -8
- package/dist/array/without.mjs +6 -8
- package/dist/array/xor.mjs +9 -12
- package/dist/array/xorBy.mjs +11 -11
- package/dist/array/xorWith.mjs +11 -12
- package/dist/array/zip.d.mts +1 -0
- package/dist/array/zip.d.ts +1 -0
- package/dist/array/zip.mjs +14 -8
- package/dist/array/zipObject.d.mts +1 -1
- package/dist/array/zipObject.d.ts +1 -1
- package/dist/array/zipObject.mjs +9 -8
- package/dist/array/zipWith.d.mts +5 -0
- package/dist/array/zipWith.d.ts +5 -0
- package/dist/array/zipWith.mjs +13 -8
- package/dist/browser.global.js +2 -0
- package/dist/browser.global.js.map +1 -0
- package/dist/compat/_internal/getSymbols.mjs +6 -0
- package/dist/compat/_internal/getTag.mjs +8 -0
- package/dist/compat/_internal/identity.mjs +5 -0
- package/dist/compat/_internal/isArrayMatch.mjs +24 -0
- package/dist/compat/_internal/isDeepKey.mjs +15 -0
- package/dist/compat/_internal/isIndex.mjs +16 -0
- package/dist/compat/_internal/isMapMatch.mjs +18 -0
- package/dist/compat/_internal/isSetMatch.mjs +13 -0
- package/dist/compat/_internal/tags.mjs +28 -0
- package/dist/compat/_internal/toPath.mjs +40 -0
- package/dist/compat/array/chunk.d.mts +26 -0
- package/dist/compat/array/chunk.d.ts +26 -0
- package/dist/compat/array/chunk.mjs +11 -0
- package/dist/compat/array/concat.d.mts +30 -0
- package/dist/compat/array/concat.d.ts +30 -0
- package/dist/compat/array/concat.mjs +7 -0
- package/dist/compat/array/difference.d.mts +3 -0
- package/dist/compat/array/difference.d.ts +3 -0
- package/dist/compat/array/difference.mjs +10 -0
- package/dist/compat/array/fill.d.mts +33 -0
- package/dist/compat/array/fill.d.ts +33 -0
- package/dist/compat/array/fill.mjs +15 -0
- package/dist/compat/array/flatten.d.mts +19 -0
- package/dist/compat/array/flatten.d.ts +19 -0
- package/dist/compat/array/flatten.mjs +29 -0
- package/dist/compat/array/flattenDeep.d.mts +25 -0
- package/dist/compat/array/flattenDeep.d.ts +25 -0
- package/dist/compat/array/flattenDeep.mjs +7 -0
- package/dist/compat/array/flattenDepth.d.mts +19 -0
- package/dist/compat/array/flattenDepth.d.ts +19 -0
- package/dist/compat/array/flattenDepth.mjs +7 -0
- package/dist/compat/array/size.d.mts +39 -0
- package/dist/compat/array/size.d.ts +39 -0
- package/dist/compat/array/size.mjs +13 -0
- package/dist/compat/array/zipObjectDeep.d.mts +37 -0
- package/dist/compat/array/zipObjectDeep.d.ts +37 -0
- package/dist/compat/array/zipObjectDeep.mjs +16 -0
- package/dist/compat/function/ary.d.mts +11 -0
- package/dist/compat/function/ary.d.ts +11 -0
- package/dist/compat/function/ary.mjs +13 -0
- package/dist/compat/function/bind.d.mts +32 -0
- package/dist/compat/function/bind.d.ts +32 -0
- package/dist/compat/function/bind.mjs +27 -0
- package/dist/compat/index.d.mts +37 -472
- package/dist/compat/index.d.ts +37 -472
- package/dist/compat/index.js +513 -1333
- package/dist/compat/index.mjs +121 -391
- package/dist/compat/math/max.d.mts +19 -0
- package/dist/compat/math/max.d.ts +19 -0
- package/dist/compat/math/max.mjs +13 -0
- package/dist/compat/math/min.d.mts +19 -0
- package/dist/compat/math/min.d.ts +19 -0
- package/dist/compat/math/min.mjs +13 -0
- package/dist/compat/object/get.d.mts +247 -0
- package/dist/compat/object/get.d.ts +247 -0
- package/dist/compat/object/get.mjs +33 -0
- package/dist/compat/object/get.types.d.mts +9 -0
- package/dist/compat/object/get.types.d.ts +9 -0
- package/dist/compat/object/mapKeys.d.mts +39 -0
- package/dist/compat/object/mapKeys.d.ts +39 -0
- package/dist/compat/object/mapKeys.mjs +20 -0
- package/dist/compat/object/mapValues.d.mts +40 -0
- package/dist/compat/object/mapValues.d.ts +40 -0
- package/dist/compat/object/mapValues.mjs +20 -0
- package/dist/compat/object/property.d.mts +19 -0
- package/dist/compat/object/property.d.ts +19 -0
- package/dist/compat/object/property.mjs +9 -0
- package/dist/compat/object/set.d.mts +30 -0
- package/dist/compat/object/set.d.ts +30 -0
- package/dist/compat/object/set.mjs +24 -0
- package/dist/compat/predicate/isArguments.d.mts +23 -0
- package/dist/compat/predicate/isArguments.d.ts +23 -0
- package/dist/compat/predicate/isArguments.mjs +7 -0
- package/dist/compat/predicate/isArray.d.mts +23 -0
- package/dist/compat/predicate/isArray.d.ts +23 -0
- package/dist/compat/predicate/isArray.mjs +5 -0
- package/dist/compat/predicate/isArrayLike.d.mts +17 -0
- package/dist/compat/predicate/isArrayLike.d.ts +17 -0
- package/dist/compat/predicate/isArrayLike.mjs +8 -0
- package/dist/compat/predicate/isBoolean.d.mts +25 -0
- package/dist/compat/predicate/isBoolean.d.ts +25 -0
- package/dist/compat/predicate/isBoolean.mjs +13 -0
- package/dist/compat/predicate/isMatch.d.mts +31 -0
- package/dist/compat/predicate/isMatch.d.ts +31 -0
- package/dist/compat/predicate/isMatch.mjs +57 -0
- package/dist/compat/predicate/isObjectLike.d.mts +26 -0
- package/dist/compat/predicate/isObjectLike.d.ts +26 -0
- package/dist/compat/predicate/isObjectLike.mjs +5 -0
- package/dist/compat/predicate/isPlainObject.d.mts +25 -0
- package/dist/compat/predicate/isPlainObject.d.ts +25 -0
- package/dist/compat/predicate/isPlainObject.mjs +29 -0
- package/dist/compat/predicate/isTypedArray.d.mts +19 -0
- package/dist/compat/predicate/isTypedArray.d.ts +19 -0
- package/dist/compat/predicate/isTypedArray.mjs +7 -0
- package/dist/compat/predicate/matches.d.mts +27 -0
- package/dist/compat/predicate/matches.d.ts +27 -0
- package/dist/compat/predicate/matches.mjs +11 -0
- package/dist/compat/string/endsWith.d.mts +20 -0
- package/dist/compat/string/endsWith.d.ts +20 -0
- package/dist/compat/string/endsWith.mjs +5 -0
- package/dist/compat/string/padStart.d.mts +20 -0
- package/dist/compat/string/padStart.d.ts +20 -0
- package/dist/compat/string/padStart.mjs +5 -0
- package/dist/compat/string/startsWith.d.mts +20 -0
- package/dist/compat/string/startsWith.d.ts +20 -0
- package/dist/compat/string/startsWith.mjs +5 -0
- package/dist/error/AbortError.mjs +8 -8
- package/dist/error/TimeoutError.mjs +8 -8
- package/dist/function/after.d.mts +31 -0
- package/dist/function/after.d.ts +31 -0
- package/dist/function/after.mjs +14 -0
- package/dist/function/ary.d.mts +12 -0
- package/dist/function/ary.d.ts +12 -0
- package/dist/function/ary.mjs +7 -0
- package/dist/function/before.d.mts +31 -0
- package/dist/function/before.d.ts +31 -0
- package/dist/function/before.mjs +14 -0
- package/dist/function/debounce.mjs +28 -8
- package/dist/function/index.d.mts +4 -0
- package/dist/function/index.d.ts +4 -0
- package/dist/function/index.js +93 -88
- package/dist/function/index.mjs +9 -25
- package/dist/function/negate.mjs +5 -8
- package/dist/function/noop.mjs +3 -8
- package/dist/function/once.mjs +15 -8
- package/dist/function/throttle.mjs +13 -8
- package/dist/function/unary.d.mts +10 -0
- package/dist/function/unary.d.ts +10 -0
- package/dist/function/unary.mjs +7 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +120 -1210
- package/dist/index.mjs +102 -375
- package/dist/math/clamp.mjs +8 -8
- package/dist/math/inRange.mjs +12 -8
- package/dist/math/index.js +58 -115
- package/dist/math/index.mjs +10 -45
- package/dist/math/mean.mjs +7 -9
- package/dist/math/meanBy.mjs +8 -10
- package/dist/math/random.mjs +12 -8
- package/dist/math/randomInt.mjs +7 -9
- package/dist/math/range.mjs +20 -8
- package/dist/math/round.mjs +9 -8
- package/dist/math/sum.mjs +9 -8
- package/dist/math/sumBy.mjs +8 -9
- package/dist/object/clone.mjs +39 -8
- package/dist/object/cloneDeep.d.mts +49 -0
- package/dist/object/cloneDeep.d.ts +49 -0
- package/dist/object/cloneDeep.mjs +113 -0
- package/dist/object/flattenObject.mjs +28 -9
- package/dist/object/index.d.mts +3 -0
- package/dist/object/index.d.ts +3 -0
- package/dist/object/index.js +230 -165
- package/dist/object/index.mjs +10 -34
- package/dist/object/invert.mjs +12 -8
- package/dist/object/mapKeys.d.mts +21 -0
- package/dist/object/mapKeys.d.ts +21 -0
- package/dist/object/mapKeys.mjs +12 -0
- package/dist/object/mapValues.d.mts +21 -0
- package/dist/object/mapValues.d.ts +21 -0
- package/dist/object/mapValues.mjs +12 -0
- package/dist/object/omit.mjs +9 -8
- package/dist/object/omitBy.mjs +12 -8
- package/dist/object/pick.mjs +9 -8
- package/dist/object/pickBy.mjs +12 -8
- package/dist/predicate/index.d.mts +4 -0
- package/dist/predicate/index.d.ts +4 -0
- package/dist/predicate/index.js +17 -126
- package/dist/predicate/index.mjs +11 -35
- package/dist/predicate/isBoolean.d.mts +25 -0
- package/dist/predicate/isBoolean.d.ts +25 -0
- package/dist/predicate/isBoolean.mjs +5 -0
- package/dist/predicate/isEqual.d.mts +1 -1
- package/dist/predicate/isEqual.d.ts +1 -1
- package/dist/predicate/isEqual.mjs +177 -10
- package/dist/predicate/isFunction.d.mts +16 -0
- package/dist/predicate/isFunction.d.ts +16 -0
- package/dist/predicate/isFunction.mjs +5 -0
- package/dist/predicate/isLength.d.mts +21 -0
- package/dist/predicate/isLength.d.ts +21 -0
- package/dist/predicate/isLength.mjs +5 -8
- package/dist/predicate/isNil.mjs +5 -8
- package/dist/predicate/isNotNil.mjs +5 -8
- package/dist/predicate/isNull.mjs +5 -8
- package/dist/predicate/isPlainObject.mjs +21 -8
- package/dist/predicate/isPrimitive.d.mts +17 -0
- package/dist/predicate/isPrimitive.d.ts +17 -0
- package/dist/predicate/isPrimitive.mjs +5 -0
- package/dist/predicate/isTypedArray.d.mts +19 -0
- package/dist/predicate/isTypedArray.d.ts +19 -0
- package/dist/predicate/isTypedArray.mjs +15 -0
- package/dist/predicate/isUndefined.mjs +5 -8
- package/dist/promise/delay.mjs +20 -9
- package/dist/promise/index.js +5 -96
- package/dist/promise/index.mjs +2 -16
- package/dist/promise/timeout.mjs +9 -11
- package/dist/promise/withTimeout.mjs +7 -12
- package/dist/string/_internal/getWords.mjs +6 -0
- package/dist/string/camelCase.mjs +13 -10
- package/dist/string/capitalize.mjs +4 -7
- package/dist/string/index.js +41 -78
- package/dist/string/index.mjs +6 -30
- package/dist/string/kebabCase.mjs +7 -8
- package/dist/string/lowerCase.mjs +7 -8
- package/dist/string/snakeCase.mjs +7 -8
- package/dist/string/startCase.mjs +20 -9
- package/package.json +13 -4
- package/dist/array/chunk.js +0 -43
- package/dist/array/chunk.js.map +0 -1
- package/dist/array/chunk.mjs.map +0 -1
- package/dist/array/compact.js +0 -39
- package/dist/array/compact.js.map +0 -1
- package/dist/array/compact.mjs.map +0 -1
- package/dist/array/countBy.js +0 -39
- package/dist/array/countBy.js.map +0 -1
- package/dist/array/countBy.mjs.map +0 -1
- package/dist/array/difference.js +0 -34
- package/dist/array/difference.js.map +0 -1
- package/dist/array/difference.mjs.map +0 -1
- package/dist/array/differenceBy.js +0 -36
- package/dist/array/differenceBy.js.map +0 -1
- package/dist/array/differenceBy.mjs.map +0 -1
- package/dist/array/differenceWith.js +0 -37
- package/dist/array/differenceWith.js.map +0 -1
- package/dist/array/differenceWith.mjs.map +0 -1
- package/dist/array/drop.js +0 -34
- package/dist/array/drop.js.map +0 -1
- package/dist/array/drop.mjs.map +0 -1
- package/dist/array/dropRight.js +0 -37
- package/dist/array/dropRight.js.map +0 -1
- package/dist/array/dropRight.mjs.map +0 -1
- package/dist/array/dropRightWhile.js +0 -38
- package/dist/array/dropRightWhile.js.map +0 -1
- package/dist/array/dropRightWhile.mjs.map +0 -1
- package/dist/array/dropWhile.js +0 -37
- package/dist/array/dropWhile.js.map +0 -1
- package/dist/array/dropWhile.mjs.map +0 -1
- package/dist/array/fill.js +0 -39
- package/dist/array/fill.js.map +0 -1
- package/dist/array/fill.mjs.map +0 -1
- package/dist/array/flatMap.js +0 -52
- package/dist/array/flatMap.js.map +0 -1
- package/dist/array/flatMap.mjs.map +0 -1
- package/dist/array/flatten.js +0 -45
- package/dist/array/flatten.js.map +0 -1
- package/dist/array/flatten.mjs.map +0 -1
- package/dist/array/flattenDeep.js +0 -52
- package/dist/array/flattenDeep.js.map +0 -1
- package/dist/array/flattenDeep.mjs.map +0 -1
- package/dist/array/forEachRight.js +0 -36
- package/dist/array/forEachRight.js.map +0 -1
- package/dist/array/forEachRight.mjs.map +0 -1
- package/dist/array/groupBy.js +0 -41
- package/dist/array/groupBy.js.map +0 -1
- package/dist/array/groupBy.mjs.map +0 -1
- package/dist/array/head.js +0 -33
- package/dist/array/head.js.map +0 -1
- package/dist/array/head.mjs.map +0 -1
- package/dist/array/index.js.map +0 -1
- package/dist/array/index.mjs.map +0 -1
- package/dist/array/initial.js +0 -36
- package/dist/array/initial.js.map +0 -1
- package/dist/array/initial.mjs.map +0 -1
- package/dist/array/intersection.js +0 -36
- package/dist/array/intersection.js.map +0 -1
- package/dist/array/intersection.mjs.map +0 -1
- package/dist/array/intersectionBy.js +0 -34
- package/dist/array/intersectionBy.js.map +0 -1
- package/dist/array/intersectionBy.mjs.map +0 -1
- package/dist/array/intersectionWith.js +0 -37
- package/dist/array/intersectionWith.js.map +0 -1
- package/dist/array/intersectionWith.mjs.map +0 -1
- package/dist/array/keyBy.js +0 -38
- package/dist/array/keyBy.js.map +0 -1
- package/dist/array/keyBy.mjs.map +0 -1
- package/dist/array/last.js +0 -33
- package/dist/array/last.js.map +0 -1
- package/dist/array/last.mjs.map +0 -1
- package/dist/array/maxBy.js +0 -42
- package/dist/array/maxBy.js.map +0 -1
- package/dist/array/maxBy.mjs.map +0 -1
- package/dist/array/minBy.js +0 -42
- package/dist/array/minBy.js.map +0 -1
- package/dist/array/minBy.mjs.map +0 -1
- package/dist/array/orderBy.js +0 -53
- package/dist/array/orderBy.js.map +0 -1
- package/dist/array/orderBy.mjs.map +0 -1
- package/dist/array/partition.js +0 -42
- package/dist/array/partition.js.map +0 -1
- package/dist/array/partition.mjs.map +0 -1
- package/dist/array/sample.js +0 -34
- package/dist/array/sample.js.map +0 -1
- package/dist/array/sample.mjs.map +0 -1
- package/dist/array/sampleSize.js +0 -65
- package/dist/array/sampleSize.js.map +0 -1
- package/dist/array/sampleSize.mjs.map +0 -1
- package/dist/array/shuffle.js +0 -38
- package/dist/array/shuffle.js.map +0 -1
- package/dist/array/shuffle.mjs.map +0 -1
- package/dist/array/tail.js +0 -41
- package/dist/array/tail.js.map +0 -1
- package/dist/array/tail.mjs.map +0 -1
- package/dist/array/take.js +0 -33
- package/dist/array/take.js.map +0 -1
- package/dist/array/take.mjs.map +0 -1
- package/dist/array/takeRight.js +0 -36
- package/dist/array/takeRight.js.map +0 -1
- package/dist/array/takeRight.mjs.map +0 -1
- package/dist/array/takeRightWhile.js +0 -38
- package/dist/array/takeRightWhile.js.map +0 -1
- package/dist/array/takeRightWhile.mjs.map +0 -1
- package/dist/array/takeWhile.js +0 -40
- package/dist/array/takeWhile.js.map +0 -1
- package/dist/array/takeWhile.mjs.map +0 -1
- package/dist/array/toFilled.js +0 -40
- package/dist/array/toFilled.js.map +0 -1
- package/dist/array/toFilled.mjs.map +0 -1
- package/dist/array/union.js +0 -40
- package/dist/array/union.js.map +0 -1
- package/dist/array/union.mjs.map +0 -1
- package/dist/array/unionBy.js +0 -40
- package/dist/array/unionBy.js.map +0 -1
- package/dist/array/unionBy.mjs.map +0 -1
- package/dist/array/unionWith.js +0 -47
- package/dist/array/unionWith.js.map +0 -1
- package/dist/array/unionWith.mjs.map +0 -1
- package/dist/array/uniq.js +0 -33
- package/dist/array/uniq.js.map +0 -1
- package/dist/array/uniq.mjs.map +0 -1
- package/dist/array/uniqBy.js +0 -40
- package/dist/array/uniqBy.js.map +0 -1
- package/dist/array/uniqBy.mjs.map +0 -1
- package/dist/array/uniqWith.js +0 -40
- package/dist/array/uniqWith.js.map +0 -1
- package/dist/array/uniqWith.mjs.map +0 -1
- package/dist/array/unzip.js +0 -46
- package/dist/array/unzip.js.map +0 -1
- package/dist/array/unzip.mjs.map +0 -1
- package/dist/array/unzipWith.js +0 -42
- package/dist/array/unzipWith.js.map +0 -1
- package/dist/array/unzipWith.mjs.map +0 -1
- package/dist/array/without.js +0 -34
- package/dist/array/without.js.map +0 -1
- package/dist/array/without.mjs.map +0 -1
- package/dist/array/xor.js +0 -59
- package/dist/array/xor.js.map +0 -1
- package/dist/array/xor.mjs.map +0 -1
- package/dist/array/xorBy.js +0 -63
- package/dist/array/xorBy.js.map +0 -1
- package/dist/array/xorBy.mjs.map +0 -1
- package/dist/array/xorWith.js +0 -72
- package/dist/array/xorWith.js.map +0 -1
- package/dist/array/xorWith.mjs.map +0 -1
- package/dist/array/zip.js +0 -42
- package/dist/array/zip.js.map +0 -1
- package/dist/array/zip.mjs.map +0 -1
- package/dist/array/zipObject.js +0 -37
- package/dist/array/zipObject.js.map +0 -1
- package/dist/array/zipObject.mjs.map +0 -1
- package/dist/array/zipWith.js +0 -41
- package/dist/array/zipWith.js.map +0 -1
- package/dist/array/zipWith.mjs.map +0 -1
- package/dist/browser.d.mts +0 -2
- package/dist/browser.d.ts +0 -2
- package/dist/browser.js +0 -1325
- package/dist/browser.js.map +0 -1
- package/dist/browser.mjs +0 -109
- package/dist/browser.mjs.map +0 -1
- package/dist/chunk-236H5JZJ.mjs +0 -1
- package/dist/chunk-236H5JZJ.mjs.map +0 -1
- package/dist/chunk-237HGSZS.mjs +0 -16
- package/dist/chunk-237HGSZS.mjs.map +0 -1
- package/dist/chunk-24FKGR6U.mjs +0 -47
- package/dist/chunk-24FKGR6U.mjs.map +0 -1
- package/dist/chunk-27QMXBLJ.mjs +0 -9
- package/dist/chunk-27QMXBLJ.mjs.map +0 -1
- package/dist/chunk-2IXFGSUA.mjs +0 -16
- package/dist/chunk-2IXFGSUA.mjs.map +0 -1
- package/dist/chunk-2KNLZB7V.mjs +0 -10
- package/dist/chunk-2KNLZB7V.mjs.map +0 -1
- package/dist/chunk-2SLTL4KL.mjs +0 -13
- package/dist/chunk-2SLTL4KL.mjs.map +0 -1
- package/dist/chunk-2ZCITDMK.mjs +0 -13
- package/dist/chunk-2ZCITDMK.mjs.map +0 -1
- package/dist/chunk-33MSBDC6.mjs +0 -21
- package/dist/chunk-33MSBDC6.mjs.map +0 -1
- package/dist/chunk-3EZAFZG3.mjs +0 -10
- package/dist/chunk-3EZAFZG3.mjs.map +0 -1
- package/dist/chunk-3IP4JVLL.mjs +0 -32
- package/dist/chunk-3IP4JVLL.mjs.map +0 -1
- package/dist/chunk-4KYXHZ4R.mjs +0 -17
- package/dist/chunk-4KYXHZ4R.mjs.map +0 -1
- package/dist/chunk-4OIZM4HS.mjs +0 -1
- package/dist/chunk-4OIZM4HS.mjs.map +0 -1
- package/dist/chunk-54TK5BIS.mjs +0 -1
- package/dist/chunk-54TK5BIS.mjs.map +0 -1
- package/dist/chunk-5ASRKEB4.mjs +0 -13
- package/dist/chunk-5ASRKEB4.mjs.map +0 -1
- package/dist/chunk-5IKVJGHO.mjs +0 -14
- package/dist/chunk-5IKVJGHO.mjs.map +0 -1
- package/dist/chunk-5L4VWRFX.mjs +0 -14
- package/dist/chunk-5L4VWRFX.mjs.map +0 -1
- package/dist/chunk-5PMKOZ2F.mjs +0 -13
- package/dist/chunk-5PMKOZ2F.mjs.map +0 -1
- package/dist/chunk-6CLH5YZ2.mjs +0 -16
- package/dist/chunk-6CLH5YZ2.mjs.map +0 -1
- package/dist/chunk-6GWEY5EL.mjs +0 -13
- package/dist/chunk-6GWEY5EL.mjs.map +0 -1
- package/dist/chunk-6NVQAHXP.mjs +0 -13
- package/dist/chunk-6NVQAHXP.mjs.map +0 -1
- package/dist/chunk-7B7W36UP.mjs +0 -29
- package/dist/chunk-7B7W36UP.mjs.map +0 -1
- package/dist/chunk-AIRSKN47.mjs +0 -9
- package/dist/chunk-AIRSKN47.mjs.map +0 -1
- package/dist/chunk-AJKZMN2V.mjs +0 -14
- package/dist/chunk-AJKZMN2V.mjs.map +0 -1
- package/dist/chunk-B4COTK4K.mjs +0 -16
- package/dist/chunk-B4COTK4K.mjs.map +0 -1
- package/dist/chunk-B645AYL4.mjs +0 -1
- package/dist/chunk-B645AYL4.mjs.map +0 -1
- package/dist/chunk-BCTYOXT7.mjs +0 -16
- package/dist/chunk-BCTYOXT7.mjs.map +0 -1
- package/dist/chunk-BH6HLGBA.mjs +0 -16
- package/dist/chunk-BH6HLGBA.mjs.map +0 -1
- package/dist/chunk-BJWAMCFH.mjs +0 -598
- package/dist/chunk-BJWAMCFH.mjs.map +0 -1
- package/dist/chunk-BMRTZMRE.mjs +0 -9
- package/dist/chunk-BMRTZMRE.mjs.map +0 -1
- package/dist/chunk-BOOQBJN2.mjs +0 -9
- package/dist/chunk-BOOQBJN2.mjs.map +0 -1
- package/dist/chunk-CMBC4MXG.mjs +0 -19
- package/dist/chunk-CMBC4MXG.mjs.map +0 -1
- package/dist/chunk-CRSKT4WW.mjs +0 -15
- package/dist/chunk-CRSKT4WW.mjs.map +0 -1
- package/dist/chunk-CVVZHOJX.mjs +0 -22
- package/dist/chunk-CVVZHOJX.mjs.map +0 -1
- package/dist/chunk-DDH7K4QM.mjs +0 -1
- package/dist/chunk-DDH7K4QM.mjs.map +0 -1
- package/dist/chunk-DN3NOZ3H.mjs +0 -18
- package/dist/chunk-DN3NOZ3H.mjs.map +0 -1
- package/dist/chunk-DPH2KE6O.mjs +0 -24
- package/dist/chunk-DPH2KE6O.mjs.map +0 -1
- package/dist/chunk-DTJJIMKJ.mjs +0 -15
- package/dist/chunk-DTJJIMKJ.mjs.map +0 -1
- package/dist/chunk-DVK2N4KC.mjs +0 -9
- package/dist/chunk-DVK2N4KC.mjs.map +0 -1
- package/dist/chunk-DXB7EZUQ.mjs +0 -12
- package/dist/chunk-DXB7EZUQ.mjs.map +0 -1
- package/dist/chunk-E6C5EZQA.mjs +0 -19
- package/dist/chunk-E6C5EZQA.mjs.map +0 -1
- package/dist/chunk-E6E4RZLN.mjs +0 -17
- package/dist/chunk-E6E4RZLN.mjs.map +0 -1
- package/dist/chunk-EHSKB6DF.mjs +0 -26
- package/dist/chunk-EHSKB6DF.mjs.map +0 -1
- package/dist/chunk-EYYZQFOP.mjs +0 -14
- package/dist/chunk-EYYZQFOP.mjs.map +0 -1
- package/dist/chunk-F3WCQQET.mjs +0 -14
- package/dist/chunk-F3WCQQET.mjs.map +0 -1
- package/dist/chunk-F47GLYUU.mjs +0 -1
- package/dist/chunk-F47GLYUU.mjs.map +0 -1
- package/dist/chunk-FUS75PJ7.mjs +0 -1
- package/dist/chunk-FUS75PJ7.mjs.map +0 -1
- package/dist/chunk-FVVSE2F2.mjs +0 -12
- package/dist/chunk-FVVSE2F2.mjs.map +0 -1
- package/dist/chunk-G7UQ5PUR.mjs +0 -14
- package/dist/chunk-G7UQ5PUR.mjs.map +0 -1
- package/dist/chunk-GIWAOOFY.mjs +0 -13
- package/dist/chunk-GIWAOOFY.mjs.map +0 -1
- package/dist/chunk-HM2JT2RX.mjs +0 -9
- package/dist/chunk-HM2JT2RX.mjs.map +0 -1
- package/dist/chunk-HPFDYUGP.mjs +0 -13
- package/dist/chunk-HPFDYUGP.mjs.map +0 -1
- package/dist/chunk-IDCUZVJL.mjs +0 -18
- package/dist/chunk-IDCUZVJL.mjs.map +0 -1
- package/dist/chunk-IEA53J7P.mjs +0 -12
- package/dist/chunk-IEA53J7P.mjs.map +0 -1
- package/dist/chunk-IFNXROZR.mjs +0 -18
- package/dist/chunk-IFNXROZR.mjs.map +0 -1
- package/dist/chunk-IIDZ3KAJ.mjs +0 -18
- package/dist/chunk-IIDZ3KAJ.mjs.map +0 -1
- package/dist/chunk-IJD7FE2Z.mjs +0 -18
- package/dist/chunk-IJD7FE2Z.mjs.map +0 -1
- package/dist/chunk-IQLKIDXF.mjs +0 -12
- package/dist/chunk-IQLKIDXF.mjs.map +0 -1
- package/dist/chunk-JPUKH67K.mjs +0 -10
- package/dist/chunk-JPUKH67K.mjs.map +0 -1
- package/dist/chunk-JYSV56US.mjs +0 -41
- package/dist/chunk-JYSV56US.mjs.map +0 -1
- package/dist/chunk-KIOYQRMQ.mjs +0 -12
- package/dist/chunk-KIOYQRMQ.mjs.map +0 -1
- package/dist/chunk-KPBQ7OUY.mjs +0 -9
- package/dist/chunk-KPBQ7OUY.mjs.map +0 -1
- package/dist/chunk-L7FQX5MN.mjs +0 -19
- package/dist/chunk-L7FQX5MN.mjs.map +0 -1
- package/dist/chunk-LJ2C6MVP.mjs +0 -13
- package/dist/chunk-LJ2C6MVP.mjs.map +0 -1
- package/dist/chunk-LKXCOLNY.mjs +0 -8
- package/dist/chunk-LKXCOLNY.mjs.map +0 -1
- package/dist/chunk-LVWX5B43.mjs +0 -12
- package/dist/chunk-LVWX5B43.mjs.map +0 -1
- package/dist/chunk-M7SBBYV2.mjs +0 -14
- package/dist/chunk-M7SBBYV2.mjs.map +0 -1
- package/dist/chunk-ME352XO7.mjs +0 -9
- package/dist/chunk-ME352XO7.mjs.map +0 -1
- package/dist/chunk-MIGAC7F4.mjs +0 -25
- package/dist/chunk-MIGAC7F4.mjs.map +0 -1
- package/dist/chunk-ML727RRJ.mjs +0 -13
- package/dist/chunk-ML727RRJ.mjs.map +0 -1
- package/dist/chunk-MLCL773E.mjs +0 -12
- package/dist/chunk-MLCL773E.mjs.map +0 -1
- package/dist/chunk-MY4G7R3I.mjs +0 -14
- package/dist/chunk-MY4G7R3I.mjs.map +0 -1
- package/dist/chunk-NFS7RWWE.mjs +0 -16
- package/dist/chunk-NFS7RWWE.mjs.map +0 -1
- package/dist/chunk-NKLIE2OI.mjs +0 -1
- package/dist/chunk-NKLIE2OI.mjs.map +0 -1
- package/dist/chunk-NTLX2MPV.mjs +0 -14
- package/dist/chunk-NTLX2MPV.mjs.map +0 -1
- package/dist/chunk-O64NE2P4.mjs +0 -26
- package/dist/chunk-O64NE2P4.mjs.map +0 -1
- package/dist/chunk-O6UXZR3U.mjs +0 -10
- package/dist/chunk-O6UXZR3U.mjs.map +0 -1
- package/dist/chunk-OLX53VEF.mjs +0 -16
- package/dist/chunk-OLX53VEF.mjs.map +0 -1
- package/dist/chunk-OOKNBU4V.mjs +0 -18
- package/dist/chunk-OOKNBU4V.mjs.map +0 -1
- package/dist/chunk-OP4OAKQJ.mjs +0 -16
- package/dist/chunk-OP4OAKQJ.mjs.map +0 -1
- package/dist/chunk-OXZCMC5I.mjs +0 -13
- package/dist/chunk-OXZCMC5I.mjs.map +0 -1
- package/dist/chunk-PYEYV7BY.mjs +0 -10
- package/dist/chunk-PYEYV7BY.mjs.map +0 -1
- package/dist/chunk-Q47NGNXT.mjs +0 -21
- package/dist/chunk-Q47NGNXT.mjs.map +0 -1
- package/dist/chunk-QOJGMVVR.mjs +0 -17
- package/dist/chunk-QOJGMVVR.mjs.map +0 -1
- package/dist/chunk-QRSJBBFY.mjs +0 -21
- package/dist/chunk-QRSJBBFY.mjs.map +0 -1
- package/dist/chunk-QXTNZR7B.mjs +0 -25
- package/dist/chunk-QXTNZR7B.mjs.map +0 -1
- package/dist/chunk-R6QA7PLZ.mjs +0 -13
- package/dist/chunk-R6QA7PLZ.mjs.map +0 -1
- package/dist/chunk-SYWMYQYJ.mjs +0 -16
- package/dist/chunk-SYWMYQYJ.mjs.map +0 -1
- package/dist/chunk-TJ4Z5I7M.mjs +0 -17
- package/dist/chunk-TJ4Z5I7M.mjs.map +0 -1
- package/dist/chunk-U4JGKZ56.mjs +0 -41
- package/dist/chunk-U4JGKZ56.mjs.map +0 -1
- package/dist/chunk-U56ZOM7L.mjs +0 -9
- package/dist/chunk-U56ZOM7L.mjs.map +0 -1
- package/dist/chunk-UY76KTPE.mjs +0 -13
- package/dist/chunk-UY76KTPE.mjs.map +0 -1
- package/dist/chunk-UYZKMBDO.mjs +0 -22
- package/dist/chunk-UYZKMBDO.mjs.map +0 -1
- package/dist/chunk-VH2PV426.mjs +0 -9
- package/dist/chunk-VH2PV426.mjs.map +0 -1
- package/dist/chunk-WFZXCGEG.mjs +0 -17
- package/dist/chunk-WFZXCGEG.mjs.map +0 -1
- package/dist/chunk-WMM7TZLG.mjs +0 -9
- package/dist/chunk-WMM7TZLG.mjs.map +0 -1
- package/dist/chunk-WVQ7YVRK.mjs +0 -11
- package/dist/chunk-WVQ7YVRK.mjs.map +0 -1
- package/dist/chunk-XGQWTHW6.mjs +0 -34
- package/dist/chunk-XGQWTHW6.mjs.map +0 -1
- package/dist/chunk-XI7KRD2C.mjs +0 -13
- package/dist/chunk-XI7KRD2C.mjs.map +0 -1
- package/dist/chunk-XPSOKBRZ.mjs +0 -12
- package/dist/chunk-XPSOKBRZ.mjs.map +0 -1
- package/dist/chunk-XT74R35S.mjs +0 -1
- package/dist/chunk-XT74R35S.mjs.map +0 -1
- package/dist/chunk-Y5V7UAZZ.mjs +0 -21
- package/dist/chunk-Y5V7UAZZ.mjs.map +0 -1
- package/dist/chunk-YFN6KOC4.mjs +0 -15
- package/dist/chunk-YFN6KOC4.mjs.map +0 -1
- package/dist/compat/index.js.map +0 -1
- package/dist/compat/index.mjs.map +0 -1
- package/dist/error/AbortError.js +0 -36
- package/dist/error/AbortError.js.map +0 -1
- package/dist/error/AbortError.mjs.map +0 -1
- package/dist/error/TimeoutError.js +0 -36
- package/dist/error/TimeoutError.js.map +0 -1
- package/dist/error/TimeoutError.mjs.map +0 -1
- package/dist/error/index.d.mts +0 -2
- package/dist/error/index.d.ts +0 -2
- package/dist/error/index.js +0 -48
- package/dist/error/index.js.map +0 -1
- package/dist/error/index.mjs +0 -13
- package/dist/error/index.mjs.map +0 -1
- package/dist/function/debounce.js +0 -56
- package/dist/function/debounce.js.map +0 -1
- package/dist/function/debounce.mjs.map +0 -1
- package/dist/function/index.js.map +0 -1
- package/dist/function/index.mjs.map +0 -1
- package/dist/function/negate.js +0 -33
- package/dist/function/negate.js.map +0 -1
- package/dist/function/negate.mjs.map +0 -1
- package/dist/function/noop.js +0 -32
- package/dist/function/noop.js.map +0 -1
- package/dist/function/noop.mjs.map +0 -1
- package/dist/function/once.js +0 -43
- package/dist/function/once.js.map +0 -1
- package/dist/function/once.mjs.map +0 -1
- package/dist/function/throttle.js +0 -41
- package/dist/function/throttle.js.map +0 -1
- package/dist/function/throttle.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/math/clamp.js +0 -36
- package/dist/math/clamp.js.map +0 -1
- package/dist/math/clamp.mjs.map +0 -1
- package/dist/math/inRange.js +0 -40
- package/dist/math/inRange.js.map +0 -1
- package/dist/math/inRange.mjs.map +0 -1
- package/dist/math/index.js.map +0 -1
- package/dist/math/index.mjs.map +0 -1
- package/dist/math/mean.js +0 -44
- package/dist/math/mean.js.map +0 -1
- package/dist/math/mean.mjs.map +0 -1
- package/dist/math/meanBy.js +0 -50
- package/dist/math/meanBy.js.map +0 -1
- package/dist/math/meanBy.mjs.map +0 -1
- package/dist/math/random.js +0 -40
- package/dist/math/random.js.map +0 -1
- package/dist/math/random.mjs.map +0 -1
- package/dist/math/randomInt.js +0 -47
- package/dist/math/randomInt.js.map +0 -1
- package/dist/math/randomInt.mjs.map +0 -1
- package/dist/math/range.js +0 -48
- package/dist/math/range.js.map +0 -1
- package/dist/math/range.mjs.map +0 -1
- package/dist/math/round.js +0 -37
- package/dist/math/round.js.map +0 -1
- package/dist/math/round.mjs.map +0 -1
- package/dist/math/sum.js +0 -37
- package/dist/math/sum.js.map +0 -1
- package/dist/math/sum.mjs.map +0 -1
- package/dist/math/sumBy.js +0 -45
- package/dist/math/sumBy.js.map +0 -1
- package/dist/math/sumBy.mjs.map +0 -1
- package/dist/object/clone.js +0 -65
- package/dist/object/clone.js.map +0 -1
- package/dist/object/clone.mjs.map +0 -1
- package/dist/object/flattenObject.js +0 -77
- package/dist/object/flattenObject.js.map +0 -1
- package/dist/object/flattenObject.mjs.map +0 -1
- package/dist/object/index.js.map +0 -1
- package/dist/object/index.mjs.map +0 -1
- package/dist/object/invert.js +0 -40
- package/dist/object/invert.js.map +0 -1
- package/dist/object/invert.mjs.map +0 -1
- package/dist/object/omit.js +0 -51
- package/dist/object/omit.js.map +0 -1
- package/dist/object/omit.mjs.map +0 -1
- package/dist/object/omitBy.js +0 -40
- package/dist/object/omitBy.js.map +0 -1
- package/dist/object/omitBy.mjs.map +0 -1
- package/dist/object/pick.js +0 -37
- package/dist/object/pick.js.map +0 -1
- package/dist/object/pick.mjs.map +0 -1
- package/dist/object/pickBy.js +0 -40
- package/dist/object/pickBy.js.map +0 -1
- package/dist/object/pickBy.mjs.map +0 -1
- package/dist/predicate/index.js.map +0 -1
- package/dist/predicate/index.mjs.map +0 -1
- package/dist/predicate/isEqual.js +0 -73
- package/dist/predicate/isEqual.js.map +0 -1
- package/dist/predicate/isEqual.mjs.map +0 -1
- package/dist/predicate/isLength.js +0 -33
- package/dist/predicate/isLength.js.map +0 -1
- package/dist/predicate/isLength.mjs.map +0 -1
- package/dist/predicate/isNil.js +0 -33
- package/dist/predicate/isNil.js.map +0 -1
- package/dist/predicate/isNil.mjs.map +0 -1
- package/dist/predicate/isNotNil.js +0 -33
- package/dist/predicate/isNotNil.js.map +0 -1
- package/dist/predicate/isNotNil.mjs.map +0 -1
- package/dist/predicate/isNull.js +0 -33
- package/dist/predicate/isNull.js.map +0 -1
- package/dist/predicate/isNull.mjs.map +0 -1
- package/dist/predicate/isPlainObject.js +0 -49
- package/dist/predicate/isPlainObject.js.map +0 -1
- package/dist/predicate/isPlainObject.mjs.map +0 -1
- package/dist/predicate/isUndefined.js +0 -33
- package/dist/predicate/isUndefined.js.map +0 -1
- package/dist/predicate/isUndefined.mjs.map +0 -1
- package/dist/promise/delay.js +0 -56
- package/dist/promise/delay.js.map +0 -1
- package/dist/promise/delay.mjs.map +0 -1
- package/dist/promise/index.js.map +0 -1
- package/dist/promise/index.mjs.map +0 -1
- package/dist/promise/timeout.d.mts +0 -10
- package/dist/promise/timeout.d.ts +0 -10
- package/dist/promise/timeout.js +0 -92
- package/dist/promise/timeout.js.map +0 -1
- package/dist/promise/timeout.mjs.map +0 -1
- package/dist/promise/withTimeout.js +0 -99
- package/dist/promise/withTimeout.js.map +0 -1
- package/dist/promise/withTimeout.mjs.map +0 -1
- package/dist/string/camelCase.js +0 -52
- package/dist/string/camelCase.js.map +0 -1
- package/dist/string/camelCase.mjs.map +0 -1
- package/dist/string/capitalize.js +0 -33
- package/dist/string/capitalize.js.map +0 -1
- package/dist/string/capitalize.mjs.map +0 -1
- package/dist/string/index.js.map +0 -1
- package/dist/string/index.mjs.map +0 -1
- package/dist/string/kebabCase.js +0 -43
- package/dist/string/kebabCase.js.map +0 -1
- package/dist/string/kebabCase.mjs.map +0 -1
- package/dist/string/lowerCase.js +0 -43
- package/dist/string/lowerCase.js.map +0 -1
- package/dist/string/lowerCase.mjs.map +0 -1
- package/dist/string/snakeCase.js +0 -43
- package/dist/string/snakeCase.js.map +0 -1
- package/dist/string/snakeCase.mjs.map +0 -1
- package/dist/string/startCase.js +0 -54
- package/dist/string/startCase.js.map +0 -1
- package/dist/string/startCase.mjs.map +0 -1
- package/umd/browser.global.js +0 -2
package/dist/chunk-2IXFGSUA.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/array/takeWhile.ts
|
|
2
|
-
function takeWhile(arr, shouldContinueTaking) {
|
|
3
|
-
const result = [];
|
|
4
|
-
for (const item of arr) {
|
|
5
|
-
if (!shouldContinueTaking(item)) {
|
|
6
|
-
break;
|
|
7
|
-
}
|
|
8
|
-
result.push(item);
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
takeWhile
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-2IXFGSUA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/takeWhile.ts"],"sourcesContent":["/**\n * Returns a new array containing the leading elements of the provided array\n * that satisfy the provided predicate function. It stops taking elements as soon\n * as an element does not satisfy the predicate.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @param {(element: T) => boolean} shouldContinueTaking - The predicate function that is called with each element. Elements are included in the result as long as this function returns true.\n * @returns {T[]} A new array containing the leading elements that satisfy the predicate.\n *\n * @example\n * // Returns [1, 2]\n * takeWhile([1, 2, 3, 4], x => x < 3);\n *\n * @example\n * // Returns []\n * takeWhile([1, 2, 3, 4], x => x > 3);\n */\nexport function takeWhile<T>(arr: readonly T[], shouldContinueTaking: (element: T) => boolean): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n if (!shouldContinueTaking(item)) {\n break;\n }\n\n result.push(item);\n }\n\n return result;\n}\n"],"mappings":";AAkBO,SAAS,UAAa,KAAmB,sBAAoD;AAClG,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,QAAI,CAAC,qBAAqB,IAAI,GAAG;AAC/B;AAAA,IACF;AAEA,WAAO,KAAK,IAAI;AAAA,EAClB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-2KNLZB7V.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/sample.ts"],"sourcesContent":["/**\n * Returns a random element from an array.\n *\n * This function takes an array and returns a single element selected randomly from the array.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to sample from.\n * @returns {T} A random element from the array.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const randomElement = sample(array);\n * // randomElement will be one of the elements from the array, selected randomly.\n */\nexport function sample<T>(arr: readonly T[]): T {\n const randomIndex = Math.floor(Math.random() * arr.length);\n return arr[randomIndex];\n}\n"],"mappings":";AAcO,SAAS,OAAU,KAAsB;AAC9C,QAAM,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,IAAI,MAAM;AACzD,SAAO,IAAI,WAAW;AACxB;","names":[]}
|
package/dist/chunk-2SLTL4KL.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/sum.ts"],"sourcesContent":["/**\n * Calculates the sum of an array of numbers.\n *\n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: readonly number[]): number {\n let result = 0;\n\n for (let i = 0; i < nums.length; i++) {\n result += nums[i];\n }\n\n return result;\n}\n"],"mappings":";AAaO,SAAS,IAAI,MAAiC;AACnD,MAAI,SAAS;AAEb,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,cAAU,KAAK,CAAC;AAAA,EAClB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-2ZCITDMK.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
uniqWith
|
|
3
|
-
} from "./chunk-237HGSZS.mjs";
|
|
4
|
-
|
|
5
|
-
// src/array/unionWith.ts
|
|
6
|
-
function unionWith(arr1, arr2, areItemsEqual) {
|
|
7
|
-
return uniqWith(arr1.concat(arr2), areItemsEqual);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
unionWith
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-2ZCITDMK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/unionWith.ts"],"sourcesContent":["import { uniqWith } from './uniqWith.ts';\n\n/**\n * Creates an array of unique values from two given arrays based on a custom equality function.\n *\n * This function takes two arrays and a custom equality function, merges the arrays, and returns\n * a new array containing only the unique values as determined by the custom equality function.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.\n * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise.\n * @returns {T[]} A new array of unique values based on the custom equality function.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }];\n * const array2 = [{ id: 2 }, { id: 3 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = unionWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays\n */\nexport function unionWith<T>(\n arr1: readonly T[],\n arr2: readonly T[],\n areItemsEqual: (item1: T, item2: T) => boolean\n): T[] {\n return uniqWith(arr1.concat(arr2), areItemsEqual);\n}\n"],"mappings":";;;;;AAsBO,SAAS,UACd,MACA,MACA,eACK;AACL,SAAO,SAAS,KAAK,OAAO,IAAI,GAAG,aAAa;AAClD;","names":[]}
|
package/dist/chunk-33MSBDC6.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/array/flatten.ts
|
|
2
|
-
function flatten(arr, depth = 1) {
|
|
3
|
-
const result = [];
|
|
4
|
-
const flooredDepth = Math.floor(depth);
|
|
5
|
-
const recursive = (arr2, currentDepth) => {
|
|
6
|
-
for (const item of arr2) {
|
|
7
|
-
if (Array.isArray(item) && currentDepth < flooredDepth) {
|
|
8
|
-
recursive(item, currentDepth + 1);
|
|
9
|
-
} else {
|
|
10
|
-
result.push(item);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
recursive(arr, 0);
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
flatten
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-33MSBDC6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/flatten.ts"],"sourcesContent":["/**\n * Flattens an array up to the specified depth.\n *\n * @template T - The type of elements within the array.\n * @template D - The depth to which the array should be flattened.\n * @param {T[]} arr - The array to flatten.\n * @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.\n * @returns {Array<FlatArray<T[], D>>} A new array that has been flattened.\n *\n * @example\n * const arr = flatten([1, [2, 3], [4, [5, 6]]], 1);\n * // Returns: [1, 2, 3, 4, [5, 6]]\n *\n * const arr = flatten([1, [2, 3], [4, [5, 6]]], 2);\n * // Returns: [1, 2, 3, 4, 5, 6]\n */\nexport function flatten<T, D extends number = 1>(arr: readonly T[], depth = 1 as D): Array<FlatArray<T[], D>> {\n const result: Array<FlatArray<T[], D>> = [];\n const flooredDepth = Math.floor(depth);\n\n const recursive = (arr: readonly T[], currentDepth: number) => {\n for (const item of arr) {\n if (Array.isArray(item) && currentDepth < flooredDepth) {\n recursive(item, currentDepth + 1);\n } else {\n result.push(item as FlatArray<T[], D>);\n }\n }\n };\n\n recursive(arr, 0);\n return result;\n}\n"],"mappings":";AAgBO,SAAS,QAAiC,KAAmB,QAAQ,GAAkC;AAC5G,QAAM,SAAmC,CAAC;AAC1C,QAAM,eAAe,KAAK,MAAM,KAAK;AAErC,QAAM,YAAY,CAACA,MAAmB,iBAAyB;AAC7D,eAAW,QAAQA,MAAK;AACtB,UAAI,MAAM,QAAQ,IAAI,KAAK,eAAe,cAAc;AACtD,kBAAU,MAAM,eAAe,CAAC;AAAA,MAClC,OAAO;AACL,eAAO,KAAK,IAAyB;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AAEA,YAAU,KAAK,CAAC;AAChB,SAAO;AACT;","names":["arr"]}
|
package/dist/chunk-3EZAFZG3.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/drop.ts"],"sourcesContent":["/**\n * Removes a specified number of elements from the beginning of an array and returns the rest.\n *\n * This function takes an array and a number, and returns a new array with the specified number\n * of elements removed from the start.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array from which to drop elements.\n * @param {number} itemsCount - The number of elements to drop from the beginning of the array.\n * @returns {T[]} A new array with the specified number of elements removed from the start.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const result = drop(array, 2);\n * // result will be [3, 4, 5] since the first two elements are dropped.\n */\nexport function drop<T>(arr: readonly T[], itemsCount: number): T[] {\n itemsCount = Math.max(itemsCount, 0);\n\n return arr.slice(itemsCount);\n}\n"],"mappings":";AAgBO,SAAS,KAAQ,KAAmB,YAAyB;AAClE,eAAa,KAAK,IAAI,YAAY,CAAC;AAEnC,SAAO,IAAI,MAAM,UAAU;AAC7B;","names":[]}
|
package/dist/chunk-3IP4JVLL.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// src/function/debounce.ts
|
|
2
|
-
function debounce(func, debounceMs, { signal } = {}) {
|
|
3
|
-
let timeoutId = null;
|
|
4
|
-
const debounced = function(...args) {
|
|
5
|
-
if (timeoutId !== null) {
|
|
6
|
-
clearTimeout(timeoutId);
|
|
7
|
-
}
|
|
8
|
-
if (signal == null ? void 0 : signal.aborted) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
timeoutId = setTimeout(() => {
|
|
12
|
-
func(...args);
|
|
13
|
-
timeoutId = null;
|
|
14
|
-
}, debounceMs);
|
|
15
|
-
};
|
|
16
|
-
const onAbort = function() {
|
|
17
|
-
debounced.cancel();
|
|
18
|
-
};
|
|
19
|
-
debounced.cancel = function() {
|
|
20
|
-
if (timeoutId !== null) {
|
|
21
|
-
clearTimeout(timeoutId);
|
|
22
|
-
timeoutId = null;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
|
|
26
|
-
return debounced;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
debounce
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=chunk-3IP4JVLL.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/function/debounce.ts"],"sourcesContent":["interface DebounceOptions {\n signal?: AbortSignal;\n}\n\n/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @template F - The type of function.\n * @param {F} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @param {DebounceOptions} options - The options object.\n * @param {AbortSignal} options.signal - An optional AbortSignal to cancel the debounced function.\n * @returns {F & { cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n *\n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n *\n * // With AbortSignal\n * const controller = new AbortController();\n * const signal = controller.signal;\n * const debouncedWithSignal = debounce(() => {\n * console.log('Function executed');\n * }, 1000, { signal });\n *\n * debouncedWithSignal();\n *\n * // Will cancel the debounced function call\n * controller.abort();\n */\nexport function debounce<F extends (...args: any[]) => void>(\n func: F,\n debounceMs: number,\n { signal }: DebounceOptions = {}\n): F & { cancel: () => void } {\n let timeoutId: number | null = null;\n\n const debounced = function (...args: Parameters<F>) {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n }\n\n if (signal?.aborted) {\n return;\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n timeoutId = null;\n }, debounceMs) as any;\n } as F & { cancel: () => void };\n\n const onAbort = function () {\n debounced.cancel();\n };\n\n debounced.cancel = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n signal?.addEventListener('abort', onAbort, { once: true });\n\n return debounced;\n}\n"],"mappings":";AAuCO,SAAS,SACd,MACA,YACA,EAAE,OAAO,IAAqB,CAAC,GACH;AAC5B,MAAI,YAA2B;AAE/B,QAAM,YAAY,YAAa,MAAqB;AAClD,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AAAA,IACxB;AAEA,QAAI,iCAAQ,SAAS;AACnB;AAAA,IACF;AAEA,gBAAY,WAAW,MAAM;AAC3B,WAAK,GAAG,IAAI;AACZ,kBAAY;AAAA,IACd,GAAG,UAAU;AAAA,EACf;AAEA,QAAM,UAAU,WAAY;AAC1B,cAAU,OAAO;AAAA,EACnB;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,cAAc,MAAM;AACtB,mBAAa,SAAS;AACtB,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,mCAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK;AAExD,SAAO;AACT;","names":[]}
|
package/dist/chunk-4KYXHZ4R.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/array/zipWith.ts
|
|
2
|
-
function zipWith(arr1, ...rest) {
|
|
3
|
-
const arrs = [arr1, ...rest.slice(0, -1)];
|
|
4
|
-
const combine = rest[rest.length - 1];
|
|
5
|
-
const result = [];
|
|
6
|
-
const maxIndex = Math.max(...arrs.map((arr) => arr.length));
|
|
7
|
-
for (let i = 0; i < maxIndex; i++) {
|
|
8
|
-
const elements = arrs.map((arr) => arr[i]);
|
|
9
|
-
result.push(combine(...elements));
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
zipWith
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-4KYXHZ4R.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/zipWith.ts"],"sourcesContent":["/**\n * Combines multiple arrays into a single array using a custom combiner function.\n *\n * This function takes multiple arrays and a combiner function, and returns a new array where each element\n * is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @param {T[]} arr1 - The first array to zip.\n * @param {U[]} [arr2] - The second array to zip (optional).\n * @param {V[]} [arr3] - The third array to zip (optional).\n * @param {W[]} [arr4] - The fourth array to zip (optional).\n * @param {(...items: T[]) => R} combine - The combiner function that takes corresponding elements from each array and returns a single value.\n * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @example\n * // Example usage with two arrays:\n * const arr1 = [1, 2, 3];\n * const arr2 = [4, 5, 6];\n * const result = zipWith(arr1, arr2, (a, b) => a + b);\n * // result will be [5, 7, 9]\n *\n * @example\n * // Example usage with three arrays:\n * const arr1 = [1, 2];\n * const arr2 = [3, 4];\n * const arr3 = [5, 6];\n * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);\n * // result will be [`135`, `246`]\n */\nexport function zipWith<T, R>(arr1: readonly T[], combine: (item: T) => R): R[];\nexport function zipWith<T, U, R>(arr1: readonly T[], arr2: readonly U[], combine: (item1: T, item2: U) => R): R[];\nexport function zipWith<T, U, V, R>(\n arr1: readonly T[],\n arr2: readonly U[],\n arr3: readonly V[],\n combine: (item1: T, item2: U, item3: V) => R\n): R[];\nexport function zipWith<T, U, V, W, R>(\n arr1: readonly T[],\n arr2: readonly U[],\n arr3: readonly V[],\n arr4: readonly W[],\n combine: (item1: T, item2: U, item3: V, item4: W) => R\n): R[];\nexport function zipWith<T, R>(arr1: readonly T[], ...rest: any[]): R[] {\n const arrs = [arr1, ...rest.slice(0, -1)];\n const combine = rest[rest.length - 1] as (...items: T[]) => R;\n\n const result: R[] = [];\n const maxIndex = Math.max(...arrs.map(arr => arr.length));\n\n for (let i = 0; i < maxIndex; i++) {\n const elements: T[] = arrs.map(arr => arr[i]);\n result.push(combine(...elements));\n }\n\n return result;\n}\n"],"mappings":";AA2CO,SAAS,QAAc,SAAuB,MAAkB;AACrE,QAAM,OAAO,CAAC,MAAM,GAAG,KAAK,MAAM,GAAG,EAAE,CAAC;AACxC,QAAM,UAAU,KAAK,KAAK,SAAS,CAAC;AAEpC,QAAM,SAAc,CAAC;AACrB,QAAM,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,SAAO,IAAI,MAAM,CAAC;AAExD,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,UAAM,WAAgB,KAAK,IAAI,SAAO,IAAI,CAAC,CAAC;AAC5C,WAAO,KAAK,QAAQ,GAAG,QAAQ,CAAC;AAAA,EAClC;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-4OIZM4HS.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-4OIZM4HS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-54TK5BIS.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-54TK5BIS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-5ASRKEB4.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/mean.ts"],"sourcesContent":["import { sum } from './sum.ts';\n\n/**\n * Calculates the average of an array of numbers.\n *\n * If the array is empty, this function returns `NaN`.\n *\n * @param {number[]} nums - An array of numbers to calculate the average.\n * @returns {number} The average of all the numbers in the array.\n *\n * @example\n * const numbers = [1, 2, 3, 4, 5];\n * const result = mean(numbers);\n * // result will be 3\n */\nexport function mean(nums: readonly number[]): number {\n return sum(nums) / nums.length;\n}\n"],"mappings":";;;;;AAeO,SAAS,KAAK,MAAiC;AACpD,SAAO,IAAI,IAAI,IAAI,KAAK;AAC1B;","names":[]}
|
package/dist/chunk-5IKVJGHO.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getWords
|
|
3
|
-
} from "./chunk-WVQ7YVRK.mjs";
|
|
4
|
-
|
|
5
|
-
// src/string/lowerCase.ts
|
|
6
|
-
var lowerCase = (str) => {
|
|
7
|
-
const words = getWords(str);
|
|
8
|
-
return words.map((word) => word.toLowerCase()).join(" ");
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
lowerCase
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-5IKVJGHO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/string/lowerCase.ts"],"sourcesContent":["import { getWords } from './_internal/getWords.ts';\n\n/**\n * Converts a string to lower case.\n *\n * Lower case is the naming convention in which each word is written in lowercase and separated by an space ( ) character.\n *\n * @param {string} str - The string that is to be changed to lower case.\n * @returns {string} - The converted string to lower case.\n *\n * @example\n * const convertedStr1 = lowerCase('camelCase') // returns 'camel case'\n * const convertedStr2 = lowerCase('some whitespace') // returns 'some whitespace'\n * const convertedStr3 = lowerCase('hyphen-text') // returns 'hyphen text'\n * const convertedStr4 = lowerCase('HTTPRequest') // returns 'http request'\n */\nexport const lowerCase = (str: string): string => {\n const words = getWords(str);\n return words.map(word => word.toLowerCase()).join(' ');\n};\n"],"mappings":";;;;;AAgBO,IAAM,YAAY,CAAC,QAAwB;AAChD,QAAM,QAAQ,SAAS,GAAG;AAC1B,SAAO,MAAM,IAAI,UAAQ,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG;AACvD;","names":[]}
|
package/dist/chunk-5L4VWRFX.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
sum
|
|
3
|
-
} from "./chunk-2SLTL4KL.mjs";
|
|
4
|
-
|
|
5
|
-
// src/math/sumBy.ts
|
|
6
|
-
function sumBy(items, getValue) {
|
|
7
|
-
const nums = items.map((x) => getValue(x));
|
|
8
|
-
return sum(nums);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
sumBy
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-5L4VWRFX.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/sumBy.ts"],"sourcesContent":["import { sum } from './sum.ts';\n\n/**\n * Calculates the sum of an array of numbers when applying\n * the `getValue` function to each element.\n *\n * If the array is empty, this function returns `0`.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} items An array to calculate the average.\n * @param {(element: T) => number} getValue A function that selects a numeric value from each element.\n * @returns {number} The average of all the numbers as determined by the `getValue` function.\n *\n * @example\n * sumBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: 6\n * sumBy([], x => x.a); // Returns: 0\n */\nexport function sumBy<T>(items: readonly T[], getValue: (element: T) => number): number {\n const nums = items.map(x => getValue(x));\n\n return sum(nums);\n}\n"],"mappings":";;;;;AAiBO,SAAS,MAAS,OAAqB,UAA0C;AACtF,QAAM,OAAO,MAAM,IAAI,OAAK,SAAS,CAAC,CAAC;AAEvC,SAAO,IAAI,IAAI;AACjB;","names":[]}
|
package/dist/chunk-5PMKOZ2F.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/math/round.ts
|
|
2
|
-
function round(value, precision = 0) {
|
|
3
|
-
if (!Number.isInteger(precision)) {
|
|
4
|
-
throw new Error("Precision must be an integer.");
|
|
5
|
-
}
|
|
6
|
-
const multiplier = Math.pow(10, precision);
|
|
7
|
-
return Math.round(value * multiplier) / multiplier;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
round
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-5PMKOZ2F.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified precision.\n *\n * This function takes a number and an optional precision value, and returns the number rounded\n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n * @throws {Error} Throws an error if `Precision` is not integer.\n *\n * @example\n * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n * const result4 = round(1.2345, 3.1); // This will throw an error\n */\nexport function round(value: number, precision = 0): number {\n if (!Number.isInteger(precision)) {\n throw new Error('Precision must be an integer.');\n }\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";AAiBO,SAAS,MAAM,OAAe,YAAY,GAAW;AAC1D,MAAI,CAAC,OAAO,UAAU,SAAS,GAAG;AAChC,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AACA,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;","names":[]}
|
package/dist/chunk-6CLH5YZ2.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/object/pickBy.ts
|
|
2
|
-
function pickBy(obj, shouldPick) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
5
|
-
if (!shouldPick(value, key)) {
|
|
6
|
-
continue;
|
|
7
|
-
}
|
|
8
|
-
result[key] = value;
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
pickBy
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-6CLH5YZ2.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/pickBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";AAmBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-6GWEY5EL.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/array/zipObject.ts
|
|
2
|
-
function zipObject(keys, values) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (let i = 0; i < keys.length; i++) {
|
|
5
|
-
result[keys[i]] = values[i];
|
|
6
|
-
}
|
|
7
|
-
return result;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
zipObject
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-6GWEY5EL.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/zipObject.ts"],"sourcesContent":["/**\n * Combines two arrays, one of property names and one of corresponding values, into a single object.\n *\n * This function takes two arrays: one containing property names and another containing corresponding values.\n * It returns a new object where the property names from the first array are keys, and the corresponding elements\n * from the second array are values. If the `keys` array is longer than the `values` array, the remaining keys will\n * have `undefined` as their values.\n *\n * @template P - The type of elements in the array.\n * @template V - The type of elements in the array.\n * @param {P[]} keys - An array of property names.\n * @param {V[]} values - An array of values corresponding to the property names.\n * @returns {{ [K in P]: V }} A new object composed of the given property names and values.\n *\n * @example\n * const keys = ['a', 'b', 'c'];\n * const values = [1, 2, 3];\n * const result = zipObject(keys, values);\n * // result will be { a: 1, b: 2, c: 3 }\n *\n * const keys2 = ['a', 'b', 'c'];\n * const values2 = [1, 2];\n * const result2 = zipObject(keys2, values2);\n * // result2 will be { a: 1, b: 2, c: undefined }\n *\n * const keys2 = ['a', 'b'];\n * const values2 = [1, 2, 3];\n * const result2 = zipObject(keys2, values2);\n * // result2 will be { a: 1, b: 2 }\n */\nexport function zipObject<P extends string | number | symbol, V>(keys: P[], values: V[]): { [K in P]: V } {\n const result = {} as { [K in P]: V };\n\n for (let i = 0; i < keys.length; i++) {\n result[keys[i]] = values[i];\n }\n\n return result;\n}\n"],"mappings":";AA8BO,SAAS,UAAiD,MAAW,QAA8B;AACxG,QAAM,SAAS,CAAC;AAEhB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,WAAO,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC;AAAA,EAC5B;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-6NVQAHXP.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/array/differenceWith.ts
|
|
2
|
-
function differenceWith(firstArr, secondArr, areItemsEqual) {
|
|
3
|
-
return firstArr.filter((firstItem) => {
|
|
4
|
-
return secondArr.every((secondItem) => {
|
|
5
|
-
return !areItemsEqual(firstItem, secondItem);
|
|
6
|
-
});
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
differenceWith
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-6NVQAHXP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/differenceWith.ts"],"sourcesContent":["/**\n * Computes the difference between two arrays based on a custom equality function.\n *\n * This function takes two arrays and a custom comparison function. It returns a new array containing\n * the elements that are present in the first array but not in the second array. The comparison to determine\n * if elements are equal is made using the provided custom function.\n *\n * @template T\n * @param {T[]} firstArr - The array from which to get the difference.\n * @param {T[]} secondArr - The array containing elements to exclude from the first array.\n * @param {(x: T, y: T) => boolean} areItemsEqual - A function to determine if two items are equal.\n * @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array\n * according to the custom equality function.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = differenceWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.\n */\nexport function differenceWith<T>(\n firstArr: readonly T[],\n secondArr: readonly T[],\n areItemsEqual: (x: T, y: T) => boolean\n): T[] {\n return firstArr.filter(firstItem => {\n return secondArr.every(secondItem => {\n return !areItemsEqual(firstItem, secondItem);\n });\n });\n}\n"],"mappings":";AAqBO,SAAS,eACd,UACA,WACA,eACK;AACL,SAAO,SAAS,OAAO,eAAa;AAClC,WAAO,UAAU,MAAM,gBAAc;AACnC,aAAO,CAAC,cAAc,WAAW,UAAU;AAAA,IAC7C,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
|
package/dist/chunk-7B7W36UP.mjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// src/array/orderBy.ts
|
|
2
|
-
function orderBy(collection, keys, orders) {
|
|
3
|
-
const compareValues = (a, b, order) => {
|
|
4
|
-
if (a < b) {
|
|
5
|
-
return order === "asc" ? -1 : 1;
|
|
6
|
-
}
|
|
7
|
-
if (a > b) {
|
|
8
|
-
return order === "asc" ? 1 : -1;
|
|
9
|
-
}
|
|
10
|
-
return 0;
|
|
11
|
-
};
|
|
12
|
-
const effectiveOrders = keys.map((_, index) => orders[index] || orders[orders.length - 1]);
|
|
13
|
-
return collection.slice().sort((a, b) => {
|
|
14
|
-
for (let i = 0; i < keys.length; i++) {
|
|
15
|
-
const key = keys[i];
|
|
16
|
-
const order = effectiveOrders[i];
|
|
17
|
-
const result = compareValues(a[key], b[key], order);
|
|
18
|
-
if (result !== 0) {
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return 0;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
orderBy
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=chunk-7B7W36UP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/orderBy.ts"],"sourcesContent":["type Order = 'asc' | 'desc';\n\n/**\n * Sorts an array of objects based on multiple properties and their corresponding order directions.\n *\n * This function takes an array of objects, an array of keys to sort by, and an array of order directions.\n * It returns the sorted array, ordering by each key according to its corresponding direction\n * ('asc' for ascending or 'desc' for descending). If values for a key are equal,\n * it moves to the next key to determine the order.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} collection - The array of objects to be sorted.\n * @param {Array<keyof T>} keys - An array of keys (properties) by which to sort.\n * @param {Order[]} orders - An array of order directions ('asc' for ascending or 'desc' for descending).\n * @returns {T[]} - The sorted array.\n *\n * @example\n * // Sort an array of objects by 'user' in ascending order and 'age' in descending order.\n * const users = [\n * { user: 'fred', age: 48 },\n * { user: 'barney', age: 34 },\n * { user: 'fred', age: 40 },\n * { user: 'barney', age: 36 },\n * ];\n * const result = orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // result will be:\n * // [\n * // { user: 'barney', age: 36 },\n * // { user: 'barney', age: 34 },\n * // { user: 'fred', age: 48 },\n * // { user: 'fred', age: 40 },\n * // ]\n */\nexport function orderBy<T>(collection: T[], keys: Array<keyof T>, orders: Order[]): T[] {\n const compareValues = (a: T[keyof T], b: T[keyof T], order: Order) => {\n if (a < b) {\n return order === 'asc' ? -1 : 1;\n }\n if (a > b) {\n return order === 'asc' ? 1 : -1;\n }\n return 0;\n };\n\n const effectiveOrders = keys.map((_, index) => orders[index] || orders[orders.length - 1]);\n\n return collection.slice().sort((a, b) => {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const order = effectiveOrders[i];\n const result = compareValues(a[key], b[key], order);\n if (result !== 0) {\n return result;\n }\n }\n return 0;\n });\n}\n"],"mappings":";AAiCO,SAAS,QAAW,YAAiB,MAAsB,QAAsB;AACtF,QAAM,gBAAgB,CAAC,GAAe,GAAe,UAAiB;AACpE,QAAI,IAAI,GAAG;AACT,aAAO,UAAU,QAAQ,KAAK;AAAA,IAChC;AACA,QAAI,IAAI,GAAG;AACT,aAAO,UAAU,QAAQ,IAAI;AAAA,IAC/B;AACA,WAAO;AAAA,EACT;AAEA,QAAM,kBAAkB,KAAK,IAAI,CAAC,GAAG,UAAU,OAAO,KAAK,KAAK,OAAO,OAAO,SAAS,CAAC,CAAC;AAEzF,SAAO,WAAW,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM;AACvC,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,YAAM,QAAQ,gBAAgB,CAAC;AAC/B,YAAM,SAAS,cAAc,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,KAAK;AAClD,UAAI,WAAW,GAAG;AAChB,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT,CAAC;AACH;","names":[]}
|
package/dist/chunk-AIRSKN47.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/predicate/isNull.ts"],"sourcesContent":["/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`.\n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n *\n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n *\n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n"],"mappings":";AAoBO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;","names":[]}
|
package/dist/chunk-AJKZMN2V.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/array/keyBy.ts
|
|
2
|
-
function keyBy(arr, getKeyFromItem) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (const item of arr) {
|
|
5
|
-
const key = getKeyFromItem(item);
|
|
6
|
-
result[key] = item;
|
|
7
|
-
}
|
|
8
|
-
return result;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
keyBy
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-AJKZMN2V.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/keyBy.ts"],"sourcesContent":["/**\n * Maps each element of an array based on a provided key-generating function.\n *\n * This function takes an array and a function that generates a key from each element. It returns\n * an object where the keys are the generated keys and the values are the corresponding elements.\n * If there are multiple elements generating the same key, the last element among them is used\n * as the value.\n *\n * @template T - The type of elements in the array.\n * @template K - The type of keys.\n * @param {T[]} arr - The array of elements to be mapped.\n * @param {(item: T) => K} getKeyFromItem - A function that generates a key from an element.\n * @returns {Record<K, T>} An object where keys are mapped to each element of an array.\n *\n * @example\n * const array = [\n * { category: 'fruit', name: 'apple' },\n * { category: 'fruit', name: 'banana' },\n * { category: 'vegetable', name: 'carrot' }\n * ];\n * const result = keyBy(array, item => item.category);\n * // result will be:\n * // {\n * // fruit: { category: 'fruit', name: 'banana' },\n * // vegetable: { category: 'vegetable', name: 'carrot' }\n * // }\n */\nexport function keyBy<T, K extends PropertyKey>(arr: readonly T[], getKeyFromItem: (item: T) => K): Record<K, T> {\n const result = {} as Record<K, T>;\n\n for (const item of arr) {\n const key = getKeyFromItem(item);\n result[key] = item;\n }\n\n return result;\n}\n"],"mappings":";AA2BO,SAAS,MAAgC,KAAmB,gBAA8C;AAC/G,QAAM,SAAS,CAAC;AAEhB,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,eAAe,IAAI;AAC/B,WAAO,GAAG,IAAI;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-B4COTK4K.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/array/uniqBy.ts
|
|
2
|
-
function uniqBy(arr, mapper) {
|
|
3
|
-
const map = /* @__PURE__ */ new Map();
|
|
4
|
-
for (const item of arr) {
|
|
5
|
-
const key = mapper(item);
|
|
6
|
-
if (!map.has(key)) {
|
|
7
|
-
map.set(key, item);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return Array.from(map.values());
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
uniqBy
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-B4COTK4K.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/uniqBy.ts"],"sourcesContent":["/**\n * Returns a new array containing only the unique elements from the original array,\n * based on the values returned by the mapper function.\n *\n * @template T - The type of elements in the array.\n * @template U - The type of mapped elements.\n * @param {T[]} arr - The array to process.\n * @param {(item: T) => U} mapper - The function used to convert the array elements.\n * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function.\n *\n * @example\n * ```ts\n * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor);\n * // [1.2, 2.1, 3.2, 5.7, 7.19]\n * ```\n */\nexport function uniqBy<T, U>(arr: readonly T[], mapper: (item: T) => U): T[] {\n const map = new Map<U, T>();\n\n for (const item of arr) {\n const key = mapper(item);\n\n if (!map.has(key)) {\n map.set(key, item);\n }\n }\n\n return Array.from(map.values());\n}\n"],"mappings":";AAgBO,SAAS,OAAa,KAAmB,QAA6B;AAC3E,QAAM,MAAM,oBAAI,IAAU;AAE1B,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,OAAO,IAAI;AAEvB,QAAI,CAAC,IAAI,IAAI,GAAG,GAAG;AACjB,UAAI,IAAI,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI,OAAO,CAAC;AAChC;","names":[]}
|
package/dist/chunk-B645AYL4.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-B645AYL4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-BCTYOXT7.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/object/omitBy.ts
|
|
2
|
-
function omitBy(obj, shouldOmit) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
5
|
-
if (shouldOmit(value, key)) {
|
|
6
|
-
continue;
|
|
7
|
-
}
|
|
8
|
-
result[key] = value;
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
omitBy
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-BCTYOXT7.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/omitBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";AAmBO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-BH6HLGBA.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/math/inRange.ts
|
|
2
|
-
function inRange(value, minimum, maximum) {
|
|
3
|
-
if (maximum == null) {
|
|
4
|
-
maximum = minimum;
|
|
5
|
-
minimum = 0;
|
|
6
|
-
}
|
|
7
|
-
if (minimum >= maximum) {
|
|
8
|
-
throw new Error("The maximum value must be greater than the minimum value.");
|
|
9
|
-
}
|
|
10
|
-
return minimum <= value && value < maximum;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
inRange
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-BH6HLGBA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/inRange.ts"],"sourcesContent":["export function inRange(value: number, maximum: number): boolean;\nexport function inRange(value: number, minimum: number, maximum: number): boolean;\n/**\n * Checks if the value is within a specified range.\n *\n * @param {number} value The value to check.\n * @param {number} minimum The lower bound of the range (inclusive).\n * @param {number} maximum The upper bound of the range (exclusive).\n * @returns {boolean} `true` if the value is within the specified range, otherwise `false`.\n * @throws {Error} Throws an error if the `minimum` is greater or equal than the `maximum`.\n *\n * @example\n * const result1 = inRange(3, 5); // result1 will be true.\n * const result2 = inRange(1, 2, 5); // result2 will be false.\n * const result3 = inRange(1, 5, 2); // If the minimum is greater or equal than the maximum, an error is thrown.\n */\nexport function inRange(value: number, minimum: number, maximum?: number): boolean {\n if (maximum == null) {\n maximum = minimum;\n minimum = 0;\n }\n\n if (minimum >= maximum) {\n throw new Error('The maximum value must be greater than the minimum value.');\n }\n\n return minimum <= value && value < maximum;\n}\n"],"mappings":";AAgBO,SAAS,QAAQ,OAAe,SAAiB,SAA2B;AACjF,MAAI,WAAW,MAAM;AACnB,cAAU;AACV,cAAU;AAAA,EACZ;AAEA,MAAI,WAAW,SAAS;AACtB,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AAEA,SAAO,WAAW,SAAS,QAAQ;AACrC;","names":[]}
|