es-toolkit 1.48.1-dev.1889 → 1.48.1-dev.1894
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/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/drop.js +1 -1
- package/dist/compat/array/drop.mjs +1 -1
- package/dist/compat/array/dropRight.js +1 -1
- package/dist/compat/array/dropRight.mjs +1 -1
- 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/subtract.js +1 -1
- package/dist/compat/math/subtract.mjs +1 -1
- package/dist/compat/object/omitBy.js +1 -1
- package/dist/compat/object/omitBy.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/fp.d.ts +1 -0
- package/fp.js +1 -0
- package/package.json +22 -1
|
@@ -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 };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
//#region src/fp/pipe.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns `value` unchanged — the identity case of {@link pipe} with no functions.
|
|
4
|
+
*
|
|
5
|
+
* @param value - The initial value fed into the pipe.
|
|
6
|
+
* @returns `value`, unchanged.
|
|
7
|
+
*/
|
|
8
|
+
declare function pipe<A>(value: A): A;
|
|
9
|
+
/**
|
|
10
|
+
* Pipes `value` through `fn1`, returning its result.
|
|
11
|
+
*
|
|
12
|
+
* @param value - The initial value fed into the pipe.
|
|
13
|
+
* @param fn1 - Applied to `value`.
|
|
14
|
+
* @returns The result of `fn1`.
|
|
15
|
+
*/
|
|
16
|
+
declare function pipe<A, B>(value: A, fn1: (input: A) => B): B;
|
|
17
|
+
/**
|
|
18
|
+
* Pipes `value` left-to-right through `fn1` to `fn2`, returning the final result.
|
|
19
|
+
*
|
|
20
|
+
* @param value - The initial value fed into the pipe.
|
|
21
|
+
* @param fn1 - Applied to `value`.
|
|
22
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
23
|
+
* @returns The result of `fn2` — the value returned by the last function.
|
|
24
|
+
*/
|
|
25
|
+
declare function pipe<A, B, C>(value: A, fn1: (input: A) => B, fn2: (input: B) => C): C;
|
|
26
|
+
/**
|
|
27
|
+
* Pipes `value` left-to-right through `fn1` to `fn3`, returning the final result.
|
|
28
|
+
*
|
|
29
|
+
* @param value - The initial value fed into the pipe.
|
|
30
|
+
* @param fn1 - Applied to `value`.
|
|
31
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
32
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
33
|
+
* @returns The result of `fn3` — the value returned by the last function.
|
|
34
|
+
*/
|
|
35
|
+
declare function pipe<A, B, C, D>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D): D;
|
|
36
|
+
/**
|
|
37
|
+
* Pipes `value` left-to-right through `fn1` to `fn4`, returning the final result.
|
|
38
|
+
*
|
|
39
|
+
* @param value - The initial value fed into the pipe.
|
|
40
|
+
* @param fn1 - Applied to `value`.
|
|
41
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
42
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
43
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
44
|
+
* @returns The result of `fn4` — the value returned by the last function.
|
|
45
|
+
*/
|
|
46
|
+
declare function pipe<A, B, C, D, E>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E): E;
|
|
47
|
+
/**
|
|
48
|
+
* Pipes `value` left-to-right through `fn1` to `fn5`, returning the final result.
|
|
49
|
+
*
|
|
50
|
+
* @param value - The initial value fed into the pipe.
|
|
51
|
+
* @param fn1 - Applied to `value`.
|
|
52
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
53
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
54
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
55
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
56
|
+
* @returns The result of `fn5` — the value returned by the last function.
|
|
57
|
+
*/
|
|
58
|
+
declare function pipe<A, B, C, D, E, F>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F): F;
|
|
59
|
+
/**
|
|
60
|
+
* Pipes `value` left-to-right through `fn1` to `fn6`, returning the final result.
|
|
61
|
+
*
|
|
62
|
+
* @param value - The initial value fed into the pipe.
|
|
63
|
+
* @param fn1 - Applied to `value`.
|
|
64
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
65
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
66
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
67
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
68
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
69
|
+
* @returns The result of `fn6` — the value returned by the last function.
|
|
70
|
+
*/
|
|
71
|
+
declare function pipe<A, B, C, D, E, F, G>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G): G;
|
|
72
|
+
/**
|
|
73
|
+
* Pipes `value` left-to-right through `fn1` to `fn7`, returning the final result.
|
|
74
|
+
*
|
|
75
|
+
* @param value - The initial value fed into the pipe.
|
|
76
|
+
* @param fn1 - Applied to `value`.
|
|
77
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
78
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
79
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
80
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
81
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
82
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
83
|
+
* @returns The result of `fn7` — the value returned by the last function.
|
|
84
|
+
*/
|
|
85
|
+
declare function pipe<A, B, C, D, E, F, G, H>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H): H;
|
|
86
|
+
/**
|
|
87
|
+
* Pipes `value` left-to-right through `fn1` to `fn8`, returning the final result.
|
|
88
|
+
*
|
|
89
|
+
* @param value - The initial value fed into the pipe.
|
|
90
|
+
* @param fn1 - Applied to `value`.
|
|
91
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
92
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
93
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
94
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
95
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
96
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
97
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
98
|
+
* @returns The result of `fn8` — the value returned by the last function.
|
|
99
|
+
*/
|
|
100
|
+
declare function pipe<A, B, C, D, E, F, G, H, I>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I): I;
|
|
101
|
+
/**
|
|
102
|
+
* Pipes `value` left-to-right through `fn1` to `fn9`, returning the final result.
|
|
103
|
+
*
|
|
104
|
+
* @param value - The initial value fed into the pipe.
|
|
105
|
+
* @param fn1 - Applied to `value`.
|
|
106
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
107
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
108
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
109
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
110
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
111
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
112
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
113
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
114
|
+
* @returns The result of `fn9` — the value returned by the last function.
|
|
115
|
+
*/
|
|
116
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J): J;
|
|
117
|
+
/**
|
|
118
|
+
* Pipes `value` left-to-right through `fn1` to `fn10`, returning the final result.
|
|
119
|
+
*
|
|
120
|
+
* @param value - The initial value fed into the pipe.
|
|
121
|
+
* @param fn1 - Applied to `value`.
|
|
122
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
123
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
124
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
125
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
126
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
127
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
128
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
129
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
130
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
131
|
+
* @returns The result of `fn10` — the value returned by the last function.
|
|
132
|
+
*/
|
|
133
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K): K;
|
|
134
|
+
/**
|
|
135
|
+
* Pipes `value` left-to-right through `fn1` to `fn11`, returning the final result.
|
|
136
|
+
*
|
|
137
|
+
* @param value - The initial value fed into the pipe.
|
|
138
|
+
* @param fn1 - Applied to `value`.
|
|
139
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
140
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
141
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
142
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
143
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
144
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
145
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
146
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
147
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
148
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
149
|
+
* @returns The result of `fn11` — the value returned by the last function.
|
|
150
|
+
*/
|
|
151
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L): L;
|
|
152
|
+
/**
|
|
153
|
+
* Pipes `value` left-to-right through `fn1` to `fn12`, returning the final result.
|
|
154
|
+
*
|
|
155
|
+
* @param value - The initial value fed into the pipe.
|
|
156
|
+
* @param fn1 - Applied to `value`.
|
|
157
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
158
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
159
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
160
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
161
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
162
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
163
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
164
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
165
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
166
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
167
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
168
|
+
* @returns The result of `fn12` — the value returned by the last function.
|
|
169
|
+
*/
|
|
170
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M): M;
|
|
171
|
+
/**
|
|
172
|
+
* Pipes `value` left-to-right through `fn1` to `fn13`, returning the final result.
|
|
173
|
+
*
|
|
174
|
+
* @param value - The initial value fed into the pipe.
|
|
175
|
+
* @param fn1 - Applied to `value`.
|
|
176
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
177
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
178
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
179
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
180
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
181
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
182
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
183
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
184
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
185
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
186
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
187
|
+
* @param fn13 - Applied to the result of `fn12`.
|
|
188
|
+
* @returns The result of `fn13` — the value returned by the last function.
|
|
189
|
+
*/
|
|
190
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M, fn13: (input: M) => N): N;
|
|
191
|
+
/**
|
|
192
|
+
* Pipes `value` left-to-right through `fn1` to `fn14`, returning the final result.
|
|
193
|
+
*
|
|
194
|
+
* @param value - The initial value fed into the pipe.
|
|
195
|
+
* @param fn1 - Applied to `value`.
|
|
196
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
197
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
198
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
199
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
200
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
201
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
202
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
203
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
204
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
205
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
206
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
207
|
+
* @param fn13 - Applied to the result of `fn12`.
|
|
208
|
+
* @param fn14 - Applied to the result of `fn13`.
|
|
209
|
+
* @returns The result of `fn14` — the value returned by the last function.
|
|
210
|
+
*/
|
|
211
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M, fn13: (input: M) => N, fn14: (input: N) => O): O;
|
|
212
|
+
/**
|
|
213
|
+
* Pipes `value` left-to-right through `fn1` to `fn15`, returning the final result.
|
|
214
|
+
*
|
|
215
|
+
* @param value - The initial value fed into the pipe.
|
|
216
|
+
* @param fn1 - Applied to `value`.
|
|
217
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
218
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
219
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
220
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
221
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
222
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
223
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
224
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
225
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
226
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
227
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
228
|
+
* @param fn13 - Applied to the result of `fn12`.
|
|
229
|
+
* @param fn14 - Applied to the result of `fn13`.
|
|
230
|
+
* @param fn15 - Applied to the result of `fn14`.
|
|
231
|
+
* @returns The result of `fn15` — the value returned by the last function.
|
|
232
|
+
*/
|
|
233
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M, fn13: (input: M) => N, fn14: (input: N) => O, fn15: (input: O) => P): P;
|
|
234
|
+
//#endregion
|
|
235
|
+
export { pipe };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
//#region src/fp/pipe.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns `value` unchanged — the identity case of {@link pipe} with no functions.
|
|
4
|
+
*
|
|
5
|
+
* @param value - The initial value fed into the pipe.
|
|
6
|
+
* @returns `value`, unchanged.
|
|
7
|
+
*/
|
|
8
|
+
declare function pipe<A>(value: A): A;
|
|
9
|
+
/**
|
|
10
|
+
* Pipes `value` through `fn1`, returning its result.
|
|
11
|
+
*
|
|
12
|
+
* @param value - The initial value fed into the pipe.
|
|
13
|
+
* @param fn1 - Applied to `value`.
|
|
14
|
+
* @returns The result of `fn1`.
|
|
15
|
+
*/
|
|
16
|
+
declare function pipe<A, B>(value: A, fn1: (input: A) => B): B;
|
|
17
|
+
/**
|
|
18
|
+
* Pipes `value` left-to-right through `fn1` to `fn2`, returning the final result.
|
|
19
|
+
*
|
|
20
|
+
* @param value - The initial value fed into the pipe.
|
|
21
|
+
* @param fn1 - Applied to `value`.
|
|
22
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
23
|
+
* @returns The result of `fn2` — the value returned by the last function.
|
|
24
|
+
*/
|
|
25
|
+
declare function pipe<A, B, C>(value: A, fn1: (input: A) => B, fn2: (input: B) => C): C;
|
|
26
|
+
/**
|
|
27
|
+
* Pipes `value` left-to-right through `fn1` to `fn3`, returning the final result.
|
|
28
|
+
*
|
|
29
|
+
* @param value - The initial value fed into the pipe.
|
|
30
|
+
* @param fn1 - Applied to `value`.
|
|
31
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
32
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
33
|
+
* @returns The result of `fn3` — the value returned by the last function.
|
|
34
|
+
*/
|
|
35
|
+
declare function pipe<A, B, C, D>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D): D;
|
|
36
|
+
/**
|
|
37
|
+
* Pipes `value` left-to-right through `fn1` to `fn4`, returning the final result.
|
|
38
|
+
*
|
|
39
|
+
* @param value - The initial value fed into the pipe.
|
|
40
|
+
* @param fn1 - Applied to `value`.
|
|
41
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
42
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
43
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
44
|
+
* @returns The result of `fn4` — the value returned by the last function.
|
|
45
|
+
*/
|
|
46
|
+
declare function pipe<A, B, C, D, E>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E): E;
|
|
47
|
+
/**
|
|
48
|
+
* Pipes `value` left-to-right through `fn1` to `fn5`, returning the final result.
|
|
49
|
+
*
|
|
50
|
+
* @param value - The initial value fed into the pipe.
|
|
51
|
+
* @param fn1 - Applied to `value`.
|
|
52
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
53
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
54
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
55
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
56
|
+
* @returns The result of `fn5` — the value returned by the last function.
|
|
57
|
+
*/
|
|
58
|
+
declare function pipe<A, B, C, D, E, F>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F): F;
|
|
59
|
+
/**
|
|
60
|
+
* Pipes `value` left-to-right through `fn1` to `fn6`, returning the final result.
|
|
61
|
+
*
|
|
62
|
+
* @param value - The initial value fed into the pipe.
|
|
63
|
+
* @param fn1 - Applied to `value`.
|
|
64
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
65
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
66
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
67
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
68
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
69
|
+
* @returns The result of `fn6` — the value returned by the last function.
|
|
70
|
+
*/
|
|
71
|
+
declare function pipe<A, B, C, D, E, F, G>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G): G;
|
|
72
|
+
/**
|
|
73
|
+
* Pipes `value` left-to-right through `fn1` to `fn7`, returning the final result.
|
|
74
|
+
*
|
|
75
|
+
* @param value - The initial value fed into the pipe.
|
|
76
|
+
* @param fn1 - Applied to `value`.
|
|
77
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
78
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
79
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
80
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
81
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
82
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
83
|
+
* @returns The result of `fn7` — the value returned by the last function.
|
|
84
|
+
*/
|
|
85
|
+
declare function pipe<A, B, C, D, E, F, G, H>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H): H;
|
|
86
|
+
/**
|
|
87
|
+
* Pipes `value` left-to-right through `fn1` to `fn8`, returning the final result.
|
|
88
|
+
*
|
|
89
|
+
* @param value - The initial value fed into the pipe.
|
|
90
|
+
* @param fn1 - Applied to `value`.
|
|
91
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
92
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
93
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
94
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
95
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
96
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
97
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
98
|
+
* @returns The result of `fn8` — the value returned by the last function.
|
|
99
|
+
*/
|
|
100
|
+
declare function pipe<A, B, C, D, E, F, G, H, I>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I): I;
|
|
101
|
+
/**
|
|
102
|
+
* Pipes `value` left-to-right through `fn1` to `fn9`, returning the final result.
|
|
103
|
+
*
|
|
104
|
+
* @param value - The initial value fed into the pipe.
|
|
105
|
+
* @param fn1 - Applied to `value`.
|
|
106
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
107
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
108
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
109
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
110
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
111
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
112
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
113
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
114
|
+
* @returns The result of `fn9` — the value returned by the last function.
|
|
115
|
+
*/
|
|
116
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J): J;
|
|
117
|
+
/**
|
|
118
|
+
* Pipes `value` left-to-right through `fn1` to `fn10`, returning the final result.
|
|
119
|
+
*
|
|
120
|
+
* @param value - The initial value fed into the pipe.
|
|
121
|
+
* @param fn1 - Applied to `value`.
|
|
122
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
123
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
124
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
125
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
126
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
127
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
128
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
129
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
130
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
131
|
+
* @returns The result of `fn10` — the value returned by the last function.
|
|
132
|
+
*/
|
|
133
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K): K;
|
|
134
|
+
/**
|
|
135
|
+
* Pipes `value` left-to-right through `fn1` to `fn11`, returning the final result.
|
|
136
|
+
*
|
|
137
|
+
* @param value - The initial value fed into the pipe.
|
|
138
|
+
* @param fn1 - Applied to `value`.
|
|
139
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
140
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
141
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
142
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
143
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
144
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
145
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
146
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
147
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
148
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
149
|
+
* @returns The result of `fn11` — the value returned by the last function.
|
|
150
|
+
*/
|
|
151
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L): L;
|
|
152
|
+
/**
|
|
153
|
+
* Pipes `value` left-to-right through `fn1` to `fn12`, returning the final result.
|
|
154
|
+
*
|
|
155
|
+
* @param value - The initial value fed into the pipe.
|
|
156
|
+
* @param fn1 - Applied to `value`.
|
|
157
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
158
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
159
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
160
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
161
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
162
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
163
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
164
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
165
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
166
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
167
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
168
|
+
* @returns The result of `fn12` — the value returned by the last function.
|
|
169
|
+
*/
|
|
170
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M): M;
|
|
171
|
+
/**
|
|
172
|
+
* Pipes `value` left-to-right through `fn1` to `fn13`, returning the final result.
|
|
173
|
+
*
|
|
174
|
+
* @param value - The initial value fed into the pipe.
|
|
175
|
+
* @param fn1 - Applied to `value`.
|
|
176
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
177
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
178
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
179
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
180
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
181
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
182
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
183
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
184
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
185
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
186
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
187
|
+
* @param fn13 - Applied to the result of `fn12`.
|
|
188
|
+
* @returns The result of `fn13` — the value returned by the last function.
|
|
189
|
+
*/
|
|
190
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M, fn13: (input: M) => N): N;
|
|
191
|
+
/**
|
|
192
|
+
* Pipes `value` left-to-right through `fn1` to `fn14`, returning the final result.
|
|
193
|
+
*
|
|
194
|
+
* @param value - The initial value fed into the pipe.
|
|
195
|
+
* @param fn1 - Applied to `value`.
|
|
196
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
197
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
198
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
199
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
200
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
201
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
202
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
203
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
204
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
205
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
206
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
207
|
+
* @param fn13 - Applied to the result of `fn12`.
|
|
208
|
+
* @param fn14 - Applied to the result of `fn13`.
|
|
209
|
+
* @returns The result of `fn14` — the value returned by the last function.
|
|
210
|
+
*/
|
|
211
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M, fn13: (input: M) => N, fn14: (input: N) => O): O;
|
|
212
|
+
/**
|
|
213
|
+
* Pipes `value` left-to-right through `fn1` to `fn15`, returning the final result.
|
|
214
|
+
*
|
|
215
|
+
* @param value - The initial value fed into the pipe.
|
|
216
|
+
* @param fn1 - Applied to `value`.
|
|
217
|
+
* @param fn2 - Applied to the result of `fn1`.
|
|
218
|
+
* @param fn3 - Applied to the result of `fn2`.
|
|
219
|
+
* @param fn4 - Applied to the result of `fn3`.
|
|
220
|
+
* @param fn5 - Applied to the result of `fn4`.
|
|
221
|
+
* @param fn6 - Applied to the result of `fn5`.
|
|
222
|
+
* @param fn7 - Applied to the result of `fn6`.
|
|
223
|
+
* @param fn8 - Applied to the result of `fn7`.
|
|
224
|
+
* @param fn9 - Applied to the result of `fn8`.
|
|
225
|
+
* @param fn10 - Applied to the result of `fn9`.
|
|
226
|
+
* @param fn11 - Applied to the result of `fn10`.
|
|
227
|
+
* @param fn12 - Applied to the result of `fn11`.
|
|
228
|
+
* @param fn13 - Applied to the result of `fn12`.
|
|
229
|
+
* @param fn14 - Applied to the result of `fn13`.
|
|
230
|
+
* @param fn15 - Applied to the result of `fn14`.
|
|
231
|
+
* @returns The result of `fn15` — the value returned by the last function.
|
|
232
|
+
*/
|
|
233
|
+
declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(value: A, fn1: (input: A) => B, fn2: (input: B) => C, fn3: (input: C) => D, fn4: (input: D) => E, fn5: (input: E) => F, fn6: (input: F) => G, fn7: (input: G) => H, fn8: (input: H) => I, fn9: (input: I) => J, fn10: (input: J) => K, fn11: (input: K) => L, fn12: (input: L) => M, fn13: (input: M) => N, fn14: (input: N) => O, fn15: (input: O) => P): P;
|
|
234
|
+
//#endregion
|
|
235
|
+
export { pipe };
|