es-toolkit 1.48.1 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/array/chunkBy.d.mts +32 -0
- package/dist/array/chunkBy.d.ts +32 -0
- package/dist/array/chunkBy.js +42 -0
- package/dist/array/chunkBy.mjs +42 -0
- package/dist/array/index.d.mts +2 -1
- package/dist/array/index.d.ts +2 -1
- package/dist/array/index.js +2 -0
- package/dist/array/index.mjs +2 -1
- package/dist/array/take.d.mts +1 -7
- package/dist/array/take.d.ts +1 -7
- package/dist/array/take.js +1 -9
- package/dist/array/take.mjs +1 -9
- package/dist/array/takeRight.d.mts +2 -2
- package/dist/array/takeRight.d.ts +2 -2
- package/dist/array/takeRight.js +2 -4
- package/dist/array/takeRight.mjs +2 -4
- package/dist/array/windowed.d.mts +1 -1
- package/dist/array/windowed.d.ts +1 -1
- package/dist/browser.global.js +3 -3
- package/dist/compat/array/chunk.js +4 -2
- package/dist/compat/array/chunk.mjs +4 -2
- package/dist/compat/array/differenceBy.js +5 -5
- package/dist/compat/array/differenceBy.mjs +5 -5
- package/dist/compat/array/drop.d.mts +2 -3
- package/dist/compat/array/drop.d.ts +2 -3
- package/dist/compat/array/drop.js +4 -4
- package/dist/compat/array/drop.mjs +4 -4
- package/dist/compat/array/dropRight.js +1 -1
- package/dist/compat/array/dropRight.mjs +1 -1
- package/dist/compat/array/dropRightWhile.d.mts +1 -1
- package/dist/compat/array/dropRightWhile.d.ts +1 -1
- package/dist/compat/array/dropRightWhile.js +5 -4
- package/dist/compat/array/dropRightWhile.mjs +5 -4
- package/dist/compat/array/dropWhile.d.mts +2 -2
- package/dist/compat/array/dropWhile.d.ts +2 -2
- package/dist/compat/array/dropWhile.js +4 -4
- package/dist/compat/array/dropWhile.mjs +4 -4
- package/dist/compat/array/findLast.js +1 -1
- package/dist/compat/array/findLast.mjs +1 -1
- package/dist/compat/array/includes.js +1 -1
- package/dist/compat/array/includes.mjs +1 -1
- package/dist/compat/array/nth.js +1 -1
- package/dist/compat/array/nth.mjs +1 -1
- package/dist/compat/array/slice.js +1 -1
- package/dist/compat/array/slice.mjs +1 -1
- package/dist/compat/array/sortedIndexBy.js +1 -1
- package/dist/compat/array/sortedIndexBy.mjs +1 -1
- package/dist/compat/array/take.js +2 -2
- package/dist/compat/array/take.mjs +2 -2
- package/dist/compat/array/takeRight.js +1 -1
- package/dist/compat/array/takeRight.mjs +1 -1
- package/dist/compat/compat.js +4 -4
- package/dist/compat/compat.mjs +4 -4
- package/dist/compat/index.js +4 -4
- package/dist/compat/index.mjs +4 -4
- package/dist/compat/math/add.js +1 -1
- package/dist/compat/math/add.mjs +1 -1
- package/dist/compat/math/divide.js +1 -1
- package/dist/compat/math/divide.mjs +1 -1
- package/dist/compat/math/multiply.js +1 -1
- package/dist/compat/math/multiply.mjs +1 -1
- package/dist/compat/math/random.js +3 -1
- package/dist/compat/math/random.mjs +3 -1
- package/dist/compat/math/subtract.js +1 -1
- package/dist/compat/math/subtract.mjs +1 -1
- package/dist/compat/object/get.js +1 -1
- package/dist/compat/object/get.mjs +1 -1
- package/dist/compat/object/omitBy.js +1 -1
- package/dist/compat/object/omitBy.mjs +1 -1
- package/dist/compat/object/pick.js +1 -1
- package/dist/compat/object/pick.mjs +1 -1
- package/dist/compat/object/pickBy.js +1 -1
- package/dist/compat/object/pickBy.mjs +1 -1
- package/dist/compat/string/repeat.js +1 -1
- package/dist/compat/string/repeat.mjs +1 -1
- package/dist/fp/_internal/lazy.js +58 -0
- package/dist/fp/_internal/lazy.mjs +57 -0
- package/dist/fp/array/at.d.mts +20 -0
- package/dist/fp/array/at.d.ts +20 -0
- package/dist/fp/array/at.js +25 -0
- package/dist/fp/array/at.mjs +25 -0
- package/dist/fp/array/cartesianProduct.d.mts +61 -0
- package/dist/fp/array/cartesianProduct.d.ts +61 -0
- package/dist/fp/array/cartesianProduct.js +9 -0
- package/dist/fp/array/cartesianProduct.mjs +9 -0
- package/dist/fp/array/chunk.d.mts +19 -0
- package/dist/fp/array/chunk.d.ts +19 -0
- package/dist/fp/array/chunk.js +24 -0
- package/dist/fp/array/chunk.mjs +24 -0
- package/dist/fp/array/chunkBy.d.mts +20 -0
- package/dist/fp/array/chunkBy.d.ts +20 -0
- package/dist/fp/array/chunkBy.js +25 -0
- package/dist/fp/array/chunkBy.mjs +25 -0
- package/dist/fp/array/combinations.d.mts +21 -0
- package/dist/fp/array/combinations.d.ts +21 -0
- package/dist/fp/array/combinations.js +26 -0
- package/dist/fp/array/combinations.mjs +26 -0
- package/dist/fp/array/compact.d.mts +22 -0
- package/dist/fp/array/compact.d.ts +22 -0
- package/dist/fp/array/compact.js +31 -0
- package/dist/fp/array/compact.mjs +30 -0
- package/dist/fp/array/countBy.d.mts +21 -0
- package/dist/fp/array/countBy.d.ts +21 -0
- package/dist/fp/array/countBy.js +26 -0
- package/dist/fp/array/countBy.mjs +26 -0
- package/dist/fp/array/difference.d.mts +21 -0
- package/dist/fp/array/difference.d.ts +21 -0
- package/dist/fp/array/difference.js +32 -0
- package/dist/fp/array/difference.mjs +31 -0
- package/dist/fp/array/differenceBy.d.mts +22 -0
- package/dist/fp/array/differenceBy.d.ts +22 -0
- package/dist/fp/array/differenceBy.js +33 -0
- package/dist/fp/array/differenceBy.mjs +32 -0
- package/dist/fp/array/differenceWith.d.mts +22 -0
- package/dist/fp/array/differenceWith.d.ts +22 -0
- package/dist/fp/array/differenceWith.js +32 -0
- package/dist/fp/array/differenceWith.mjs +31 -0
- package/dist/fp/array/drop.d.mts +20 -0
- package/dist/fp/array/drop.d.ts +20 -0
- package/dist/fp/array/drop.js +31 -0
- package/dist/fp/array/drop.mjs +30 -0
- package/dist/fp/array/dropRight.d.mts +20 -0
- package/dist/fp/array/dropRight.d.ts +20 -0
- package/dist/fp/array/dropRight.js +25 -0
- package/dist/fp/array/dropRight.mjs +25 -0
- package/dist/fp/array/dropRightWhile.d.mts +20 -0
- package/dist/fp/array/dropRightWhile.d.ts +20 -0
- package/dist/fp/array/dropRightWhile.js +25 -0
- package/dist/fp/array/dropRightWhile.mjs +25 -0
- package/dist/fp/array/dropWhile.d.mts +20 -0
- package/dist/fp/array/dropWhile.d.ts +20 -0
- package/dist/fp/array/dropWhile.js +36 -0
- package/dist/fp/array/dropWhile.mjs +36 -0
- package/dist/fp/array/filter.d.mts +45 -0
- package/dist/fp/array/filter.d.ts +45 -0
- package/dist/fp/array/filter.js +13 -0
- package/dist/fp/array/filter.mjs +12 -0
- package/dist/fp/array/find.d.mts +39 -0
- package/dist/fp/array/find.d.ts +39 -0
- package/dist/fp/array/find.js +8 -0
- package/dist/fp/array/find.mjs +8 -0
- package/dist/fp/array/findIndex.d.mts +20 -0
- package/dist/fp/array/findIndex.d.ts +20 -0
- package/dist/fp/array/findIndex.js +24 -0
- package/dist/fp/array/findIndex.mjs +24 -0
- package/dist/fp/array/findLast.d.mts +39 -0
- package/dist/fp/array/findLast.d.ts +39 -0
- package/dist/fp/array/findLast.js +11 -0
- package/dist/fp/array/findLast.mjs +11 -0
- package/dist/fp/array/findLastIndex.d.mts +20 -0
- package/dist/fp/array/findLastIndex.d.ts +20 -0
- package/dist/fp/array/findLastIndex.js +25 -0
- package/dist/fp/array/findLastIndex.mjs +25 -0
- package/dist/fp/array/flatMap.d.mts +28 -0
- package/dist/fp/array/flatMap.d.ts +28 -0
- package/dist/fp/array/flatMap.js +39 -0
- package/dist/fp/array/flatMap.mjs +38 -0
- package/dist/fp/array/flatMapDeep.d.mts +23 -0
- package/dist/fp/array/flatMapDeep.d.ts +23 -0
- package/dist/fp/array/flatMapDeep.js +38 -0
- package/dist/fp/array/flatMapDeep.mjs +37 -0
- package/dist/fp/array/flatten.d.mts +21 -0
- package/dist/fp/array/flatten.d.ts +21 -0
- package/dist/fp/array/flatten.js +39 -0
- package/dist/fp/array/flatten.mjs +38 -0
- package/dist/fp/array/flattenDeep.d.mts +21 -0
- package/dist/fp/array/flattenDeep.d.ts +21 -0
- package/dist/fp/array/flattenDeep.js +36 -0
- package/dist/fp/array/flattenDeep.mjs +35 -0
- package/dist/fp/array/forEach.d.mts +22 -0
- package/dist/fp/array/forEach.d.ts +22 -0
- package/dist/fp/array/forEach.js +33 -0
- package/dist/fp/array/forEach.mjs +32 -0
- package/dist/fp/array/groupBy.d.mts +21 -0
- package/dist/fp/array/groupBy.d.ts +21 -0
- package/dist/fp/array/groupBy.js +26 -0
- package/dist/fp/array/groupBy.mjs +26 -0
- package/dist/fp/array/head.d.mts +35 -0
- package/dist/fp/array/head.d.ts +35 -0
- package/dist/fp/array/head.js +9 -0
- package/dist/fp/array/head.mjs +9 -0
- package/dist/fp/array/index.d.mts +69 -0
- package/dist/fp/array/index.d.ts +69 -0
- package/dist/fp/array/index.js +68 -0
- package/dist/fp/array/index.mjs +68 -0
- package/dist/fp/array/initial.d.mts +19 -0
- package/dist/fp/array/initial.d.ts +19 -0
- package/dist/fp/array/initial.js +24 -0
- package/dist/fp/array/initial.mjs +24 -0
- package/dist/fp/array/intersection.d.mts +21 -0
- package/dist/fp/array/intersection.d.ts +21 -0
- package/dist/fp/array/intersection.js +32 -0
- package/dist/fp/array/intersection.mjs +31 -0
- package/dist/fp/array/intersectionBy.d.mts +22 -0
- package/dist/fp/array/intersectionBy.d.ts +22 -0
- package/dist/fp/array/intersectionBy.js +33 -0
- package/dist/fp/array/intersectionBy.mjs +32 -0
- package/dist/fp/array/intersectionWith.d.mts +22 -0
- package/dist/fp/array/intersectionWith.d.ts +22 -0
- package/dist/fp/array/intersectionWith.js +32 -0
- package/dist/fp/array/intersectionWith.mjs +31 -0
- package/dist/fp/array/isSubset.d.mts +20 -0
- package/dist/fp/array/isSubset.d.ts +20 -0
- package/dist/fp/array/isSubset.js +25 -0
- package/dist/fp/array/isSubset.mjs +25 -0
- package/dist/fp/array/isSubsetWith.d.mts +21 -0
- package/dist/fp/array/isSubsetWith.d.ts +21 -0
- package/dist/fp/array/isSubsetWith.js +26 -0
- package/dist/fp/array/isSubsetWith.mjs +26 -0
- package/dist/fp/array/join.d.mts +20 -0
- package/dist/fp/array/join.d.ts +20 -0
- package/dist/fp/array/join.js +24 -0
- package/dist/fp/array/join.mjs +24 -0
- package/dist/fp/array/keyBy.d.mts +21 -0
- package/dist/fp/array/keyBy.d.ts +21 -0
- package/dist/fp/array/keyBy.js +26 -0
- package/dist/fp/array/keyBy.mjs +26 -0
- package/dist/fp/array/last.d.mts +35 -0
- package/dist/fp/array/last.d.ts +35 -0
- package/dist/fp/array/last.js +9 -0
- package/dist/fp/array/last.mjs +9 -0
- package/dist/fp/array/length.d.mts +18 -0
- package/dist/fp/array/length.d.ts +18 -0
- package/dist/fp/array/length.js +22 -0
- package/dist/fp/array/length.mjs +22 -0
- package/dist/fp/array/map.d.mts +27 -0
- package/dist/fp/array/map.d.ts +27 -0
- package/dist/fp/array/map.js +36 -0
- package/dist/fp/array/map.mjs +35 -0
- package/dist/fp/array/maxBy.d.mts +37 -0
- package/dist/fp/array/maxBy.d.ts +37 -0
- package/dist/fp/array/maxBy.js +9 -0
- package/dist/fp/array/maxBy.mjs +9 -0
- package/dist/fp/array/minBy.d.mts +37 -0
- package/dist/fp/array/minBy.d.ts +37 -0
- package/dist/fp/array/minBy.js +9 -0
- package/dist/fp/array/minBy.mjs +9 -0
- package/dist/fp/array/orderBy.d.mts +21 -0
- package/dist/fp/array/orderBy.d.ts +21 -0
- package/dist/fp/array/orderBy.js +26 -0
- package/dist/fp/array/orderBy.mjs +26 -0
- package/dist/fp/array/partition.d.mts +39 -0
- package/dist/fp/array/partition.d.ts +39 -0
- package/dist/fp/array/partition.js +9 -0
- package/dist/fp/array/partition.mjs +9 -0
- package/dist/fp/array/reverse.d.mts +19 -0
- package/dist/fp/array/reverse.d.ts +19 -0
- package/dist/fp/array/reverse.js +23 -0
- package/dist/fp/array/reverse.mjs +23 -0
- package/dist/fp/array/sample.d.mts +18 -0
- package/dist/fp/array/sample.d.ts +18 -0
- package/dist/fp/array/sample.js +23 -0
- package/dist/fp/array/sample.mjs +23 -0
- package/dist/fp/array/sampleSize.d.mts +20 -0
- package/dist/fp/array/sampleSize.d.ts +20 -0
- package/dist/fp/array/sampleSize.js +25 -0
- package/dist/fp/array/sampleSize.mjs +25 -0
- package/dist/fp/array/shuffle.d.mts +19 -0
- package/dist/fp/array/shuffle.d.ts +19 -0
- package/dist/fp/array/shuffle.js +24 -0
- package/dist/fp/array/shuffle.mjs +24 -0
- package/dist/fp/array/sortBy.d.mts +26 -0
- package/dist/fp/array/sortBy.d.ts +26 -0
- package/dist/fp/array/sortBy.js +31 -0
- package/dist/fp/array/sortBy.mjs +31 -0
- package/dist/fp/array/tail.d.mts +19 -0
- package/dist/fp/array/tail.d.ts +19 -0
- package/dist/fp/array/tail.js +24 -0
- package/dist/fp/array/tail.mjs +24 -0
- package/dist/fp/array/take.d.mts +26 -0
- package/dist/fp/array/take.d.ts +26 -0
- package/dist/fp/array/take.js +39 -0
- package/dist/fp/array/take.mjs +38 -0
- package/dist/fp/array/takeRight.d.mts +20 -0
- package/dist/fp/array/takeRight.d.ts +20 -0
- package/dist/fp/array/takeRight.js +25 -0
- package/dist/fp/array/takeRight.mjs +25 -0
- package/dist/fp/array/takeRightWhile.d.mts +20 -0
- package/dist/fp/array/takeRightWhile.d.ts +20 -0
- package/dist/fp/array/takeRightWhile.js +25 -0
- package/dist/fp/array/takeRightWhile.mjs +25 -0
- package/dist/fp/array/takeWhile.d.mts +21 -0
- package/dist/fp/array/takeWhile.d.ts +21 -0
- package/dist/fp/array/takeWhile.js +32 -0
- package/dist/fp/array/takeWhile.mjs +31 -0
- package/dist/fp/array/toFilled.d.mts +23 -0
- package/dist/fp/array/toFilled.d.ts +23 -0
- package/dist/fp/array/toFilled.js +30 -0
- package/dist/fp/array/toFilled.mjs +30 -0
- package/dist/fp/array/union.d.mts +20 -0
- package/dist/fp/array/union.d.ts +20 -0
- package/dist/fp/array/union.js +25 -0
- package/dist/fp/array/union.mjs +25 -0
- package/dist/fp/array/unionBy.d.mts +22 -0
- package/dist/fp/array/unionBy.d.ts +22 -0
- package/dist/fp/array/unionBy.js +27 -0
- package/dist/fp/array/unionBy.mjs +27 -0
- package/dist/fp/array/unionWith.d.mts +21 -0
- package/dist/fp/array/unionWith.d.ts +21 -0
- package/dist/fp/array/unionWith.js +26 -0
- package/dist/fp/array/unionWith.mjs +26 -0
- package/dist/fp/array/uniq.d.mts +21 -0
- package/dist/fp/array/uniq.d.ts +21 -0
- package/dist/fp/array/uniq.js +36 -0
- package/dist/fp/array/uniq.mjs +36 -0
- package/dist/fp/array/uniqBy.d.mts +21 -0
- package/dist/fp/array/uniqBy.d.ts +21 -0
- package/dist/fp/array/uniqBy.js +38 -0
- package/dist/fp/array/uniqBy.mjs +38 -0
- package/dist/fp/array/uniqWith.d.mts +20 -0
- package/dist/fp/array/uniqWith.d.ts +20 -0
- package/dist/fp/array/uniqWith.js +35 -0
- package/dist/fp/array/uniqWith.mjs +35 -0
- package/dist/fp/array/unzip.d.mts +20 -0
- package/dist/fp/array/unzip.d.ts +20 -0
- package/dist/fp/array/unzip.js +24 -0
- package/dist/fp/array/unzip.mjs +24 -0
- package/dist/fp/array/unzipWith.d.mts +21 -0
- package/dist/fp/array/unzipWith.d.ts +21 -0
- package/dist/fp/array/unzipWith.js +26 -0
- package/dist/fp/array/unzipWith.mjs +26 -0
- package/dist/fp/array/windowed.d.mts +25 -0
- package/dist/fp/array/windowed.d.ts +25 -0
- package/dist/fp/array/windowed.js +50 -0
- package/dist/fp/array/windowed.mjs +50 -0
- package/dist/fp/array/without.d.mts +19 -0
- package/dist/fp/array/without.d.ts +19 -0
- package/dist/fp/array/without.js +30 -0
- package/dist/fp/array/without.mjs +29 -0
- package/dist/fp/array/xor.d.mts +20 -0
- package/dist/fp/array/xor.d.ts +20 -0
- package/dist/fp/array/xor.js +25 -0
- package/dist/fp/array/xor.mjs +25 -0
- package/dist/fp/array/xorBy.d.mts +22 -0
- package/dist/fp/array/xorBy.d.ts +22 -0
- package/dist/fp/array/xorBy.js +27 -0
- package/dist/fp/array/xorBy.mjs +27 -0
- package/dist/fp/array/xorWith.d.mts +21 -0
- package/dist/fp/array/xorWith.d.ts +21 -0
- package/dist/fp/array/xorWith.js +26 -0
- package/dist/fp/array/xorWith.mjs +26 -0
- package/dist/fp/array/zip.d.mts +61 -0
- package/dist/fp/array/zip.d.ts +61 -0
- package/dist/fp/array/zip.js +9 -0
- package/dist/fp/array/zip.mjs +9 -0
- package/dist/fp/array/zipObject.d.mts +21 -0
- package/dist/fp/array/zipObject.d.ts +21 -0
- package/dist/fp/array/zipObject.js +26 -0
- package/dist/fp/array/zipObject.mjs +26 -0
- package/dist/fp/array/zipWith.d.mts +57 -0
- package/dist/fp/array/zipWith.d.ts +57 -0
- package/dist/fp/array/zipWith.js +9 -0
- package/dist/fp/array/zipWith.mjs +9 -0
- package/dist/fp/index.d.mts +75 -0
- package/dist/fp/index.d.ts +75 -0
- package/dist/fp/index.js +150 -0
- package/dist/fp/index.mjs +77 -0
- package/dist/fp/math/add.d.mts +17 -0
- package/dist/fp/math/add.d.ts +17 -0
- package/dist/fp/math/add.js +21 -0
- package/dist/fp/math/add.mjs +21 -0
- package/dist/fp/math/index.d.mts +2 -0
- package/dist/fp/math/index.d.ts +2 -0
- package/dist/fp/math/index.js +2 -0
- package/dist/fp/math/index.mjs +2 -0
- package/dist/fp/math/multiply.d.mts +17 -0
- package/dist/fp/math/multiply.d.ts +17 -0
- package/dist/fp/math/multiply.js +21 -0
- package/dist/fp/math/multiply.mjs +21 -0
- package/dist/fp/object/index.d.mts +2 -0
- package/dist/fp/object/index.d.ts +2 -0
- package/dist/fp/object/index.js +2 -0
- package/dist/fp/object/index.mjs +2 -0
- package/dist/fp/object/omit.d.mts +18 -0
- package/dist/fp/object/omit.d.ts +18 -0
- package/dist/fp/object/omit.js +23 -0
- package/dist/fp/object/omit.mjs +23 -0
- package/dist/fp/object/pick.d.mts +19 -0
- package/dist/fp/object/pick.d.ts +19 -0
- package/dist/fp/object/pick.js +24 -0
- package/dist/fp/object/pick.mjs +24 -0
- package/dist/fp/pipe.d.mts +235 -0
- package/dist/fp/pipe.d.ts +235 -0
- package/dist/fp/pipe.js +116 -0
- package/dist/fp/pipe.mjs +116 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -0
- package/dist/index.mjs +3 -1
- package/dist/predicate/index.d.mts +2 -1
- package/dist/predicate/index.d.ts +2 -1
- package/dist/predicate/index.js +2 -0
- package/dist/predicate/index.mjs +2 -1
- package/dist/predicate/isIterable.d.mts +26 -0
- package/dist/predicate/isIterable.d.ts +26 -0
- package/dist/predicate/isIterable.js +28 -0
- package/dist/predicate/isIterable.mjs +28 -0
- package/dist/string/trimStart.js +1 -0
- package/dist/string/trimStart.mjs +1 -0
- package/fp.d.ts +1 -0
- package/fp.js +1 -0
- package/package.json +22 -1
package/dist/fp/index.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_at = require("./array/at.js");
|
|
3
|
+
const require_cartesianProduct = require("./array/cartesianProduct.js");
|
|
4
|
+
const require_chunk = require("./array/chunk.js");
|
|
5
|
+
const require_chunkBy = require("./array/chunkBy.js");
|
|
6
|
+
const require_combinations = require("./array/combinations.js");
|
|
7
|
+
const require_compact = require("./array/compact.js");
|
|
8
|
+
const require_countBy = require("./array/countBy.js");
|
|
9
|
+
const require_difference = require("./array/difference.js");
|
|
10
|
+
const require_differenceBy = require("./array/differenceBy.js");
|
|
11
|
+
const require_differenceWith = require("./array/differenceWith.js");
|
|
12
|
+
const require_drop = require("./array/drop.js");
|
|
13
|
+
const require_dropRight = require("./array/dropRight.js");
|
|
14
|
+
const require_dropRightWhile = require("./array/dropRightWhile.js");
|
|
15
|
+
const require_dropWhile = require("./array/dropWhile.js");
|
|
16
|
+
const require_filter = require("./array/filter.js");
|
|
17
|
+
const require_find = require("./array/find.js");
|
|
18
|
+
const require_findIndex = require("./array/findIndex.js");
|
|
19
|
+
const require_findLast = require("./array/findLast.js");
|
|
20
|
+
const require_findLastIndex = require("./array/findLastIndex.js");
|
|
21
|
+
const require_flatMap = require("./array/flatMap.js");
|
|
22
|
+
const require_flatMapDeep = require("./array/flatMapDeep.js");
|
|
23
|
+
const require_flatten = require("./array/flatten.js");
|
|
24
|
+
const require_flattenDeep = require("./array/flattenDeep.js");
|
|
25
|
+
const require_forEach = require("./array/forEach.js");
|
|
26
|
+
const require_groupBy = require("./array/groupBy.js");
|
|
27
|
+
const require_head = require("./array/head.js");
|
|
28
|
+
const require_initial = require("./array/initial.js");
|
|
29
|
+
const require_intersection = require("./array/intersection.js");
|
|
30
|
+
const require_intersectionBy = require("./array/intersectionBy.js");
|
|
31
|
+
const require_intersectionWith = require("./array/intersectionWith.js");
|
|
32
|
+
const require_isSubset = require("./array/isSubset.js");
|
|
33
|
+
const require_isSubsetWith = require("./array/isSubsetWith.js");
|
|
34
|
+
const require_join = require("./array/join.js");
|
|
35
|
+
const require_keyBy = require("./array/keyBy.js");
|
|
36
|
+
const require_last = require("./array/last.js");
|
|
37
|
+
const require_length = require("./array/length.js");
|
|
38
|
+
const require_map = require("./array/map.js");
|
|
39
|
+
const require_maxBy = require("./array/maxBy.js");
|
|
40
|
+
const require_minBy = require("./array/minBy.js");
|
|
41
|
+
const require_orderBy = require("./array/orderBy.js");
|
|
42
|
+
const require_partition = require("./array/partition.js");
|
|
43
|
+
const require_reverse = require("./array/reverse.js");
|
|
44
|
+
const require_sample = require("./array/sample.js");
|
|
45
|
+
const require_sampleSize = require("./array/sampleSize.js");
|
|
46
|
+
const require_shuffle = require("./array/shuffle.js");
|
|
47
|
+
const require_sortBy = require("./array/sortBy.js");
|
|
48
|
+
const require_tail = require("./array/tail.js");
|
|
49
|
+
const require_take = require("./array/take.js");
|
|
50
|
+
const require_takeRight = require("./array/takeRight.js");
|
|
51
|
+
const require_takeRightWhile = require("./array/takeRightWhile.js");
|
|
52
|
+
const require_takeWhile = require("./array/takeWhile.js");
|
|
53
|
+
const require_toFilled = require("./array/toFilled.js");
|
|
54
|
+
const require_union = require("./array/union.js");
|
|
55
|
+
const require_unionBy = require("./array/unionBy.js");
|
|
56
|
+
const require_unionWith = require("./array/unionWith.js");
|
|
57
|
+
const require_uniq = require("./array/uniq.js");
|
|
58
|
+
const require_uniqBy = require("./array/uniqBy.js");
|
|
59
|
+
const require_uniqWith = require("./array/uniqWith.js");
|
|
60
|
+
const require_unzip = require("./array/unzip.js");
|
|
61
|
+
const require_unzipWith = require("./array/unzipWith.js");
|
|
62
|
+
const require_windowed = require("./array/windowed.js");
|
|
63
|
+
const require_without = require("./array/without.js");
|
|
64
|
+
const require_xor = require("./array/xor.js");
|
|
65
|
+
const require_xorBy = require("./array/xorBy.js");
|
|
66
|
+
const require_xorWith = require("./array/xorWith.js");
|
|
67
|
+
const require_zip = require("./array/zip.js");
|
|
68
|
+
const require_zipObject = require("./array/zipObject.js");
|
|
69
|
+
const require_zipWith = require("./array/zipWith.js");
|
|
70
|
+
require("./array/index.js");
|
|
71
|
+
const require_add = require("./math/add.js");
|
|
72
|
+
const require_multiply = require("./math/multiply.js");
|
|
73
|
+
require("./math/index.js");
|
|
74
|
+
const require_omit = require("./object/omit.js");
|
|
75
|
+
const require_pick = require("./object/pick.js");
|
|
76
|
+
require("./object/index.js");
|
|
77
|
+
const require_pipe = require("./pipe.js");
|
|
78
|
+
exports.add = require_add.add;
|
|
79
|
+
exports.at = require_at.at;
|
|
80
|
+
exports.cartesianProduct = require_cartesianProduct.cartesianProduct;
|
|
81
|
+
exports.chunk = require_chunk.chunk;
|
|
82
|
+
exports.chunkBy = require_chunkBy.chunkBy;
|
|
83
|
+
exports.combinations = require_combinations.combinations;
|
|
84
|
+
exports.compact = require_compact.compact;
|
|
85
|
+
exports.countBy = require_countBy.countBy;
|
|
86
|
+
exports.difference = require_difference.difference;
|
|
87
|
+
exports.differenceBy = require_differenceBy.differenceBy;
|
|
88
|
+
exports.differenceWith = require_differenceWith.differenceWith;
|
|
89
|
+
exports.drop = require_drop.drop;
|
|
90
|
+
exports.dropRight = require_dropRight.dropRight;
|
|
91
|
+
exports.dropRightWhile = require_dropRightWhile.dropRightWhile;
|
|
92
|
+
exports.dropWhile = require_dropWhile.dropWhile;
|
|
93
|
+
exports.filter = require_filter.filter;
|
|
94
|
+
exports.find = require_find.find;
|
|
95
|
+
exports.findIndex = require_findIndex.findIndex;
|
|
96
|
+
exports.findLast = require_findLast.findLast;
|
|
97
|
+
exports.findLastIndex = require_findLastIndex.findLastIndex;
|
|
98
|
+
exports.flatMap = require_flatMap.flatMap;
|
|
99
|
+
exports.flatMapDeep = require_flatMapDeep.flatMapDeep;
|
|
100
|
+
exports.flatten = require_flatten.flatten;
|
|
101
|
+
exports.flattenDeep = require_flattenDeep.flattenDeep;
|
|
102
|
+
exports.forEach = require_forEach.forEach;
|
|
103
|
+
exports.groupBy = require_groupBy.groupBy;
|
|
104
|
+
exports.head = require_head.head;
|
|
105
|
+
exports.initial = require_initial.initial;
|
|
106
|
+
exports.intersection = require_intersection.intersection;
|
|
107
|
+
exports.intersectionBy = require_intersectionBy.intersectionBy;
|
|
108
|
+
exports.intersectionWith = require_intersectionWith.intersectionWith;
|
|
109
|
+
exports.isSubset = require_isSubset.isSubset;
|
|
110
|
+
exports.isSubsetWith = require_isSubsetWith.isSubsetWith;
|
|
111
|
+
exports.join = require_join.join;
|
|
112
|
+
exports.keyBy = require_keyBy.keyBy;
|
|
113
|
+
exports.last = require_last.last;
|
|
114
|
+
exports.length = require_length.length;
|
|
115
|
+
exports.map = require_map.map;
|
|
116
|
+
exports.maxBy = require_maxBy.maxBy;
|
|
117
|
+
exports.minBy = require_minBy.minBy;
|
|
118
|
+
exports.multiply = require_multiply.multiply;
|
|
119
|
+
exports.omit = require_omit.omit;
|
|
120
|
+
exports.orderBy = require_orderBy.orderBy;
|
|
121
|
+
exports.partition = require_partition.partition;
|
|
122
|
+
exports.pick = require_pick.pick;
|
|
123
|
+
exports.pipe = require_pipe.pipe;
|
|
124
|
+
exports.reverse = require_reverse.reverse;
|
|
125
|
+
exports.sample = require_sample.sample;
|
|
126
|
+
exports.sampleSize = require_sampleSize.sampleSize;
|
|
127
|
+
exports.shuffle = require_shuffle.shuffle;
|
|
128
|
+
exports.sortBy = require_sortBy.sortBy;
|
|
129
|
+
exports.tail = require_tail.tail;
|
|
130
|
+
exports.take = require_take.take;
|
|
131
|
+
exports.takeRight = require_takeRight.takeRight;
|
|
132
|
+
exports.takeRightWhile = require_takeRightWhile.takeRightWhile;
|
|
133
|
+
exports.takeWhile = require_takeWhile.takeWhile;
|
|
134
|
+
exports.toFilled = require_toFilled.toFilled;
|
|
135
|
+
exports.union = require_union.union;
|
|
136
|
+
exports.unionBy = require_unionBy.unionBy;
|
|
137
|
+
exports.unionWith = require_unionWith.unionWith;
|
|
138
|
+
exports.uniq = require_uniq.uniq;
|
|
139
|
+
exports.uniqBy = require_uniqBy.uniqBy;
|
|
140
|
+
exports.uniqWith = require_uniqWith.uniqWith;
|
|
141
|
+
exports.unzip = require_unzip.unzip;
|
|
142
|
+
exports.unzipWith = require_unzipWith.unzipWith;
|
|
143
|
+
exports.windowed = require_windowed.windowed;
|
|
144
|
+
exports.without = require_without.without;
|
|
145
|
+
exports.xor = require_xor.xor;
|
|
146
|
+
exports.xorBy = require_xorBy.xorBy;
|
|
147
|
+
exports.xorWith = require_xorWith.xorWith;
|
|
148
|
+
exports.zip = require_zip.zip;
|
|
149
|
+
exports.zipObject = require_zipObject.zipObject;
|
|
150
|
+
exports.zipWith = require_zipWith.zipWith;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { at } from "./array/at.mjs";
|
|
2
|
+
import { cartesianProduct } from "./array/cartesianProduct.mjs";
|
|
3
|
+
import { chunk } from "./array/chunk.mjs";
|
|
4
|
+
import { chunkBy } from "./array/chunkBy.mjs";
|
|
5
|
+
import { combinations } from "./array/combinations.mjs";
|
|
6
|
+
import { compact } from "./array/compact.mjs";
|
|
7
|
+
import { countBy } from "./array/countBy.mjs";
|
|
8
|
+
import { difference } from "./array/difference.mjs";
|
|
9
|
+
import { differenceBy } from "./array/differenceBy.mjs";
|
|
10
|
+
import { differenceWith } from "./array/differenceWith.mjs";
|
|
11
|
+
import { drop } from "./array/drop.mjs";
|
|
12
|
+
import { dropRight } from "./array/dropRight.mjs";
|
|
13
|
+
import { dropRightWhile } from "./array/dropRightWhile.mjs";
|
|
14
|
+
import { dropWhile } from "./array/dropWhile.mjs";
|
|
15
|
+
import { filter } from "./array/filter.mjs";
|
|
16
|
+
import { find } from "./array/find.mjs";
|
|
17
|
+
import { findIndex } from "./array/findIndex.mjs";
|
|
18
|
+
import { findLast } from "./array/findLast.mjs";
|
|
19
|
+
import { findLastIndex } from "./array/findLastIndex.mjs";
|
|
20
|
+
import { flatMap } from "./array/flatMap.mjs";
|
|
21
|
+
import { flatMapDeep } from "./array/flatMapDeep.mjs";
|
|
22
|
+
import { flatten } from "./array/flatten.mjs";
|
|
23
|
+
import { flattenDeep } from "./array/flattenDeep.mjs";
|
|
24
|
+
import { forEach } from "./array/forEach.mjs";
|
|
25
|
+
import { groupBy } from "./array/groupBy.mjs";
|
|
26
|
+
import { head } from "./array/head.mjs";
|
|
27
|
+
import { initial } from "./array/initial.mjs";
|
|
28
|
+
import { intersection } from "./array/intersection.mjs";
|
|
29
|
+
import { intersectionBy } from "./array/intersectionBy.mjs";
|
|
30
|
+
import { intersectionWith } from "./array/intersectionWith.mjs";
|
|
31
|
+
import { isSubset } from "./array/isSubset.mjs";
|
|
32
|
+
import { isSubsetWith } from "./array/isSubsetWith.mjs";
|
|
33
|
+
import { join } from "./array/join.mjs";
|
|
34
|
+
import { keyBy } from "./array/keyBy.mjs";
|
|
35
|
+
import { last } from "./array/last.mjs";
|
|
36
|
+
import { length } from "./array/length.mjs";
|
|
37
|
+
import { map } from "./array/map.mjs";
|
|
38
|
+
import { maxBy } from "./array/maxBy.mjs";
|
|
39
|
+
import { minBy } from "./array/minBy.mjs";
|
|
40
|
+
import { orderBy } from "./array/orderBy.mjs";
|
|
41
|
+
import { partition } from "./array/partition.mjs";
|
|
42
|
+
import { reverse } from "./array/reverse.mjs";
|
|
43
|
+
import { sample } from "./array/sample.mjs";
|
|
44
|
+
import { sampleSize } from "./array/sampleSize.mjs";
|
|
45
|
+
import { shuffle } from "./array/shuffle.mjs";
|
|
46
|
+
import { sortBy } from "./array/sortBy.mjs";
|
|
47
|
+
import { tail } from "./array/tail.mjs";
|
|
48
|
+
import { take } from "./array/take.mjs";
|
|
49
|
+
import { takeRight } from "./array/takeRight.mjs";
|
|
50
|
+
import { takeRightWhile } from "./array/takeRightWhile.mjs";
|
|
51
|
+
import { takeWhile } from "./array/takeWhile.mjs";
|
|
52
|
+
import { toFilled } from "./array/toFilled.mjs";
|
|
53
|
+
import { union } from "./array/union.mjs";
|
|
54
|
+
import { unionBy } from "./array/unionBy.mjs";
|
|
55
|
+
import { unionWith } from "./array/unionWith.mjs";
|
|
56
|
+
import { uniq } from "./array/uniq.mjs";
|
|
57
|
+
import { uniqBy } from "./array/uniqBy.mjs";
|
|
58
|
+
import { uniqWith } from "./array/uniqWith.mjs";
|
|
59
|
+
import { unzip } from "./array/unzip.mjs";
|
|
60
|
+
import { unzipWith } from "./array/unzipWith.mjs";
|
|
61
|
+
import { windowed } from "./array/windowed.mjs";
|
|
62
|
+
import { without } from "./array/without.mjs";
|
|
63
|
+
import { xor } from "./array/xor.mjs";
|
|
64
|
+
import { xorBy } from "./array/xorBy.mjs";
|
|
65
|
+
import { xorWith } from "./array/xorWith.mjs";
|
|
66
|
+
import { zip } from "./array/zip.mjs";
|
|
67
|
+
import { zipObject } from "./array/zipObject.mjs";
|
|
68
|
+
import { zipWith } from "./array/zipWith.mjs";
|
|
69
|
+
import "./array/index.mjs";
|
|
70
|
+
import { add } from "./math/add.mjs";
|
|
71
|
+
import { multiply } from "./math/multiply.mjs";
|
|
72
|
+
import "./math/index.mjs";
|
|
73
|
+
import { omit } from "./object/omit.mjs";
|
|
74
|
+
import { pick } from "./object/pick.mjs";
|
|
75
|
+
import "./object/index.mjs";
|
|
76
|
+
import { pipe } from "./pipe.mjs";
|
|
77
|
+
export { add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/fp/math/add.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that adds `addend` to its input. Use it with {@link pipe},
|
|
4
|
+
* or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param addend - The number to add to the input.
|
|
7
|
+
* @returns A function that maps a `number` to `value + addend`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, add } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, add(2)); // => 5
|
|
13
|
+
* pipe([1, 2, 3], map(add(10))); // => [11, 12, 13]
|
|
14
|
+
*/
|
|
15
|
+
declare function add(addend: number): (value: number) => number;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { add };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/fp/math/add.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that adds `addend` to its input. Use it with {@link pipe},
|
|
4
|
+
* or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param addend - The number to add to the input.
|
|
7
|
+
* @returns A function that maps a `number` to `value + addend`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, add } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, add(2)); // => 5
|
|
13
|
+
* pipe([1, 2, 3], map(add(10))); // => [11, 12, 13]
|
|
14
|
+
*/
|
|
15
|
+
declare function add(addend: number): (value: number) => number;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { add };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/fp/math/add.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that adds `addend` to its input. Use it with {@link pipe},
|
|
4
|
+
* or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param addend - The number to add to the input.
|
|
7
|
+
* @returns A function that maps a `number` to `value + addend`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, add } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, add(2)); // => 5
|
|
13
|
+
* pipe([1, 2, 3], map(add(10))); // => [11, 12, 13]
|
|
14
|
+
*/
|
|
15
|
+
function add(addend) {
|
|
16
|
+
return function(value) {
|
|
17
|
+
return value + addend;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.add = add;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/fp/math/add.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that adds `addend` to its input. Use it with {@link pipe},
|
|
4
|
+
* or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param addend - The number to add to the input.
|
|
7
|
+
* @returns A function that maps a `number` to `value + addend`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, add } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, add(2)); // => 5
|
|
13
|
+
* pipe([1, 2, 3], map(add(10))); // => [11, 12, 13]
|
|
14
|
+
*/
|
|
15
|
+
function add(addend) {
|
|
16
|
+
return function(value) {
|
|
17
|
+
return value + addend;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { add };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/fp/math/multiply.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that multiplies its input by `multiplicand`. Use it with
|
|
4
|
+
* {@link pipe}, or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param multiplicand - The number to multiply the input by.
|
|
7
|
+
* @returns A function that maps a `number` to `value * multiplicand`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, multiply } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, multiply(2)); // => 6
|
|
13
|
+
* pipe([1, 2, 3], map(multiply(3))); // => [3, 6, 9]
|
|
14
|
+
*/
|
|
15
|
+
declare function multiply(multiplicand: number): (value: number) => number;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { multiply };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/fp/math/multiply.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that multiplies its input by `multiplicand`. Use it with
|
|
4
|
+
* {@link pipe}, or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param multiplicand - The number to multiply the input by.
|
|
7
|
+
* @returns A function that maps a `number` to `value * multiplicand`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, multiply } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, multiply(2)); // => 6
|
|
13
|
+
* pipe([1, 2, 3], map(multiply(3))); // => [3, 6, 9]
|
|
14
|
+
*/
|
|
15
|
+
declare function multiply(multiplicand: number): (value: number) => number;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { multiply };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/fp/math/multiply.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that multiplies its input by `multiplicand`. Use it with
|
|
4
|
+
* {@link pipe}, or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param multiplicand - The number to multiply the input by.
|
|
7
|
+
* @returns A function that maps a `number` to `value * multiplicand`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, multiply } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, multiply(2)); // => 6
|
|
13
|
+
* pipe([1, 2, 3], map(multiply(3))); // => [3, 6, 9]
|
|
14
|
+
*/
|
|
15
|
+
function multiply(multiplicand) {
|
|
16
|
+
return function(value) {
|
|
17
|
+
return value * multiplicand;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.multiply = multiply;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/fp/math/multiply.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that multiplies its input by `multiplicand`. Use it with
|
|
4
|
+
* {@link pipe}, or as the callback of a function such as {@link map}.
|
|
5
|
+
*
|
|
6
|
+
* @param multiplicand - The number to multiply the input by.
|
|
7
|
+
* @returns A function that maps a `number` to `value * multiplicand`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { pipe, map, multiply } from 'es-toolkit/fp';
|
|
11
|
+
*
|
|
12
|
+
* pipe(3, multiply(2)); // => 6
|
|
13
|
+
* pipe([1, 2, 3], map(multiply(3))); // => [3, 6, 9]
|
|
14
|
+
*/
|
|
15
|
+
function multiply(multiplicand) {
|
|
16
|
+
return function(value) {
|
|
17
|
+
return value * multiplicand;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { multiply };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/fp/object/omit.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that builds a new object with the given `keys` removed from
|
|
4
|
+
* the input object. Use it with {@link pipe}.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The type of the input object.
|
|
7
|
+
* @template K - The union of keys to omit.
|
|
8
|
+
* @param keys - The keys to exclude from the new object.
|
|
9
|
+
* @returns A function that maps an object `T` to `Omit<T, K>`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { pipe, omit } from 'es-toolkit/fp';
|
|
13
|
+
*
|
|
14
|
+
* pipe({ a: 1, b: 2, c: 3 }, omit(['b', 'c'])); // => { a: 1 }
|
|
15
|
+
*/
|
|
16
|
+
declare function omit<T extends Record<string, any>, K extends keyof T>(keys: readonly K[]): (obj: T) => Omit<T, K>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { omit };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/fp/object/omit.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that builds a new object with the given `keys` removed from
|
|
4
|
+
* the input object. Use it with {@link pipe}.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The type of the input object.
|
|
7
|
+
* @template K - The union of keys to omit.
|
|
8
|
+
* @param keys - The keys to exclude from the new object.
|
|
9
|
+
* @returns A function that maps an object `T` to `Omit<T, K>`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { pipe, omit } from 'es-toolkit/fp';
|
|
13
|
+
*
|
|
14
|
+
* pipe({ a: 1, b: 2, c: 3 }, omit(['b', 'c'])); // => { a: 1 }
|
|
15
|
+
*/
|
|
16
|
+
declare function omit<T extends Record<string, any>, K extends keyof T>(keys: readonly K[]): (obj: T) => Omit<T, K>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { omit };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_omit = require("../../object/omit.js");
|
|
2
|
+
//#region src/fp/object/omit.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that builds a new object with the given `keys` removed from
|
|
5
|
+
* the input object. Use it with {@link pipe}.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of the input object.
|
|
8
|
+
* @template K - The union of keys to omit.
|
|
9
|
+
* @param keys - The keys to exclude from the new object.
|
|
10
|
+
* @returns A function that maps an object `T` to `Omit<T, K>`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe, omit } from 'es-toolkit/fp';
|
|
14
|
+
*
|
|
15
|
+
* pipe({ a: 1, b: 2, c: 3 }, omit(['b', 'c'])); // => { a: 1 }
|
|
16
|
+
*/
|
|
17
|
+
function omit(keys) {
|
|
18
|
+
return function(obj) {
|
|
19
|
+
return require_omit.omit(obj, keys);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.omit = omit;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { omit as omit$1 } from "../../object/omit.mjs";
|
|
2
|
+
//#region src/fp/object/omit.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that builds a new object with the given `keys` removed from
|
|
5
|
+
* the input object. Use it with {@link pipe}.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of the input object.
|
|
8
|
+
* @template K - The union of keys to omit.
|
|
9
|
+
* @param keys - The keys to exclude from the new object.
|
|
10
|
+
* @returns A function that maps an object `T` to `Omit<T, K>`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe, omit } from 'es-toolkit/fp';
|
|
14
|
+
*
|
|
15
|
+
* pipe({ a: 1, b: 2, c: 3 }, omit(['b', 'c'])); // => { a: 1 }
|
|
16
|
+
*/
|
|
17
|
+
function omit(keys) {
|
|
18
|
+
return function(obj) {
|
|
19
|
+
return omit$1(obj, keys);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { omit };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/fp/object/pick.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that builds a new object containing only the given `keys`
|
|
4
|
+
* from the input object. Keys that are absent on the input are skipped. Use it
|
|
5
|
+
* with {@link pipe}.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of the input object.
|
|
8
|
+
* @template K - The union of keys to pick.
|
|
9
|
+
* @param keys - The keys to copy into the new object.
|
|
10
|
+
* @returns A function that maps an object `T` to `Pick<T, K>`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe, pick } from 'es-toolkit/fp';
|
|
14
|
+
*
|
|
15
|
+
* pipe({ a: 1, b: 2, c: 3 }, pick(['a', 'c'])); // => { a: 1, c: 3 }
|
|
16
|
+
*/
|
|
17
|
+
declare function pick<T extends Record<string, any>, K extends keyof T>(keys: readonly K[]): (obj: T) => Pick<T, K>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { pick };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/fp/object/pick.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that builds a new object containing only the given `keys`
|
|
4
|
+
* from the input object. Keys that are absent on the input are skipped. Use it
|
|
5
|
+
* with {@link pipe}.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of the input object.
|
|
8
|
+
* @template K - The union of keys to pick.
|
|
9
|
+
* @param keys - The keys to copy into the new object.
|
|
10
|
+
* @returns A function that maps an object `T` to `Pick<T, K>`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe, pick } from 'es-toolkit/fp';
|
|
14
|
+
*
|
|
15
|
+
* pipe({ a: 1, b: 2, c: 3 }, pick(['a', 'c'])); // => { a: 1, c: 3 }
|
|
16
|
+
*/
|
|
17
|
+
declare function pick<T extends Record<string, any>, K extends keyof T>(keys: readonly K[]): (obj: T) => Pick<T, K>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { pick };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_pick = require("../../object/pick.js");
|
|
2
|
+
//#region src/fp/object/pick.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that builds a new object containing only the given `keys`
|
|
5
|
+
* from the input object. Keys that are absent on the input are skipped. Use it
|
|
6
|
+
* with {@link pipe}.
|
|
7
|
+
*
|
|
8
|
+
* @template T - The type of the input object.
|
|
9
|
+
* @template K - The union of keys to pick.
|
|
10
|
+
* @param keys - The keys to copy into the new object.
|
|
11
|
+
* @returns A function that maps an object `T` to `Pick<T, K>`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { pipe, pick } from 'es-toolkit/fp';
|
|
15
|
+
*
|
|
16
|
+
* pipe({ a: 1, b: 2, c: 3 }, pick(['a', 'c'])); // => { a: 1, c: 3 }
|
|
17
|
+
*/
|
|
18
|
+
function pick(keys) {
|
|
19
|
+
return function(obj) {
|
|
20
|
+
return require_pick.pick(obj, keys);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.pick = pick;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { pick as pick$1 } from "../../object/pick.mjs";
|
|
2
|
+
//#region src/fp/object/pick.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that builds a new object containing only the given `keys`
|
|
5
|
+
* from the input object. Keys that are absent on the input are skipped. Use it
|
|
6
|
+
* with {@link pipe}.
|
|
7
|
+
*
|
|
8
|
+
* @template T - The type of the input object.
|
|
9
|
+
* @template K - The union of keys to pick.
|
|
10
|
+
* @param keys - The keys to copy into the new object.
|
|
11
|
+
* @returns A function that maps an object `T` to `Pick<T, K>`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { pipe, pick } from 'es-toolkit/fp';
|
|
15
|
+
*
|
|
16
|
+
* pipe({ a: 1, b: 2, c: 3 }, pick(['a', 'c'])); // => { a: 1, c: 3 }
|
|
17
|
+
*/
|
|
18
|
+
function pick(keys) {
|
|
19
|
+
return function(obj) {
|
|
20
|
+
return pick$1(obj, keys);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { pick };
|