es-toolkit 1.13.1-dev.329 → 1.13.1-dev.333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/index-CwRt_M.js +47 -0
- package/dist/_chunk/index-CwRt_M.js.map +1 -0
- package/dist/_chunk/isPlainObject-bK22pA.js +24 -0
- package/dist/_chunk/isPlainObject-bK22pA.js.map +1 -0
- package/dist/_chunk/randomInt-CF7bZK.js +20 -0
- package/dist/_chunk/randomInt-CF7bZK.js.map +1 -0
- package/dist/_chunk/union-CdQeDK.js +13 -0
- package/dist/_chunk/union-CdQeDK.js.map +1 -0
- package/dist/array/chunk.mjs +16 -8
- package/dist/array/chunk.mjs.map +1 -1
- package/dist/array/compact.mjs +12 -8
- package/dist/array/compact.mjs.map +1 -1
- package/dist/array/countBy.mjs +11 -8
- package/dist/array/countBy.mjs.map +1 -1
- package/dist/array/difference.mjs +7 -8
- package/dist/array/difference.mjs.map +1 -1
- package/dist/array/differenceBy.mjs +9 -8
- package/dist/array/differenceBy.mjs.map +1 -1
- package/dist/array/differenceWith.mjs +10 -8
- package/dist/array/differenceWith.mjs.map +1 -1
- package/dist/array/drop.mjs +7 -8
- package/dist/array/drop.mjs.map +1 -1
- package/dist/array/dropRight.mjs +10 -8
- package/dist/array/dropRight.mjs.map +1 -1
- package/dist/array/dropRightWhile.mjs +11 -8
- package/dist/array/dropRightWhile.mjs.map +1 -1
- package/dist/array/dropWhile.mjs +10 -8
- package/dist/array/dropWhile.mjs.map +1 -1
- package/dist/array/fill.mjs +12 -8
- package/dist/array/fill.mjs.map +1 -1
- package/dist/array/flatMap.mjs +8 -9
- package/dist/array/flatMap.mjs.map +1 -1
- package/dist/array/flatten.mjs +19 -8
- package/dist/array/flatten.mjs.map +1 -1
- package/dist/array/flattenDeep.mjs +8 -9
- package/dist/array/flattenDeep.mjs.map +1 -1
- package/dist/array/forEachRight.mjs +9 -8
- package/dist/array/forEachRight.mjs.map +1 -1
- package/dist/array/groupBy.mjs +14 -8
- package/dist/array/groupBy.mjs.map +1 -1
- package/dist/array/head.mjs +6 -8
- package/dist/array/head.mjs.map +1 -1
- package/dist/array/index.js +353 -498
- package/dist/array/index.js.map +1 -1
- package/dist/array/index.mjs +52 -211
- package/dist/array/index.mjs.map +1 -1
- package/dist/array/initial.mjs +9 -8
- package/dist/array/initial.mjs.map +1 -1
- package/dist/array/intersection.mjs +9 -8
- package/dist/array/intersection.mjs.map +1 -1
- package/dist/array/intersectionBy.mjs +7 -8
- package/dist/array/intersectionBy.mjs.map +1 -1
- package/dist/array/intersectionWith.mjs +10 -8
- package/dist/array/intersectionWith.mjs.map +1 -1
- package/dist/array/keyBy.mjs +11 -8
- package/dist/array/keyBy.mjs.map +1 -1
- package/dist/array/last.mjs +6 -8
- package/dist/array/last.mjs.map +1 -1
- package/dist/array/maxBy.mjs +15 -8
- package/dist/array/maxBy.mjs.map +1 -1
- package/dist/array/minBy.mjs +15 -8
- package/dist/array/minBy.mjs.map +1 -1
- package/dist/array/orderBy.mjs +26 -8
- package/dist/array/orderBy.mjs.map +1 -1
- package/dist/array/partition.mjs +16 -8
- package/dist/array/partition.mjs.map +1 -1
- package/dist/array/sample.mjs +7 -8
- package/dist/array/sample.mjs.map +1 -1
- package/dist/array/sampleSize.mjs +21 -10
- package/dist/array/sampleSize.mjs.map +1 -1
- package/dist/array/shuffle.mjs +11 -8
- package/dist/array/shuffle.mjs.map +1 -1
- package/dist/array/tail.mjs +14 -8
- package/dist/array/tail.mjs.map +1 -1
- package/dist/array/take.mjs +6 -8
- package/dist/array/take.mjs.map +1 -1
- package/dist/array/takeRight.mjs +9 -8
- package/dist/array/takeRight.mjs.map +1 -1
- package/dist/array/takeRightWhile.mjs +11 -8
- package/dist/array/takeRightWhile.mjs.map +1 -1
- package/dist/array/takeWhile.mjs +13 -8
- package/dist/array/takeWhile.mjs.map +1 -1
- package/dist/array/toFilled.mjs +13 -8
- package/dist/array/toFilled.mjs.map +1 -1
- package/dist/array/union.mjs +8 -9
- package/dist/array/union.mjs.map +1 -1
- package/dist/array/unionBy.mjs +13 -8
- package/dist/array/unionBy.mjs.map +1 -1
- package/dist/array/unionWith.mjs +8 -9
- package/dist/array/unionWith.mjs.map +1 -1
- package/dist/array/uniq.mjs +6 -8
- package/dist/array/uniq.mjs.map +1 -1
- package/dist/array/uniqBy.mjs +13 -8
- package/dist/array/uniqBy.mjs.map +1 -1
- package/dist/array/uniqWith.mjs +13 -8
- package/dist/array/uniqWith.mjs.map +1 -1
- package/dist/array/unzip.mjs +19 -8
- package/dist/array/unzip.mjs.map +1 -1
- package/dist/array/unzipWith.mjs +15 -8
- package/dist/array/unzipWith.mjs.map +1 -1
- package/dist/array/without.mjs +7 -8
- package/dist/array/without.mjs.map +1 -1
- package/dist/array/xor.mjs +10 -12
- package/dist/array/xor.mjs.map +1 -1
- package/dist/array/xorBy.mjs +12 -11
- package/dist/array/xorBy.mjs.map +1 -1
- package/dist/array/xorWith.mjs +12 -12
- package/dist/array/xorWith.mjs.map +1 -1
- package/dist/array/zip.mjs +15 -8
- package/dist/array/zip.mjs.map +1 -1
- package/dist/array/zipObject.mjs +10 -8
- package/dist/array/zipObject.mjs.map +1 -1
- package/dist/array/zipWith.mjs +14 -8
- package/dist/array/zipWith.mjs.map +1 -1
- package/dist/compat/_internal/isDeepKey.mjs +16 -0
- package/dist/compat/_internal/isDeepKey.mjs.map +1 -0
- package/dist/compat/_internal/isIndex.mjs +17 -0
- package/dist/compat/_internal/isIndex.mjs.map +1 -0
- package/dist/compat/_internal/toPath.mjs +41 -0
- package/dist/compat/_internal/toPath.mjs.map +1 -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 +12 -0
- package/dist/compat/array/chunk.mjs.map +1 -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 +8 -0
- package/dist/compat/array/concat.mjs.map +1 -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 +11 -0
- package/dist/compat/array/difference.mjs.map +1 -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 +16 -0
- package/dist/compat/array/fill.mjs.map +1 -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 +17 -0
- package/dist/compat/array/zipObjectDeep.mjs.map +1 -0
- package/dist/compat/index.d.mts +14 -546
- package/dist/compat/index.d.ts +14 -546
- package/dist/compat/index.js +287 -1498
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +106 -415
- package/dist/compat/index.mjs.map +1 -1
- package/dist/compat/math/max.d.mts +19 -0
- package/dist/compat/math/max.d.ts +19 -0
- package/dist/compat/math/max.mjs +14 -0
- package/dist/compat/math/max.mjs.map +1 -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 +14 -0
- package/dist/compat/math/min.mjs.map +1 -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 +34 -0
- package/dist/compat/object/get.mjs.map +1 -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/set.d.mts +30 -0
- package/dist/compat/object/set.d.ts +30 -0
- package/dist/compat/object/set.mjs +25 -0
- package/dist/compat/object/set.mjs.map +1 -0
- package/dist/compat/predicate/isArray.d.mts +24 -0
- package/dist/compat/predicate/isArray.d.ts +24 -0
- package/dist/compat/predicate/isArray.mjs +6 -0
- package/dist/compat/predicate/isArray.mjs.map +1 -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 +30 -0
- package/dist/compat/predicate/isPlainObject.mjs.map +1 -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 +8 -0
- package/dist/compat/predicate/isTypedArray.mjs.map +1 -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 +6 -0
- package/dist/compat/string/endsWith.mjs.map +1 -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 +6 -0
- package/dist/compat/string/startsWith.mjs.map +1 -0
- package/dist/error/AbortError.mjs +9 -8
- package/dist/error/AbortError.mjs.map +1 -1
- package/dist/error/TimeoutError.mjs +9 -8
- package/dist/error/TimeoutError.mjs.map +1 -1
- package/dist/function/after.mjs +14 -7
- package/dist/function/after.mjs.map +1 -1
- package/dist/function/debounce.mjs +29 -8
- package/dist/function/debounce.mjs.map +1 -1
- package/dist/function/index.js +66 -102
- package/dist/function/index.js.map +1 -1
- package/dist/function/index.mjs +7 -29
- package/dist/function/index.mjs.map +1 -1
- package/dist/function/negate.mjs +6 -8
- package/dist/function/negate.mjs.map +1 -1
- package/dist/function/noop.mjs +4 -8
- package/dist/function/noop.mjs.map +1 -1
- package/dist/function/once.mjs +16 -8
- package/dist/function/once.mjs.map +1 -1
- package/dist/function/throttle.mjs +14 -8
- package/dist/function/throttle.mjs.map +1 -1
- package/dist/index.js +114 -1307
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -399
- package/dist/index.mjs.map +1 -1
- package/dist/math/clamp.mjs +9 -8
- package/dist/math/clamp.mjs.map +1 -1
- package/dist/math/inRange.mjs +13 -8
- package/dist/math/inRange.mjs.map +1 -1
- package/dist/math/index.js +59 -115
- package/dist/math/index.js.map +1 -1
- package/dist/math/index.mjs +11 -45
- package/dist/math/index.mjs.map +1 -1
- package/dist/math/mean.mjs +8 -9
- package/dist/math/mean.mjs.map +1 -1
- package/dist/math/meanBy.mjs +9 -10
- package/dist/math/meanBy.mjs.map +1 -1
- package/dist/math/random.mjs +13 -8
- package/dist/math/random.mjs.map +1 -1
- package/dist/math/randomInt.mjs +8 -9
- package/dist/math/randomInt.mjs.map +1 -1
- package/dist/math/range.mjs +21 -8
- package/dist/math/range.mjs.map +1 -1
- package/dist/math/round.mjs +10 -8
- package/dist/math/round.mjs.map +1 -1
- package/dist/math/sum.mjs +10 -8
- package/dist/math/sum.mjs.map +1 -1
- package/dist/math/sumBy.mjs +9 -9
- package/dist/math/sumBy.mjs.map +1 -1
- package/dist/object/clone.mjs +40 -8
- package/dist/object/clone.mjs.map +1 -1
- package/dist/object/cloneDeep.mjs +100 -8
- package/dist/object/cloneDeep.mjs.map +1 -1
- package/dist/object/flattenObject.mjs +29 -9
- package/dist/object/flattenObject.mjs.map +1 -1
- package/dist/object/index.js +184 -232
- package/dist/object/index.js.map +1 -1
- package/dist/object/index.mjs +9 -38
- package/dist/object/index.mjs.map +1 -1
- package/dist/object/invert.mjs +13 -8
- package/dist/object/invert.mjs.map +1 -1
- package/dist/object/omit.mjs +10 -8
- package/dist/object/omit.mjs.map +1 -1
- package/dist/object/omitBy.mjs +13 -8
- package/dist/object/omitBy.mjs.map +1 -1
- package/dist/object/pick.mjs +10 -8
- package/dist/object/pick.mjs.map +1 -1
- package/dist/object/pickBy.mjs +13 -8
- package/dist/object/pickBy.mjs.map +1 -1
- package/dist/predicate/index.js +65 -126
- package/dist/predicate/index.js.map +1 -1
- package/dist/predicate/index.mjs +12 -51
- package/dist/predicate/index.mjs.map +1 -1
- package/dist/predicate/isArrayLike.mjs +9 -9
- package/dist/predicate/isArrayLike.mjs.map +1 -1
- package/dist/predicate/isEqual.mjs +36 -10
- package/dist/predicate/isEqual.mjs.map +1 -1
- package/dist/predicate/isFunction.mjs +6 -8
- package/dist/predicate/isFunction.mjs.map +1 -1
- package/dist/predicate/isLength.mjs +6 -8
- package/dist/predicate/isLength.mjs.map +1 -1
- package/dist/predicate/isNil.mjs +6 -8
- package/dist/predicate/isNil.mjs.map +1 -1
- package/dist/predicate/isNotNil.mjs +6 -8
- package/dist/predicate/isNotNil.mjs.map +1 -1
- package/dist/predicate/isNull.mjs +6 -8
- package/dist/predicate/isNull.mjs.map +1 -1
- package/dist/predicate/isPlainObject.mjs +22 -8
- package/dist/predicate/isPlainObject.mjs.map +1 -1
- package/dist/predicate/isPrimitive.mjs +6 -8
- package/dist/predicate/isPrimitive.mjs.map +1 -1
- package/dist/predicate/isTypedArray.mjs +16 -8
- package/dist/predicate/isTypedArray.mjs.map +1 -1
- package/dist/predicate/isUndefined.mjs +6 -8
- package/dist/predicate/isUndefined.mjs.map +1 -1
- package/dist/promise/delay.mjs +21 -9
- package/dist/promise/delay.mjs.map +1 -1
- package/dist/promise/index.js +6 -72
- package/dist/promise/index.js.map +1 -1
- package/dist/promise/index.mjs +3 -16
- package/dist/promise/index.mjs.map +1 -1
- package/dist/promise/timeout.mjs +10 -11
- package/dist/promise/timeout.mjs.map +1 -1
- package/dist/promise/withTimeout.mjs +8 -12
- package/dist/promise/withTimeout.mjs.map +1 -1
- package/dist/string/_internal/getWords.mjs +7 -0
- package/dist/string/_internal/getWords.mjs.map +1 -0
- package/dist/string/camelCase.mjs +14 -10
- package/dist/string/camelCase.mjs.map +1 -1
- package/dist/string/capitalize.mjs +5 -7
- package/dist/string/capitalize.mjs.map +1 -1
- package/dist/string/index.js +42 -77
- package/dist/string/index.js.map +1 -1
- package/dist/string/index.mjs +7 -30
- package/dist/string/index.mjs.map +1 -1
- package/dist/string/kebabCase.mjs +8 -8
- package/dist/string/kebabCase.mjs.map +1 -1
- package/dist/string/lowerCase.mjs +8 -8
- package/dist/string/lowerCase.mjs.map +1 -1
- package/dist/string/snakeCase.mjs +8 -8
- package/dist/string/snakeCase.mjs.map +1 -1
- package/dist/string/startCase.mjs +21 -9
- package/dist/string/startCase.mjs.map +1 -1
- package/package.json +8 -2
- package/umd/browser.global.js +2 -2
- package/umd/browser.global.js.map +1 -0
- package/dist/array/chunk.js +0 -43
- package/dist/array/chunk.js.map +0 -1
- package/dist/array/compact.js +0 -39
- package/dist/array/compact.js.map +0 -1
- package/dist/array/countBy.js +0 -38
- package/dist/array/countBy.js.map +0 -1
- package/dist/array/difference.js +0 -34
- package/dist/array/difference.js.map +0 -1
- package/dist/array/differenceBy.js +0 -36
- package/dist/array/differenceBy.js.map +0 -1
- package/dist/array/differenceWith.js +0 -37
- package/dist/array/differenceWith.js.map +0 -1
- package/dist/array/drop.js +0 -34
- package/dist/array/drop.js.map +0 -1
- package/dist/array/dropRight.js +0 -37
- package/dist/array/dropRight.js.map +0 -1
- package/dist/array/dropRightWhile.js +0 -38
- package/dist/array/dropRightWhile.js.map +0 -1
- package/dist/array/dropWhile.js +0 -37
- package/dist/array/dropWhile.js.map +0 -1
- package/dist/array/fill.js +0 -39
- package/dist/array/fill.js.map +0 -1
- package/dist/array/flatMap.js +0 -52
- package/dist/array/flatMap.js.map +0 -1
- package/dist/array/flatten.js +0 -45
- package/dist/array/flatten.js.map +0 -1
- package/dist/array/flattenDeep.js +0 -52
- package/dist/array/flattenDeep.js.map +0 -1
- package/dist/array/forEachRight.js +0 -36
- package/dist/array/forEachRight.js.map +0 -1
- package/dist/array/groupBy.js +0 -41
- package/dist/array/groupBy.js.map +0 -1
- package/dist/array/head.js +0 -33
- package/dist/array/head.js.map +0 -1
- package/dist/array/initial.js +0 -36
- package/dist/array/initial.js.map +0 -1
- package/dist/array/intersection.js +0 -36
- package/dist/array/intersection.js.map +0 -1
- package/dist/array/intersectionBy.js +0 -34
- package/dist/array/intersectionBy.js.map +0 -1
- package/dist/array/intersectionWith.js +0 -37
- package/dist/array/intersectionWith.js.map +0 -1
- package/dist/array/keyBy.js +0 -38
- package/dist/array/keyBy.js.map +0 -1
- package/dist/array/last.js +0 -33
- package/dist/array/last.js.map +0 -1
- package/dist/array/maxBy.js +0 -42
- package/dist/array/maxBy.js.map +0 -1
- package/dist/array/minBy.js +0 -42
- package/dist/array/minBy.js.map +0 -1
- package/dist/array/orderBy.js +0 -53
- package/dist/array/orderBy.js.map +0 -1
- package/dist/array/partition.js +0 -42
- package/dist/array/partition.js.map +0 -1
- package/dist/array/sample.js +0 -34
- package/dist/array/sample.js.map +0 -1
- package/dist/array/sampleSize.js +0 -65
- package/dist/array/sampleSize.js.map +0 -1
- package/dist/array/shuffle.js +0 -38
- package/dist/array/shuffle.js.map +0 -1
- package/dist/array/tail.js +0 -41
- package/dist/array/tail.js.map +0 -1
- package/dist/array/take.js +0 -33
- package/dist/array/take.js.map +0 -1
- package/dist/array/takeRight.js +0 -36
- package/dist/array/takeRight.js.map +0 -1
- package/dist/array/takeRightWhile.js +0 -38
- package/dist/array/takeRightWhile.js.map +0 -1
- package/dist/array/takeWhile.js +0 -40
- package/dist/array/takeWhile.js.map +0 -1
- package/dist/array/toFilled.js +0 -40
- package/dist/array/toFilled.js.map +0 -1
- package/dist/array/union.js +0 -40
- package/dist/array/union.js.map +0 -1
- package/dist/array/unionBy.js +0 -40
- package/dist/array/unionBy.js.map +0 -1
- package/dist/array/unionWith.js +0 -47
- package/dist/array/unionWith.js.map +0 -1
- package/dist/array/uniq.js +0 -33
- package/dist/array/uniq.js.map +0 -1
- package/dist/array/uniqBy.js +0 -40
- package/dist/array/uniqBy.js.map +0 -1
- package/dist/array/uniqWith.js +0 -40
- package/dist/array/uniqWith.js.map +0 -1
- package/dist/array/unzip.js +0 -46
- package/dist/array/unzip.js.map +0 -1
- package/dist/array/unzipWith.js +0 -42
- package/dist/array/unzipWith.js.map +0 -1
- package/dist/array/without.js +0 -34
- package/dist/array/without.js.map +0 -1
- package/dist/array/xor.js +0 -59
- package/dist/array/xor.js.map +0 -1
- package/dist/array/xorBy.js +0 -63
- package/dist/array/xorBy.js.map +0 -1
- package/dist/array/xorWith.js +0 -72
- package/dist/array/xorWith.js.map +0 -1
- package/dist/array/zip.js +0 -42
- package/dist/array/zip.js.map +0 -1
- package/dist/array/zipObject.js +0 -37
- package/dist/array/zipObject.js.map +0 -1
- package/dist/array/zipWith.js +0 -41
- package/dist/array/zipWith.js.map +0 -1
- package/dist/browser.d.mts +0 -2
- package/dist/browser.d.ts +0 -2
- package/dist/browser.js +0 -1440
- package/dist/browser.js.map +0 -1
- package/dist/browser.mjs +0 -115
- package/dist/browser.mjs.map +0 -1
- package/dist/chunk-237HGSZS.mjs +0 -16
- package/dist/chunk-237HGSZS.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-3SBT6WDU.mjs +0 -25
- package/dist/chunk-3SBT6WDU.mjs.map +0 -1
- package/dist/chunk-4DFAGGIM.mjs +0 -26
- package/dist/chunk-4DFAGGIM.mjs.map +0 -1
- package/dist/chunk-4OIZM4HS.mjs +0 -1
- package/dist/chunk-4OIZM4HS.mjs.map +0 -1
- package/dist/chunk-4ZES5T6V.mjs +0 -21
- package/dist/chunk-4ZES5T6V.mjs.map +0 -1
- package/dist/chunk-5ASRKEB4.mjs +0 -13
- package/dist/chunk-5ASRKEB4.mjs.map +0 -1
- package/dist/chunk-5F26PFZL.mjs +0 -32
- package/dist/chunk-5F26PFZL.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-6NVQAHXP.mjs +0 -13
- package/dist/chunk-6NVQAHXP.mjs.map +0 -1
- package/dist/chunk-74CREQXW.mjs +0 -9
- package/dist/chunk-74CREQXW.mjs.map +0 -1
- package/dist/chunk-7B7W36UP.mjs +0 -29
- package/dist/chunk-7B7W36UP.mjs.map +0 -1
- package/dist/chunk-7GXKT3VW.mjs +0 -41
- package/dist/chunk-7GXKT3VW.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-BCTYOXT7.mjs +0 -16
- package/dist/chunk-BCTYOXT7.mjs.map +0 -1
- package/dist/chunk-BGWHVWY4.mjs +0 -13
- package/dist/chunk-BGWHVWY4.mjs.map +0 -1
- package/dist/chunk-BH6HLGBA.mjs +0 -16
- package/dist/chunk-BH6HLGBA.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-DDH7K4QM.mjs +0 -1
- package/dist/chunk-DDH7K4QM.mjs.map +0 -1
- package/dist/chunk-DLS7UJKJ.mjs +0 -17
- package/dist/chunk-DLS7UJKJ.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-DTTKJ3VC.mjs +0 -9
- package/dist/chunk-DTTKJ3VC.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-ET33L3MQ.mjs +0 -14
- package/dist/chunk-ET33L3MQ.mjs.map +0 -1
- package/dist/chunk-EZYYB34V.mjs +0 -17
- package/dist/chunk-EZYYB34V.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-FZZNWXDM.mjs +0 -9
- package/dist/chunk-FZZNWXDM.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-GTFDDKZ2.mjs +0 -15
- package/dist/chunk-GTFDDKZ2.mjs.map +0 -1
- package/dist/chunk-GZGXXIF7.mjs +0 -650
- package/dist/chunk-GZGXXIF7.mjs.map +0 -1
- package/dist/chunk-HPFDYUGP.mjs +0 -13
- package/dist/chunk-HPFDYUGP.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-IJD7FE2Z.mjs +0 -18
- package/dist/chunk-IJD7FE2Z.mjs.map +0 -1
- package/dist/chunk-IWXZI3QT.mjs +0 -14
- package/dist/chunk-IWXZI3QT.mjs.map +0 -1
- package/dist/chunk-J5LGTIGS.mjs +0 -10
- package/dist/chunk-J5LGTIGS.mjs.map +0 -1
- package/dist/chunk-JCRY7ZYS.mjs +0 -22
- package/dist/chunk-JCRY7ZYS.mjs.map +0 -1
- package/dist/chunk-JPUKH67K.mjs +0 -10
- package/dist/chunk-JPUKH67K.mjs.map +0 -1
- package/dist/chunk-K5WL54BY.mjs +0 -93
- package/dist/chunk-K5WL54BY.mjs.map +0 -1
- package/dist/chunk-KIOYQRMQ.mjs +0 -12
- package/dist/chunk-KIOYQRMQ.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-LPZZIY5Z.mjs +0 -13
- package/dist/chunk-LPZZIY5Z.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-MJ7LNBI6.mjs +0 -17
- package/dist/chunk-MJ7LNBI6.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-N3QYJX4T.mjs +0 -12
- package/dist/chunk-N3QYJX4T.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-O6UXZR3U.mjs +0 -10
- package/dist/chunk-O6UXZR3U.mjs.map +0 -1
- package/dist/chunk-OG2RLT5U.mjs +0 -10
- package/dist/chunk-OG2RLT5U.mjs.map +0 -1
- package/dist/chunk-OGZMEWPR.mjs +0 -18
- package/dist/chunk-OGZMEWPR.mjs.map +0 -1
- package/dist/chunk-OLORW442.mjs +0 -18
- package/dist/chunk-OLORW442.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-OXZCMC5I.mjs +0 -13
- package/dist/chunk-OXZCMC5I.mjs.map +0 -1
- package/dist/chunk-PJPGJ2O6.mjs +0 -15
- package/dist/chunk-PJPGJ2O6.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-R6GLTTAB.mjs +0 -9
- package/dist/chunk-R6GLTTAB.mjs.map +0 -1
- package/dist/chunk-R6QA7PLZ.mjs +0 -13
- package/dist/chunk-R6QA7PLZ.mjs.map +0 -1
- package/dist/chunk-RTFTLCF3.mjs +0 -14
- package/dist/chunk-RTFTLCF3.mjs.map +0 -1
- package/dist/chunk-SXFMQQ6F.mjs +0 -9
- package/dist/chunk-SXFMQQ6F.mjs.map +0 -1
- package/dist/chunk-SYWMYQYJ.mjs +0 -16
- package/dist/chunk-SYWMYQYJ.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-VH2PV426.mjs +0 -9
- package/dist/chunk-VH2PV426.mjs.map +0 -1
- package/dist/chunk-VRUTBJYS.mjs +0 -43
- package/dist/chunk-VRUTBJYS.mjs.map +0 -1
- package/dist/chunk-WMM7TZLG.mjs +0 -9
- package/dist/chunk-WMM7TZLG.mjs.map +0 -1
- package/dist/chunk-XGQWTHW6.mjs +0 -34
- package/dist/chunk-XGQWTHW6.mjs.map +0 -1
- package/dist/chunk-XHSIT5DL.mjs +0 -16
- package/dist/chunk-XHSIT5DL.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-YOPFSFTD.mjs +0 -13
- package/dist/chunk-YOPFSFTD.mjs.map +0 -1
- package/dist/chunk-YXAOYIRV.mjs +0 -1
- package/dist/chunk-YXAOYIRV.mjs.map +0 -1
- package/dist/chunk-YXD3AQAK.mjs +0 -1
- package/dist/chunk-YXD3AQAK.mjs.map +0 -1
- package/dist/chunk-Z7HWEOQX.mjs +0 -14
- package/dist/chunk-Z7HWEOQX.mjs.map +0 -1
- package/dist/chunk-ZA2XI3OV.mjs +0 -1
- package/dist/chunk-ZA2XI3OV.mjs.map +0 -1
- package/dist/chunk-ZPNX2QDE.mjs +0 -13
- package/dist/chunk-ZPNX2QDE.mjs.map +0 -1
- package/dist/error/AbortError.js +0 -36
- package/dist/error/AbortError.js.map +0 -1
- package/dist/error/TimeoutError.js +0 -36
- package/dist/error/TimeoutError.js.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/after.js +0 -42
- package/dist/function/after.js.map +0 -1
- package/dist/function/debounce.js +0 -56
- package/dist/function/debounce.js.map +0 -1
- package/dist/function/negate.js +0 -33
- package/dist/function/negate.js.map +0 -1
- package/dist/function/noop.js +0 -32
- package/dist/function/noop.js.map +0 -1
- package/dist/function/once.js +0 -43
- package/dist/function/once.js.map +0 -1
- package/dist/function/throttle.js +0 -41
- package/dist/function/throttle.js.map +0 -1
- package/dist/math/clamp.js +0 -36
- package/dist/math/clamp.js.map +0 -1
- package/dist/math/inRange.js +0 -40
- package/dist/math/inRange.js.map +0 -1
- package/dist/math/mean.js +0 -44
- package/dist/math/mean.js.map +0 -1
- package/dist/math/meanBy.js +0 -50
- package/dist/math/meanBy.js.map +0 -1
- package/dist/math/random.js +0 -40
- package/dist/math/random.js.map +0 -1
- package/dist/math/randomInt.js +0 -47
- package/dist/math/randomInt.js.map +0 -1
- package/dist/math/range.js +0 -48
- package/dist/math/range.js.map +0 -1
- package/dist/math/round.js +0 -37
- package/dist/math/round.js.map +0 -1
- package/dist/math/sum.js +0 -37
- package/dist/math/sum.js.map +0 -1
- package/dist/math/sumBy.js +0 -45
- package/dist/math/sumBy.js.map +0 -1
- package/dist/object/clone.js +0 -67
- package/dist/object/clone.js.map +0 -1
- package/dist/object/cloneDeep.js +0 -117
- package/dist/object/cloneDeep.js.map +0 -1
- package/dist/object/flattenObject.js +0 -77
- package/dist/object/flattenObject.js.map +0 -1
- package/dist/object/invert.js +0 -40
- package/dist/object/invert.js.map +0 -1
- package/dist/object/omit.js +0 -37
- package/dist/object/omit.js.map +0 -1
- package/dist/object/omitBy.js +0 -40
- package/dist/object/omitBy.js.map +0 -1
- package/dist/object/pick.js +0 -37
- package/dist/object/pick.js.map +0 -1
- package/dist/object/pickBy.js +0 -40
- package/dist/object/pickBy.js.map +0 -1
- package/dist/predicate/isArrayLike.js +0 -40
- package/dist/predicate/isArrayLike.js.map +0 -1
- package/dist/predicate/isEqual.js +0 -73
- package/dist/predicate/isEqual.js.map +0 -1
- package/dist/predicate/isFunction.js +0 -33
- package/dist/predicate/isFunction.js.map +0 -1
- package/dist/predicate/isLength.js +0 -33
- package/dist/predicate/isLength.js.map +0 -1
- package/dist/predicate/isNil.js +0 -33
- package/dist/predicate/isNil.js.map +0 -1
- package/dist/predicate/isNotNil.js +0 -33
- package/dist/predicate/isNotNil.js.map +0 -1
- package/dist/predicate/isNull.js +0 -33
- package/dist/predicate/isNull.js.map +0 -1
- package/dist/predicate/isPlainObject.js +0 -49
- package/dist/predicate/isPlainObject.js.map +0 -1
- package/dist/predicate/isPrimitive.js +0 -33
- package/dist/predicate/isPrimitive.js.map +0 -1
- package/dist/predicate/isTypedArray.js +0 -33
- package/dist/predicate/isTypedArray.js.map +0 -1
- package/dist/predicate/isUndefined.js +0 -33
- package/dist/predicate/isUndefined.js.map +0 -1
- package/dist/promise/delay.js +0 -56
- package/dist/promise/delay.js.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 -70
- package/dist/promise/timeout.js.map +0 -1
- package/dist/promise/withTimeout.js +0 -75
- package/dist/promise/withTimeout.js.map +0 -1
- package/dist/string/camelCase.js +0 -51
- package/dist/string/camelCase.js.map +0 -1
- package/dist/string/capitalize.js +0 -33
- package/dist/string/capitalize.js.map +0 -1
- package/dist/string/kebabCase.js +0 -42
- package/dist/string/kebabCase.js.map +0 -1
- package/dist/string/lowerCase.js +0 -42
- package/dist/string/lowerCase.js.map +0 -1
- package/dist/string/snakeCase.js +0 -42
- package/dist/string/snakeCase.js.map +0 -1
- package/dist/string/startCase.js +0 -53
- package/dist/string/startCase.js.map +0 -1
package/dist/array/zipObject.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
1
|
+
function zipObject(keys, values) {
|
|
2
|
+
const result = {};
|
|
3
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4
|
+
result[keys[i]] = values[i];
|
|
5
|
+
}
|
|
6
|
+
return result;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { zipObject };
|
|
10
|
+
//# sourceMappingURL=zipObject.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],
|
|
1
|
+
{"version":3,"file":"zipObject.mjs","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 PropertyKey, 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"],"names":[],"mappings":"AA8BgB,SAAA,SAAS,CAA2B,IAAS,EAAE,MAAW,EAAA;IACxE,MAAM,MAAM,GAAG,EAAqB,CAAC;AAErC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;KAC7B;AAED,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"}
|
package/dist/array/zipWith.mjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
function zipWith(arr1, ...rest) {
|
|
2
|
+
const arrs = [arr1, ...rest.slice(0, -1)];
|
|
3
|
+
const combine = rest[rest.length - 1];
|
|
4
|
+
const result = [];
|
|
5
|
+
const maxIndex = Math.max(...arrs.map(arr => arr.length));
|
|
6
|
+
for (let i = 0; i < maxIndex; i++) {
|
|
7
|
+
const elements = arrs.map(arr => arr[i]);
|
|
8
|
+
result.push(combine(...elements));
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { zipWith };
|
|
14
|
+
//# sourceMappingURL=zipWith.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],
|
|
1
|
+
{"version":3,"file":"zipWith.mjs","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 * @template T - The type of elements in the first array.\n * @template U - The type of elements in the second array (optional).\n * @template V - The type of elements in the third array (optional).\n * @template W - The type of elements in the fourth array (optional).\n * @template R - The type of elements in the resulting array.\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"],"names":[],"mappings":"SAgDgB,OAAO,CAAO,IAAkB,EAAE,GAAG,IAAW,EAAA;AAC9D,IAAA,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAyB,CAAC;IAE9D,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1D,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE;AACjC,QAAA,MAAM,QAAQ,GAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;KACnC;AAED,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const IS_PLAIN = /^\w*$/;
|
|
2
|
+
const IS_DEEP = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
3
|
+
function isDeepKey(key) {
|
|
4
|
+
switch (typeof key) {
|
|
5
|
+
case 'number':
|
|
6
|
+
case 'symbol': {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
case 'string': {
|
|
10
|
+
return !IS_PLAIN.test(key) && IS_DEEP.test(key);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { isDeepKey };
|
|
16
|
+
//# sourceMappingURL=isDeepKey.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDeepKey.mjs","sources":["../../../src/compat/_internal/isDeepKey.ts"],"sourcesContent":["const IS_PLAIN = /^\\w*$/;\nconst IS_DEEP = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\n\n/**\n * Checks if a given key is a deep key.\n *\n * A deep key is a string that contains a dot (.) or square brackets with a property accessor.\n *\n * @param {PropertyKey} key - The key to check.\n * @returns {boolean} - Returns true if the key is a deep key, otherwise false.\n *\n * Examples:\n *\n * isDeepKey('a.b') // true\n * isDeepKey('a[b]') // true\n * isDeepKey('a') // false\n * isDeepKey(123) // false\n * isDeepKey('a.b.c') // true\n * isDeepKey('a[b][c]') // true\n */\nexport function isDeepKey(key: PropertyKey): boolean {\n switch (typeof key) {\n case 'number':\n case 'symbol': {\n return false;\n }\n case 'string': {\n return !IS_PLAIN.test(key) && IS_DEEP.test(key);\n }\n }\n}\n"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,MAAM,OAAO,GAAG,kDAAkD,CAAC;AAmB7D,SAAU,SAAS,CAAC,GAAgB,EAAA;IACxC,QAAQ,OAAO,GAAG;AAChB,QAAA,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,EAAE;AACb,YAAA,OAAO,KAAK,CAAC;SACd;QACD,KAAK,QAAQ,EAAE;AACb,YAAA,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACjD;KACF;AACH;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
|
|
2
|
+
function isIndex(value) {
|
|
3
|
+
switch (typeof value) {
|
|
4
|
+
case 'number': {
|
|
5
|
+
return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
|
|
6
|
+
}
|
|
7
|
+
case 'symbol': {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
case 'string': {
|
|
11
|
+
return IS_UNSIGNED_INTEGER.test(value);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { isIndex };
|
|
17
|
+
//# sourceMappingURL=isIndex.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isIndex.mjs","sources":["../../../src/compat/_internal/isIndex.ts"],"sourcesContent":["const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/\n\nexport function isIndex(value: PropertyKey) {\n switch (typeof value) {\n case 'number': {\n return Number.isInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;\n }\n case 'symbol': {\n return false;\n }\n case 'string': {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG,kBAAkB,CAAA;AAExC,SAAU,OAAO,CAAC,KAAkB,EAAA;IACxC,QAAQ,OAAO,KAAK;QAClB,KAAK,QAAQ,EAAE;AACb,YAAA,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;SACjF;QACD,KAAK,QAAQ,EAAE;AACb,YAAA,OAAO,KAAK,CAAC;SACd;QACD,KAAK,QAAQ,EAAE;AACb,YAAA,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACxC;KACF;AACH;;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function toPath(deepKey) {
|
|
2
|
+
const ESCAPE_REGEXP = /\\(\\)?/g;
|
|
3
|
+
const PROPERTY_REGEXP = RegExp('[^.[\\]]+' +
|
|
4
|
+
'|' +
|
|
5
|
+
'\\[(?:' +
|
|
6
|
+
'([^"\'][^[]*)' +
|
|
7
|
+
'|' +
|
|
8
|
+
'(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2' +
|
|
9
|
+
')\\]' +
|
|
10
|
+
'|' +
|
|
11
|
+
'(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g');
|
|
12
|
+
const result = [];
|
|
13
|
+
if (deepKey[0] === '.') {
|
|
14
|
+
result.push('');
|
|
15
|
+
}
|
|
16
|
+
let match;
|
|
17
|
+
let lastIndex = 0;
|
|
18
|
+
while ((match = PROPERTY_REGEXP.exec(deepKey)) !== null) {
|
|
19
|
+
let key = match[0];
|
|
20
|
+
const expr = match[1];
|
|
21
|
+
const quote = match[2];
|
|
22
|
+
const substr = match[3];
|
|
23
|
+
if (quote) {
|
|
24
|
+
key = substr.replace(ESCAPE_REGEXP, '$1');
|
|
25
|
+
}
|
|
26
|
+
else if (expr) {
|
|
27
|
+
key = expr;
|
|
28
|
+
}
|
|
29
|
+
result.push(key);
|
|
30
|
+
if (PROPERTY_REGEXP.lastIndex === lastIndex) {
|
|
31
|
+
PROPERTY_REGEXP.lastIndex++;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
lastIndex = PROPERTY_REGEXP.lastIndex;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { toPath };
|
|
41
|
+
//# sourceMappingURL=toPath.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPath.mjs","sources":["../../../src/compat/_internal/toPath.ts"],"sourcesContent":["/**\n * Converts a deep key string into an array of path segments.\n *\n * This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.\n *\n * @param {string} deepKey - The deep key string to convert.\n * @returns {string[]} An array of strings, each representing a segment of the path.\n *\n * Examples:\n *\n * toPath('a.b.c') // Returns ['a', 'b', 'c']\n * toPath('a[b][c]') // Returns ['a', 'b', 'c']\n * toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']\n * toPath('a[\"b.c\"].d') // Returns ['a', 'b.c', 'd']\n * toPath('') // Returns []\n * toPath('.a[b].c.d[e][\"f.g\"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']\n */\nexport function toPath(deepKey: string): string[] {\n const ESCAPE_REGEXP = /\\\\(\\\\)?/g;\n const PROPERTY_REGEXP = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\2)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\2' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n );\n\n const result: string[] = [];\n\n if (deepKey[0] === '.') {\n result.push('');\n }\n\n let match: RegExpExecArray | null;\n let lastIndex = 0;\n\n while ((match = PROPERTY_REGEXP.exec(deepKey)) !== null) {\n let key = match[0];\n const expr = match[1];\n const quote = match[2];\n const substr = match[3];\n\n if (quote) {\n key = substr.replace(ESCAPE_REGEXP, '$1');\n } else if (expr) {\n key = expr;\n }\n\n result.push(key);\n\n if (PROPERTY_REGEXP.lastIndex === lastIndex) {\n PROPERTY_REGEXP.lastIndex++;\n } else {\n lastIndex = PROPERTY_REGEXP.lastIndex;\n }\n }\n\n return result;\n}\n"],"names":[],"mappings":"AAiBM,SAAU,MAAM,CAAC,OAAe,EAAA;IACpC,MAAM,aAAa,GAAG,UAAU,CAAC;AACjC,IAAA,MAAM,eAAe,GAAG,MAAM,CAE5B,WAAW;QACT,GAAG;QAEH,QAAQ;QAER,eAAe;QACf,GAAG;QAEH,wCAAwC;QACxC,MAAM;QACN,GAAG;QAEH,oCAAoC,EACtC,GAAG,CACJ,CAAC;IAEF,MAAM,MAAM,GAAa,EAAE,CAAC;AAE5B,IAAA,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACtB,QAAA,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACjB;AAED,IAAA,IAAI,KAA6B,CAAC;IAClC,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB,IAAA,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE;AACvD,QAAA,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACnB,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACvB,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAExB,IAAI,KAAK,EAAE;YACT,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;SAC3C;aAAM,IAAI,IAAI,EAAE;YACf,GAAG,GAAG,IAAI,CAAC;SACZ;AAED,QAAA,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEjB,QAAA,IAAI,eAAe,CAAC,SAAS,KAAK,SAAS,EAAE;YAC3C,eAAe,CAAC,SAAS,EAAE,CAAC;SAC7B;aAAM;AACL,YAAA,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC;SACvC;KACF;AAED,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splits an array into smaller arrays of a specified length.
|
|
3
|
+
*
|
|
4
|
+
* This function takes an input array and divides it into multiple smaller arrays,
|
|
5
|
+
* each of a specified length. If the input array cannot be evenly divided,
|
|
6
|
+
* the final sub-array will contain the remaining elements.
|
|
7
|
+
*
|
|
8
|
+
* @template T The type of elements in the array.
|
|
9
|
+
* @param {T[]} arr - The array to be chunked into smaller arrays.
|
|
10
|
+
* @param {number} size - The size of each smaller array. Must be a positive integer.
|
|
11
|
+
* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
|
|
12
|
+
* @throws {Error} Throws an error if `size` is not a positive integer.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Splits an array of numbers into sub-arrays of length 2
|
|
16
|
+
* chunk([1, 2, 3, 4, 5], 2);
|
|
17
|
+
* // Returns: [[1, 2], [3, 4], [5]]
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Splits an array of strings into sub-arrays of length 3
|
|
21
|
+
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
|
|
22
|
+
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
|
|
23
|
+
*/
|
|
24
|
+
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
25
|
+
|
|
26
|
+
export { chunk };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splits an array into smaller arrays of a specified length.
|
|
3
|
+
*
|
|
4
|
+
* This function takes an input array and divides it into multiple smaller arrays,
|
|
5
|
+
* each of a specified length. If the input array cannot be evenly divided,
|
|
6
|
+
* the final sub-array will contain the remaining elements.
|
|
7
|
+
*
|
|
8
|
+
* @template T The type of elements in the array.
|
|
9
|
+
* @param {T[]} arr - The array to be chunked into smaller arrays.
|
|
10
|
+
* @param {number} size - The size of each smaller array. Must be a positive integer.
|
|
11
|
+
* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.
|
|
12
|
+
* @throws {Error} Throws an error if `size` is not a positive integer.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Splits an array of numbers into sub-arrays of length 2
|
|
16
|
+
* chunk([1, 2, 3, 4, 5], 2);
|
|
17
|
+
* // Returns: [[1, 2], [3, 4], [5]]
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Splits an array of strings into sub-arrays of length 3
|
|
21
|
+
* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);
|
|
22
|
+
* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
|
|
23
|
+
*/
|
|
24
|
+
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
25
|
+
|
|
26
|
+
export { chunk };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { chunk as chunk$1 } from '../../array/chunk.mjs';
|
|
2
|
+
|
|
3
|
+
function chunk(arr, size = 1) {
|
|
4
|
+
size = Math.max(Math.floor(size), 0);
|
|
5
|
+
if (size === 0) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
return chunk$1(arr, size);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { chunk };
|
|
12
|
+
//# sourceMappingURL=chunk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk.mjs","sources":["../../../src/compat/array/chunk.ts"],"sourcesContent":["import { chunk as chunkToolkit } from '../../array/chunk.ts';\n\n/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: readonly T[], size = 1): T[][] {\n size = Math.max(Math.floor(size), 0);\n\n if (size === 0) {\n return [];\n }\n\n return chunkToolkit(arr, size);\n}\n"],"names":["chunkToolkit"],"mappings":";;SAyBgB,KAAK,CAAI,GAAiB,EAAE,IAAI,GAAG,CAAC,EAAA;AAClD,IAAA,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAErC,IAAA,IAAI,IAAI,KAAK,CAAC,EAAE;AACd,QAAA,OAAO,EAAE,CAAC;KACX;AAED,IAAA,OAAOA,OAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACjC;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concatenates multiple arrays and values into a single array.
|
|
3
|
+
*
|
|
4
|
+
* @template T The type of elements in the array.
|
|
5
|
+
* @param {...(T | T[])} values - The values and/or arrays to concatenate.
|
|
6
|
+
* @returns {T[]} A new array containing all the input values.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Concatenate individual values
|
|
10
|
+
* concat(1, 2, 3);
|
|
11
|
+
* // returns [1, 2, 3]
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Concatenate arrays of values
|
|
15
|
+
* concat([1, 2], [3, 4]);
|
|
16
|
+
* // returns [1, 2, 3, 4]
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Concatenate a mix of individual values and arrays
|
|
20
|
+
* concat(1, [2, 3], 4);
|
|
21
|
+
* // returns [1, 2, 3, 4]
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Concatenate nested arrays
|
|
25
|
+
* concat([1, [2, 3]], 4);
|
|
26
|
+
* // returns [1, [2, 3], 4]
|
|
27
|
+
*/
|
|
28
|
+
declare function concat<T>(...values: Array<T | readonly T[]>): T[];
|
|
29
|
+
|
|
30
|
+
export { concat };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concatenates multiple arrays and values into a single array.
|
|
3
|
+
*
|
|
4
|
+
* @template T The type of elements in the array.
|
|
5
|
+
* @param {...(T | T[])} values - The values and/or arrays to concatenate.
|
|
6
|
+
* @returns {T[]} A new array containing all the input values.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Concatenate individual values
|
|
10
|
+
* concat(1, 2, 3);
|
|
11
|
+
* // returns [1, 2, 3]
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Concatenate arrays of values
|
|
15
|
+
* concat([1, 2], [3, 4]);
|
|
16
|
+
* // returns [1, 2, 3, 4]
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Concatenate a mix of individual values and arrays
|
|
20
|
+
* concat(1, [2, 3], 4);
|
|
21
|
+
* // returns [1, 2, 3, 4]
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Concatenate nested arrays
|
|
25
|
+
* concat([1, [2, 3]], 4);
|
|
26
|
+
* // returns [1, [2, 3], 4]
|
|
27
|
+
*/
|
|
28
|
+
declare function concat<T>(...values: Array<T | readonly T[]>): T[];
|
|
29
|
+
|
|
30
|
+
export { concat };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat.mjs","sources":["../../../src/compat/array/concat.ts"],"sourcesContent":["import { flatten } from '../../array/flatten.ts';\n\n/**\n * Concatenates multiple arrays and values into a single array.\n *\n * @template T The type of elements in the array.\n * @param {...(T | T[])} values - The values and/or arrays to concatenate.\n * @returns {T[]} A new array containing all the input values.\n *\n * @example\n * // Concatenate individual values\n * concat(1, 2, 3);\n * // returns [1, 2, 3]\n *\n * @example\n * // Concatenate arrays of values\n * concat([1, 2], [3, 4]);\n * // returns [1, 2, 3, 4]\n *\n * @example\n * // Concatenate a mix of individual values and arrays\n * concat(1, [2, 3], 4);\n * // returns [1, 2, 3, 4]\n *\n * @example\n * // Concatenate nested arrays\n * concat([1, [2, 3]], 4);\n * // returns [1, [2, 3], 4]\n */\nexport function concat<T>(...values: Array<T | readonly T[]>): T[] {\n return flatten(values) as T[];\n}\n"],"names":[],"mappings":";;AA6BgB,SAAA,MAAM,CAAI,GAAG,MAA+B,EAAA;AAC1D,IAAA,OAAO,OAAO,CAAC,MAAM,CAAQ,CAAC;AAChC;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { difference as difference$1 } from '../../array/difference.mjs';
|
|
2
|
+
import { flatten } from '../../array/flatten.mjs';
|
|
3
|
+
|
|
4
|
+
function difference(arr, ...values) {
|
|
5
|
+
const arr1 = arr;
|
|
6
|
+
const arr2 = flatten(values);
|
|
7
|
+
return difference$1(arr1, arr2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { difference };
|
|
11
|
+
//# sourceMappingURL=difference.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"difference.mjs","sources":["../../../src/compat/array/difference.ts"],"sourcesContent":["import { difference as differenceToolkit } from '../../array/difference.ts';\nimport { flatten } from '../../array/flatten.ts';\n\nexport function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[] {\n const arr1 = arr;\n const arr2 = flatten(values);\n\n return differenceToolkit(arr1, arr2);\n}"],"names":["differenceToolkit"],"mappings":";;;SAGgB,UAAU,CAAI,GAAiB,EAAE,GAAG,MAA2B,EAAA;IAC7E,MAAM,IAAI,GAAG,GAAG,CAAC;AACjB,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,IAAA,OAAOA,YAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACvC;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fills elements of an array with a specified value from the start position up to, but not including, the end position.
|
|
3
|
+
*
|
|
4
|
+
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
|
|
5
|
+
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
|
|
6
|
+
* entire array.
|
|
7
|
+
*
|
|
8
|
+
* @template T, U, S, V
|
|
9
|
+
* @param {Array<T | U>} array - The array to fill.
|
|
10
|
+
* @param {U} value - The value to fill the array with.
|
|
11
|
+
* @param {S} [start=0] - The start position. Defaults to 0.
|
|
12
|
+
* @param {V} [end=arr.length] - The end position. Defaults to the array's length.
|
|
13
|
+
* @returns {Array<T | U>} The array with the filled values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const array = [1, 2, 3];
|
|
17
|
+
* const result = fill(array, 'a');
|
|
18
|
+
* // => ['a', 'a', 'a']
|
|
19
|
+
*
|
|
20
|
+
* const result = fill(Array(3), 2);
|
|
21
|
+
* // => [2, 2, 2]
|
|
22
|
+
*
|
|
23
|
+
* const result = fill([4, 6, 8, 10], '*', 1, 3);
|
|
24
|
+
* // => [4, '*', '*', 10]
|
|
25
|
+
*
|
|
26
|
+
* const result = fill(array, '*', -2, -1);
|
|
27
|
+
* // => [1, '*', 3]
|
|
28
|
+
*/
|
|
29
|
+
declare function fill<T>(array: unknown[], value?: T): T[];
|
|
30
|
+
declare function fill<T, U, S>(array: Array<T | U>, value: U, start: S): Array<T | U>;
|
|
31
|
+
declare function fill<T, U, S, V>(array: Array<T | U>, value: U, start: S, end: V): Array<T | U>;
|
|
32
|
+
|
|
33
|
+
export { fill };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fills elements of an array with a specified value from the start position up to, but not including, the end position.
|
|
3
|
+
*
|
|
4
|
+
* This function mutates the original array and replaces its elements with the provided value, starting from the specified
|
|
5
|
+
* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the
|
|
6
|
+
* entire array.
|
|
7
|
+
*
|
|
8
|
+
* @template T, U, S, V
|
|
9
|
+
* @param {Array<T | U>} array - The array to fill.
|
|
10
|
+
* @param {U} value - The value to fill the array with.
|
|
11
|
+
* @param {S} [start=0] - The start position. Defaults to 0.
|
|
12
|
+
* @param {V} [end=arr.length] - The end position. Defaults to the array's length.
|
|
13
|
+
* @returns {Array<T | U>} The array with the filled values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const array = [1, 2, 3];
|
|
17
|
+
* const result = fill(array, 'a');
|
|
18
|
+
* // => ['a', 'a', 'a']
|
|
19
|
+
*
|
|
20
|
+
* const result = fill(Array(3), 2);
|
|
21
|
+
* // => [2, 2, 2]
|
|
22
|
+
*
|
|
23
|
+
* const result = fill([4, 6, 8, 10], '*', 1, 3);
|
|
24
|
+
* // => [4, '*', '*', 10]
|
|
25
|
+
*
|
|
26
|
+
* const result = fill(array, '*', -2, -1);
|
|
27
|
+
* // => [1, '*', 3]
|
|
28
|
+
*/
|
|
29
|
+
declare function fill<T>(array: unknown[], value?: T): T[];
|
|
30
|
+
declare function fill<T, U, S>(array: Array<T | U>, value: U, start: S): Array<T | U>;
|
|
31
|
+
declare function fill<T, U, S, V>(array: Array<T | U>, value: U, start: S, end: V): Array<T | U>;
|
|
32
|
+
|
|
33
|
+
export { fill };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fill as fill$1 } from '../../array/fill.mjs';
|
|
2
|
+
|
|
3
|
+
function fill(array, value, start = 0, end = array.length) {
|
|
4
|
+
start = Math.floor(start);
|
|
5
|
+
end = Math.floor(end);
|
|
6
|
+
if (!start) {
|
|
7
|
+
start = 0;
|
|
8
|
+
}
|
|
9
|
+
if (!end) {
|
|
10
|
+
end = 0;
|
|
11
|
+
}
|
|
12
|
+
return fill$1(array, value, start, end);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { fill };
|
|
16
|
+
//# sourceMappingURL=fill.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fill.mjs","sources":["../../../src/compat/array/fill.ts"],"sourcesContent":["import { fill as fillToolkit } from '../../array/fill.ts';\n\n/**\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 * @template T, U, S, V\n * @param {Array<T | U>} array - The array to fill.\n * @param {U} value - The value to fill the array with.\n * @param {S} [start=0] - The start position. Defaults to 0.\n * @param {V} [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, S>(array: Array<T | U>, value: U, start: S): Array<T | U>;\nexport function fill<T, U, S, V>(array: Array<T | U>, value: U, start: S, end: V): Array<T | U>;\nexport function fill<T, U>(array: Array<T | U>, value: U, start = 0, end = array.length): Array<T | U> {\n start = Math.floor(start);\n end = Math.floor(end);\n\n if (!start) {\n start = 0;\n }\n if (!end) {\n end = 0;\n }\n\n return fillToolkit(array, value, start, end);\n}\n"],"names":["fillToolkit"],"mappings":";;AAiCgB,SAAA,IAAI,CAAO,KAAmB,EAAE,KAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,EAAA;AACrF,IAAA,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1B,IAAA,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtB,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,CAAC,CAAC;KACX;IACD,IAAI,CAAC,GAAG,EAAE;QACR,GAAG,GAAG,CAAC,CAAC;KACT;IAED,OAAOA,MAAW,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/C;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a deeply nested object given arrays of paths and values.
|
|
3
|
+
*
|
|
4
|
+
* This function takes two arrays: one containing arrays of property paths, and the other containing corresponding values.
|
|
5
|
+
* It returns a new object where paths from the first array are used as key paths to set values, with corresponding elements from the second array as values.
|
|
6
|
+
* Paths can be dot-separated strings or arrays of property names.
|
|
7
|
+
*
|
|
8
|
+
* If the `keys` array is longer than the `values` array, the remaining keys will have `undefined` as their values.
|
|
9
|
+
*
|
|
10
|
+
* @template V - The type of elements in the array.
|
|
11
|
+
* @param {P[] | P[][]} keys - An array of property paths, each path can be a dot-separated string or an array of property names.
|
|
12
|
+
* @param {V[]} values - An array of values corresponding to the property paths.
|
|
13
|
+
* @returns {object} A new object composed of the given property paths and values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const paths = ['a.b.c', 'd.e.f'];
|
|
17
|
+
* const values = [1, 2];
|
|
18
|
+
* const result = zipObjectDeep(paths, values);
|
|
19
|
+
* // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const paths = [['a', 'b', 'c'], ['d', 'e', 'f']];
|
|
23
|
+
* const values = [1, 2];
|
|
24
|
+
* const result = zipObjectDeep(paths, values);
|
|
25
|
+
* // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const paths = ['a.b[0].c', 'a.b[1].d'];
|
|
29
|
+
* const values = [1, 2];
|
|
30
|
+
* const result = zipObjectDeep(paths, values);
|
|
31
|
+
* // result will be { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
|
|
32
|
+
*/
|
|
33
|
+
declare function zipObjectDeep<P extends PropertyKey, V>(keys: P[] | P[][], values: V[]): {
|
|
34
|
+
[K in P]: V;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { zipObjectDeep };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a deeply nested object given arrays of paths and values.
|
|
3
|
+
*
|
|
4
|
+
* This function takes two arrays: one containing arrays of property paths, and the other containing corresponding values.
|
|
5
|
+
* It returns a new object where paths from the first array are used as key paths to set values, with corresponding elements from the second array as values.
|
|
6
|
+
* Paths can be dot-separated strings or arrays of property names.
|
|
7
|
+
*
|
|
8
|
+
* If the `keys` array is longer than the `values` array, the remaining keys will have `undefined` as their values.
|
|
9
|
+
*
|
|
10
|
+
* @template V - The type of elements in the array.
|
|
11
|
+
* @param {P[] | P[][]} keys - An array of property paths, each path can be a dot-separated string or an array of property names.
|
|
12
|
+
* @param {V[]} values - An array of values corresponding to the property paths.
|
|
13
|
+
* @returns {object} A new object composed of the given property paths and values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const paths = ['a.b.c', 'd.e.f'];
|
|
17
|
+
* const values = [1, 2];
|
|
18
|
+
* const result = zipObjectDeep(paths, values);
|
|
19
|
+
* // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const paths = [['a', 'b', 'c'], ['d', 'e', 'f']];
|
|
23
|
+
* const values = [1, 2];
|
|
24
|
+
* const result = zipObjectDeep(paths, values);
|
|
25
|
+
* // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const paths = ['a.b[0].c', 'a.b[1].d'];
|
|
29
|
+
* const values = [1, 2];
|
|
30
|
+
* const result = zipObjectDeep(paths, values);
|
|
31
|
+
* // result will be { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
|
|
32
|
+
*/
|
|
33
|
+
declare function zipObjectDeep<P extends PropertyKey, V>(keys: P[] | P[][], values: V[]): {
|
|
34
|
+
[K in P]: V;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { zipObjectDeep };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { zip } from '../../array/zip.mjs';
|
|
2
|
+
import { set } from '../object/set.mjs';
|
|
3
|
+
|
|
4
|
+
function zipObjectDeep(keys, values) {
|
|
5
|
+
const result = {};
|
|
6
|
+
const zipped = zip(keys, values);
|
|
7
|
+
for (let i = 0; i < zipped.length; i++) {
|
|
8
|
+
const [key, value] = zipped[i];
|
|
9
|
+
if (key != null) {
|
|
10
|
+
set(result, key, value);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { zipObjectDeep };
|
|
17
|
+
//# sourceMappingURL=zipObjectDeep.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipObjectDeep.mjs","sources":["../../../src/compat/array/zipObjectDeep.ts"],"sourcesContent":["import { zip } from \"../../array/zip.ts\";\nimport { set } from \"../object/set.ts\";\n\n/**\n * Creates a deeply nested object given arrays of paths and values.\n *\n * This function takes two arrays: one containing arrays of property paths, and the other containing corresponding values.\n * It returns a new object where paths from the first array are used as key paths to set values, with corresponding elements from the second array as values.\n * Paths can be dot-separated strings or arrays of property names.\n * \n * If the `keys` array is longer than the `values` array, the remaining keys will have `undefined` as their values.\n *\n * @template V - The type of elements in the array.\n * @param {P[] | P[][]} keys - An array of property paths, each path can be a dot-separated string or an array of property names.\n * @param {V[]} values - An array of values corresponding to the property paths.\n * @returns {object} A new object composed of the given property paths and values.\n *\n * @example\n * const paths = ['a.b.c', 'd.e.f'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n *\n * @example\n * const paths = [['a', 'b', 'c'], ['d', 'e', 'f']];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { a: { b: { c: 1 } }, d: { e: { f: 2 } } }\n * \n * @example\n * const paths = ['a.b[0].c', 'a.b[1].d'];\n * const values = [1, 2];\n * const result = zipObjectDeep(paths, values);\n * // result will be { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\nexport function zipObjectDeep<P extends PropertyKey, V>(keys: P[] | P[][], values: V[]): { [K in P]: V } {\n const result = {} as { [K in P]: V };\n const zipped = zip<P | P[], V>(keys, values);\n\n for (let i = 0; i < zipped.length; i++) {\n const [key, value] = zipped[i];\n\n if (key != null) {\n set(result, key, value);\n }\n }\n\n return result;\n}\n"],"names":[],"mappings":";;;AAmCgB,SAAA,aAAa,CAA2B,IAAiB,EAAE,MAAW,EAAA;IACpF,MAAM,MAAM,GAAG,EAAqB,CAAC;IACrC,MAAM,MAAM,GAAG,GAAG,CAAa,IAAI,EAAE,MAAM,CAAC,CAAC;AAE7C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAE/B,QAAA,IAAI,GAAG,IAAI,IAAI,EAAE;AACf,YAAA,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;SACzB;KACF;AAED,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"}
|