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-R6QA7PLZ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/union.ts"],"sourcesContent":["import { uniq } from './uniq.ts';\n\n/**\n * Creates an array of unique values from all given arrays.\n *\n * This function takes two arrays, merges them into a single array, and returns a new array\n * containing only the unique values from the merged array.\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 * @returns {T[]} A new array of unique values.\n *\n * @example\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function union<T>(arr1: readonly T[], arr2: readonly T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n"],"mappings":";;;;;AAmBO,SAAS,MAAS,MAAoB,MAAyB;AACpE,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;","names":[]}
|
package/dist/chunk-SYWMYQYJ.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/math/random.ts
|
|
2
|
-
function random(minimum, maximum) {
|
|
3
|
-
if (maximum == null) {
|
|
4
|
-
maximum = minimum;
|
|
5
|
-
minimum = 0;
|
|
6
|
-
}
|
|
7
|
-
if (minimum >= maximum) {
|
|
8
|
-
throw new Error("Invalid input: The maximum value must be greater than the minimum value.");
|
|
9
|
-
}
|
|
10
|
-
return Math.random() * (maximum - minimum) + minimum;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
random
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-SYWMYQYJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/random.ts"],"sourcesContent":["/**\n * Generate a random number within the given range.\n *\n * If only one argument is provided, a number between `0` and the given number is returned.\n *\n * @param {number} minimum - The lower bound (inclusive).\n * @param {number} maximum - The upper bound (exclusive).\n * @returns {number} A random number between minimum (inclusive) and maximum (exclusive). The number can be an integer or a decimal.\n * @throws {Error} Throws an error if `maximum` is not greater than `minimum`.\n *\n * @example\n * const result1 = random(0, 5); // Returns a random number between 0 and 5.\n * const result2 = random(5, 0); // If the minimum is greater than the maximum, an error is thrown\n * const result3 = random(5, 5); // If the minimum is equal to the maximum, an error is thrown.\n */\nexport function random(maximum: number): number;\nexport function random(minimum: number, maximum: number): number;\nexport function random(minimum: number, maximum?: number): number {\n if (maximum == null) {\n maximum = minimum;\n minimum = 0;\n }\n\n if (minimum >= maximum) {\n throw new Error('Invalid input: The maximum value must be greater than the minimum value.');\n }\n\n return Math.random() * (maximum - minimum) + minimum;\n}\n"],"mappings":";AAiBO,SAAS,OAAO,SAAiB,SAA0B;AAChE,MAAI,WAAW,MAAM;AACnB,cAAU;AACV,cAAU;AAAA,EACZ;AAEA,MAAI,WAAW,SAAS;AACtB,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AAEA,SAAO,KAAK,OAAO,KAAK,UAAU,WAAW;AAC/C;","names":[]}
|
package/dist/chunk-TJ4Z5I7M.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/array/tail.ts
|
|
2
|
-
function tail(arr) {
|
|
3
|
-
const len = arr.length;
|
|
4
|
-
if (len <= 1) {
|
|
5
|
-
return [];
|
|
6
|
-
}
|
|
7
|
-
const result = new Array(len - 1);
|
|
8
|
-
for (let i = 1; i < len; i++) {
|
|
9
|
-
result[i - 1] = arr[i];
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
tail
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-TJ4Z5I7M.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/tail.ts"],"sourcesContent":["/**\n * Returns an empty array when the input is a single-element array.\n *\n * @param {readonly [T]} arr - The single-element array to process.\n * @returns {[]} An empty array.\n *\n * @example\n * const arr = [1];\n * const result = tail(arr);\n * // result will be []\n */\nexport function tail<T>(arr: readonly [T]): [];\n\n/**\n * Returns an empty array when the input is an empty array.\n *\n * @param {readonly []} arr - The empty array to process.\n * @returns {[]} An empty array.\n *\n * @example\n * const arr = [];\n * const result = tail(arr);\n * // result will be []\n */\nexport function tail(arr: readonly []): [];\n\n/**\n * Returns a new array with all elements except for the first when the input is a tuple array.\n *\n * @param {readonly [T, ...U[]]} arr - The tuple array to process.\n * @returns {U[]} A new array containing all elements of the input array except for the first one.\n *\n * @example\n * const arr = [1, 2, 3];\n * const result = tail(arr);\n * // result will be [2, 3]\n */\nexport function tail<T, U>(arr: readonly [T, ...U[]]): U[];\n\n/**\n * Returns a new array with all elements except for the first.\n *\n * This function takes an array and returns a new array containing all the elements\n * except for the first one. If the input array is empty or has only one element,\n * an empty array is returned.\n *\n * @param {readonly T[]} arr - The array to get the tail of.\n * @returns {T[]} A new array containing all elements of the input array except for the first one.\n *\n * @example\n * const arr1 = [1, 2, 3];\n * const result = tail(arr1);\n * // result will be [2, 3]\n *\n * const arr2 = [1];\n * const result2 = tail(arr2);\n * // result2 will be []\n *\n * const arr3 = [];\n * const result3 = tail(arr3);\n * // result3 will be []\n */\nexport function tail<T>(arr: readonly T[]): T[];\n\nexport function tail<T>(arr: readonly T[]): T[] {\n const len = arr.length;\n if (len <= 1) {\n return [];\n }\n const result = new Array(len - 1);\n for (let i = 1; i < len; i++) {\n result[i - 1] = arr[i];\n }\n return result;\n}\n"],"mappings":";AAgEO,SAAS,KAAQ,KAAwB;AAC9C,QAAM,MAAM,IAAI;AAChB,MAAI,OAAO,GAAG;AACZ,WAAO,CAAC;AAAA,EACV;AACA,QAAM,SAAS,IAAI,MAAM,MAAM,CAAC;AAChC,WAAS,IAAI,GAAG,IAAI,KAAK,KAAK;AAC5B,WAAO,IAAI,CAAC,IAAI,IAAI,CAAC;AAAA,EACvB;AACA,SAAO;AACT;","names":[]}
|
package/dist/chunk-U4JGKZ56.mjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// src/object/clone.ts
|
|
2
|
-
function clone(obj) {
|
|
3
|
-
if (isPrimitive(obj)) {
|
|
4
|
-
return obj;
|
|
5
|
-
}
|
|
6
|
-
if (Array.isArray(obj)) {
|
|
7
|
-
return obj.slice();
|
|
8
|
-
}
|
|
9
|
-
if (obj instanceof Date) {
|
|
10
|
-
return new Date(obj.getTime());
|
|
11
|
-
}
|
|
12
|
-
if (obj instanceof RegExp) {
|
|
13
|
-
return new RegExp(obj.source, obj.flags);
|
|
14
|
-
}
|
|
15
|
-
if (obj instanceof Map) {
|
|
16
|
-
const result = /* @__PURE__ */ new Map();
|
|
17
|
-
for (const [key, value] of obj) {
|
|
18
|
-
result.set(key, value);
|
|
19
|
-
}
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
if (obj instanceof Set) {
|
|
23
|
-
const result = /* @__PURE__ */ new Set();
|
|
24
|
-
for (const value of obj) {
|
|
25
|
-
result.add(value);
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
}
|
|
29
|
-
if (typeof obj === "object") {
|
|
30
|
-
return Object.assign({}, obj);
|
|
31
|
-
}
|
|
32
|
-
return obj;
|
|
33
|
-
}
|
|
34
|
-
function isPrimitive(value) {
|
|
35
|
-
return value == null || typeof value !== "object" && typeof value !== "function";
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
clone
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=chunk-U4JGKZ56.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/clone.ts"],"sourcesContent":["/**\n * Creates a shallow clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A shallow clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n */\nexport function clone<T>(obj: T): T {\n if (isPrimitive(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.slice() as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as T;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj) {\n result.set(key, value);\n }\n return result as T;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj) {\n result.add(value);\n }\n return result as T;\n }\n\n if (typeof obj === \"object\") {\n return Object.assign({}, obj) as T;\n }\n return obj;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null ||\n (typeof value !== \"object\" && typeof value !== \"function\");\n}\n"],"mappings":";AA4BO,SAAS,MAAS,KAAW;AAClC,MAAI,YAAY,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,MAAM;AAAA,EACnB;AAEA,MAAI,eAAe,MAAM;AACvB,WAAO,IAAI,KAAK,IAAI,QAAQ,CAAC;AAAA,EAC/B;AAEA,MAAI,eAAe,QAAQ;AACzB,WAAO,IAAI,OAAO,IAAI,QAAQ,IAAI,KAAK;AAAA,EACzC;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,CAAC,KAAK,KAAK,KAAK,KAAK;AAC9B,aAAO,IAAI,KAAK,KAAK;AAAA,IACvB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,SAAS,KAAK;AACvB,aAAO,IAAI,KAAK;AAAA,IAClB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO,OAAO,OAAO,CAAC,GAAG,GAAG;AAAA,EAC9B;AACA,SAAO;AACT;AAIA,SAAS,YAAY,OAAoC;AACvD,SAAO,SAAS,QACb,OAAO,UAAU,YAAY,OAAO,UAAU;AACnD;","names":[]}
|
package/dist/chunk-U56ZOM7L.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/string/capitalize.ts"],"sourcesContent":["/**\n * Converts the first character of string to upper case and the remaining to lower case.\n *\n * @template T - Literal type of the string.\n * @param {T} str - The string to be converted to uppercase.\n * @returns {Capitalize<T>} - The capitalized string.\n *\n * @example\n * const result = capitalize('fred') // returns 'Fred'\n * const result2 = capitalize('FRED') // returns 'Fred'\n */\n\nexport const capitalize = <T extends string>(str: T): Capitalize<T> => {\n return (str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()) as Capitalize<T>;\n};\n"],"mappings":";AAYO,IAAM,aAAa,CAAmB,QAA0B;AACrE,SAAQ,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,MAAM,CAAC,EAAE,YAAY;AACjE;","names":[]}
|
package/dist/chunk-UY76KTPE.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
flatten
|
|
3
|
-
} from "./chunk-33MSBDC6.mjs";
|
|
4
|
-
|
|
5
|
-
// src/array/flatMap.ts
|
|
6
|
-
function flatMap(arr, iteratee, depth = 1) {
|
|
7
|
-
return flatten(arr.map((item) => iteratee(item)), depth);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
flatMap
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-UY76KTPE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/flatMap.ts"],"sourcesContent":["import { flatten } from './flatten.ts';\n\n/**\n * Maps each element in the array using the iteratee function and flattens the result up to the specified depth.\n *\n * @template T - The type of elements within the array.\n * @template U - The type of elements within the returned array from the iteratee function.\n * @template D - The depth to which the array should be flattened.\n * @param {T[]} arr - The array to flatten.\n * @param {(item: T) => U} iteratee - The function that produces the new array elements.\n * @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.\n * @returns {Array<FlatArray<U[], D>>} The new array with the mapped and flattened elements.\n *\n * @example\n * const arr = [1, 2, 3];\n *\n * flatMap(arr, (item: number) => [item, item]);\n * // [1, 1, 2, 2, 3, 3]\n *\n * flatMap(arr, (item: number) => [[item, item]], 2);\n * // [1, 1, 2, 2, 3, 3]\n */\nexport function flatMap<T, U, D extends number>(\n arr: readonly T[],\n iteratee: (item: T) => U,\n depth = 1 as D\n): Array<FlatArray<U[], D>> {\n return flatten(arr.map(item => iteratee(item)), depth);\n}\n"],"mappings":";;;;;AAsBO,SAAS,QACd,KACA,UACA,QAAQ,GACkB;AAC1B,SAAO,QAAQ,IAAI,IAAI,UAAQ,SAAS,IAAI,CAAC,GAAG,KAAK;AACvD;","names":[]}
|
package/dist/chunk-UYZKMBDO.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/array/unzip.ts
|
|
2
|
-
function unzip(zipped) {
|
|
3
|
-
let maxLen = 0;
|
|
4
|
-
for (let i = 0; i < zipped.length; i++) {
|
|
5
|
-
if (zipped[i].length > maxLen) {
|
|
6
|
-
maxLen = zipped[i].length;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
const result = new Array(maxLen);
|
|
10
|
-
for (let i = 0; i < maxLen; i++) {
|
|
11
|
-
result[i] = new Array(zipped.length);
|
|
12
|
-
for (let j = 0; j < zipped.length; j++) {
|
|
13
|
-
result[i][j] = zipped[j][i];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
unzip
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=chunk-UYZKMBDO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/unzip.ts"],"sourcesContent":["/**\n * Gathers elements in the same position in an internal array \n * from a grouped array of elements and returns them as a new array.\n *\n * @param zipped - The nested array to unzip.\n * @returns A new array of unzipped elements.\n *\n * @example\n * const zipped = [['a', true, 1],['b', false, 2]];\n * const result = unzip(zipped);\n * // result will be [['a', 'b'], [true, false], [1, 2]]\n */\nexport function unzip<T extends unknown[]>(zipped: Array<[...T]>): Unzip<T> {\n // For performance reasons, use this implementation instead of\n // const maxLen = Math.max(...zipped.map(arr => arr.length));\n let maxLen = 0;\n\n for (let i = 0; i < zipped.length; i++) {\n if (zipped[i].length > maxLen) {\n maxLen = zipped[i].length;\n }\n }\n\n const result = new Array(maxLen) as Unzip<T>;\n\n for (let i = 0; i < maxLen; i++) {\n result[i] = new Array(zipped.length);\n for (let j = 0; j < zipped.length; j++) {\n result[i][j] = zipped[j][i];\n }\n }\n\n return result;\n}\n\ntype Unzip<K extends unknown[]> = { [I in keyof K]: Array<K[I]> };\n"],"mappings":";AAYO,SAAS,MAA2B,QAAiC;AAG1E,MAAI,SAAS;AAEb,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,QAAI,OAAO,CAAC,EAAE,SAAS,QAAQ;AAC7B,eAAS,OAAO,CAAC,EAAE;AAAA,IACrB;AAAA,EACF;AAEA,QAAM,SAAS,IAAI,MAAM,MAAM;AAE/B,WAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC/B,WAAO,CAAC,IAAI,IAAI,MAAM,OAAO,MAAM;AACnC,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,aAAO,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC;AAAA,IAC5B;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-VH2PV426.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/predicate/isUndefined.ts"],"sourcesContent":["/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`.\n * It returns `true` if the value is `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n *\n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";AAoBO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
|
package/dist/chunk-WFZXCGEG.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__spreadValues
|
|
3
|
-
} from "./chunk-24FKGR6U.mjs";
|
|
4
|
-
|
|
5
|
-
// src/object/omit.ts
|
|
6
|
-
function omit(obj, keys) {
|
|
7
|
-
const result = __spreadValues({}, obj);
|
|
8
|
-
for (const key of keys) {
|
|
9
|
-
delete result[key];
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
omit
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-WFZXCGEG.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/omit.ts"],"sourcesContent":["/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n"],"mappings":";;;;;AAiBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-WMM7TZLG.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/predicate/isNil.ts"],"sourcesContent":["/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x == null;\n}\n"],"mappings":";AAmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,KAAK;AACd;","names":[]}
|
package/dist/chunk-WVQ7YVRK.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// src/string/_internal/getWords.ts
|
|
2
|
-
var CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;
|
|
3
|
-
function getWords(str) {
|
|
4
|
-
var _a;
|
|
5
|
-
return Array.from((_a = str.match(CASE_SPLIT_PATTERN)) != null ? _a : []);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
getWords
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=chunk-WVQ7YVRK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/string/_internal/getWords.ts"],"sourcesContent":["/**\n * Regular expression pattern to split strings into words for various case conversions\n *\n * This pattern matchs sequences of characters in a string, considering the following case:\n * - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n * - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n * - Single uppercase letters\n * - Sequences of digis\n *\n * The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n * a consistent format like snake case.\n *\n * @example\n * const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n * // matchs: ['camel', 'Case', 'HTTP', 'Request']\n */\nconst CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;\n\nexport function getWords(str: string): string[] {\n return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);\n}\n"],"mappings":";AAgBA,IAAM,qBAAqB;AAEpB,SAAS,SAAS,KAAuB;AAlBhD;AAmBE,SAAO,MAAM,MAAK,SAAI,MAAM,kBAAkB,MAA5B,YAAiC,CAAC,CAAC;AACvD;","names":[]}
|
package/dist/chunk-XGQWTHW6.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isPlainObject
|
|
3
|
-
} from "./chunk-MIGAC7F4.mjs";
|
|
4
|
-
|
|
5
|
-
// src/object/flattenObject.ts
|
|
6
|
-
function flattenObject(object) {
|
|
7
|
-
return flattenObjectImpl(object);
|
|
8
|
-
}
|
|
9
|
-
function flattenObjectImpl(object, prefix = "") {
|
|
10
|
-
const result = {};
|
|
11
|
-
const keys = Object.keys(object);
|
|
12
|
-
for (let i = 0; i < keys.length; i++) {
|
|
13
|
-
const key = keys[i];
|
|
14
|
-
const value = object[key];
|
|
15
|
-
const prefixedKey = prefix ? `${prefix}.${key}` : key;
|
|
16
|
-
if (isPlainObject(value) && Object.keys(value).length > 0) {
|
|
17
|
-
Object.assign(result, flattenObjectImpl(value, prefixedKey));
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
if (Array.isArray(value)) {
|
|
21
|
-
for (let index = 0; index < value.length; index++) {
|
|
22
|
-
result[`${prefixedKey}.${index}`] = value[index];
|
|
23
|
-
}
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
result[prefixedKey] = value;
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
flattenObject
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=chunk-XGQWTHW6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/flattenObject.ts"],"sourcesContent":["import { isPlainObject } from \"../predicate/isPlainObject.ts\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n * \n * @param {object} object - The object to flatten.\n * @returns {Record<string, any>} - The flattened object.\n * \n * @example\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n * \n * const flattened = flattenObject(nestedObject);\n * console.log(flattened); \n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n */\nexport function flattenObject(object: object): Record<string, any> {\n return flattenObjectImpl(object);\n}\n\nfunction flattenObjectImpl(object: object, prefix = ''): Record<string, any> {\n const result: Record<string, any> = {};\n const keys = Object.keys(object);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = (object as any)[key];\n\n const prefixedKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(value) && Object.keys(value).length > 0) {\n Object.assign(result, flattenObjectImpl(value, prefixedKey));\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) {\n result[`${prefixedKey}.${index}`] = value[index];\n }\n continue;\n }\n\n result[prefixedKey] = value;\n }\n\n return result;\n}"],"mappings":";;;;;AA2BO,SAAS,cAAc,QAAqC;AACjE,SAAO,kBAAkB,MAAM;AACjC;AAEA,SAAS,kBAAkB,QAAgB,SAAS,IAAyB;AAC3E,QAAM,SAA8B,CAAC;AACrC,QAAM,OAAO,OAAO,KAAK,MAAM;AAE/B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,MAAM,KAAK,CAAC;AAClB,UAAM,QAAS,OAAe,GAAG;AAEjC,UAAM,cAAc,SAAS,GAAG,MAAM,IAAI,GAAG,KAAK;AAElD,QAAI,cAAc,KAAK,KAAK,OAAO,KAAK,KAAK,EAAE,SAAS,GAAG;AACzD,aAAO,OAAO,QAAQ,kBAAkB,OAAO,WAAW,CAAC;AAC3D;AAAA,IACF;AAEA,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;AACjD,eAAO,GAAG,WAAW,IAAI,KAAK,EAAE,IAAI,MAAM,KAAK;AAAA,MACjD;AACA;AAAA,IACF;AAEA,WAAO,WAAW,IAAI;AAAA,EACxB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-XI7KRD2C.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/array/intersectionWith.ts
|
|
2
|
-
function intersectionWith(firstArr, secondArr, areItemsEqual) {
|
|
3
|
-
return firstArr.filter((firstItem) => {
|
|
4
|
-
return secondArr.some((secondItem) => {
|
|
5
|
-
return areItemsEqual(firstItem, secondItem);
|
|
6
|
-
});
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
intersectionWith
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-XI7KRD2C.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/intersectionWith.ts"],"sourcesContent":["/**\n * Returns the intersection of two arrays based on a custom equality function.\n *\n * This function takes two arrays and a custom equality function. It returns a new array containing\n * the elements from the first array that have matching elements in the second array, as determined\n * by the custom equality function. It effectively filters out any elements from the first array that\n * do not have corresponding matches in the second array according to the equality function.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} firstArr - The first array to compare.\n * @param {T[]} secondArr - The second array to compare.\n * @param {(x: T, y: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal.\n * This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise.\n * @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array 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 = intersectionWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 2 }] since this element has a matching id in both arrays.\n */\nexport function intersectionWith<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.some(secondItem => {\n return areItemsEqual(firstItem, secondItem);\n });\n });\n}\n"],"mappings":";AAsBO,SAAS,iBACd,UACA,WACA,eACK;AACL,SAAO,SAAS,OAAO,eAAa;AAClC,WAAO,UAAU,KAAK,gBAAc;AAClC,aAAO,cAAc,WAAW,UAAU;AAAA,IAC5C,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
|
package/dist/chunk-XPSOKBRZ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/initial.ts"],"sourcesContent":["/**\n * Returns a new array containing all elements except the last one from the input array.\n * If the input array is empty or has only one element, the function returns an empty array.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The input array to query.\n * @returns {T[]} A new array containing all but the last element of the input array.\n *\n * @example\n * const arr = [1, 2, 3, 4];\n * const newArr = initial(arr);\n * // newArr will be [1, 2, 3]\n *\n * @example\n * const emptyArr: number[] = [];\n * const newEmptyArr = initial(emptyArr);\n * // newEmptyArr will be []\n *\n * @example\n * const singleElementArr = ['only one'];\n * const newSingleElementArr = initial(singleElementArr);\n * // newSingleElementArr will be []\n */\nexport function initial<T>(arr: T[]): T[] {\n if (arr.length <= 1) {\n return [];\n }\n return arr.slice(0, -1);\n}\n"],"mappings":";AAuBO,SAAS,QAAW,KAAe;AACxC,MAAI,IAAI,UAAU,GAAG;AACnB,WAAO,CAAC;AAAA,EACV;AACA,SAAO,IAAI,MAAM,GAAG,EAAE;AACxB;","names":[]}
|
package/dist/chunk-XT74R35S.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-XT74R35S.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-Y5V7UAZZ.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
capitalize
|
|
3
|
-
} from "./chunk-U56ZOM7L.mjs";
|
|
4
|
-
import {
|
|
5
|
-
getWords
|
|
6
|
-
} from "./chunk-WVQ7YVRK.mjs";
|
|
7
|
-
|
|
8
|
-
// src/string/camelCase.ts
|
|
9
|
-
function camelCase(str) {
|
|
10
|
-
const words = getWords(str);
|
|
11
|
-
if (words.length === 0) {
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
const [first, ...rest] = words;
|
|
15
|
-
return `${first.toLowerCase()}${rest.map((word) => capitalize(word)).join("")}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
camelCase
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-Y5V7UAZZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/string/camelCase.ts"],"sourcesContent":["import { capitalize } from \"./capitalize.ts\";\nimport { getWords } from \"./_internal/getWords.ts\";\n\n/**\n * Converts a string to camel case.\n *\n * camel case is the naming convention in which each word is written in lowercase and separated by an underscore (_) character.\n *\n * @param {string} str - The string that is to be changed to camel case.\n * @returns {string} - The converted string to camel case.\n *\n * @example\n * const convertedStr1 = camelCase('camelCase') // returns 'camelCase'\n * const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace'\n * const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText'\n * const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'\n */\n\nexport function camelCase(str: string): string {\n const words = getWords(str);\n\n if (words.length === 0) {\n return \"\";\n }\n\n const [first, ...rest] = words;\n\n return `${first.toLowerCase()}${rest.map((word) => capitalize(word)).join(\"\")\n }`;\n}\n"],"mappings":";;;;;;;;AAkBO,SAAS,UAAU,KAAqB;AAC7C,QAAM,QAAQ,SAAS,GAAG;AAE1B,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,OAAO,GAAG,IAAI,IAAI;AAEzB,SAAO,GAAG,MAAM,YAAY,CAAC,GAAG,KAAK,IAAI,CAAC,SAAS,WAAW,IAAI,CAAC,EAAE,KAAK,EAAE,CAC1E;AACJ;","names":[]}
|
package/dist/chunk-YFN6KOC4.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// src/array/fill.ts
|
|
2
|
-
function fill(array, value, start = 0, end = array.length) {
|
|
3
|
-
const length = array.length;
|
|
4
|
-
const finalStart = Math.max(start >= 0 ? start : length + start, 0);
|
|
5
|
-
const finalEnd = Math.min(end >= 0 ? end : length + end, length);
|
|
6
|
-
for (let i = finalStart; i < finalEnd; i++) {
|
|
7
|
-
array[i] = value;
|
|
8
|
-
}
|
|
9
|
-
return array;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
fill
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-YFN6KOC4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/fill.ts"],"sourcesContent":["/**\n * Fills elements of an array with a specified value from the start position up to, but not including, the end position.\n *\n * This function mutates the original array and replaces its elements with the provided value, starting from the specified\n * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the\n * entire array.\n *\n * @param {Array<T | U>} array - The array to fill.\n * @param {U} value - The value to fill the array with.\n * @param {number} [start=0] - The start position. Defaults to 0.\n * @param {number} [end=arr.length] - The end position. Defaults to the array's length.\n * @returns {Array<T | U>} The array with the filled values.\n *\n * @example\n * const array = [1, 2, 3];\n * const result = fill(array, 'a');\n * // => ['a', 'a', 'a']\n *\n * const result = fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * const result = fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n *\n * const result = fill(array, '*', -2, -1);\n * // => [1, '*', 3]\n */\nexport function fill<T>(array: unknown[], value: T): T[];\nexport function fill<T, U>(array: Array<T | U>, value: U, start: number): Array<T | U>;\nexport function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;\nexport function fill<T, U>(array: Array<T | U>, value: U, start = 0, end = array.length): Array<T | U> {\n const length = array.length;\n const finalStart = Math.max(start >= 0 ? start : length + start, 0);\n const finalEnd = Math.min(end >= 0 ? end : length + end, length);\n\n for (let i = finalStart; i < finalEnd; i++) {\n array[i] = value;\n }\n\n return array;\n}\n"],"mappings":";AA8BO,SAAS,KAAW,OAAqB,OAAU,QAAQ,GAAG,MAAM,MAAM,QAAsB;AACrG,QAAM,SAAS,MAAM;AACrB,QAAM,aAAa,KAAK,IAAI,SAAS,IAAI,QAAQ,SAAS,OAAO,CAAC;AAClE,QAAM,WAAW,KAAK,IAAI,OAAO,IAAI,MAAM,SAAS,KAAK,MAAM;AAE/D,WAAS,IAAI,YAAY,IAAI,UAAU,KAAK;AAC1C,UAAM,CAAC,IAAI;AAAA,EACb;AAEA,SAAO;AACT;","names":[]}
|