fp-pack 0.5.0 → 0.7.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/README.md +17 -15
- package/dist/fp-pack.umd.js +1 -1
- package/dist/fp-pack.umd.js.map +1 -1
- package/dist/implement/async/pipeAsync.d.ts +11 -0
- package/dist/implement/async/pipeAsync.d.ts.map +1 -1
- package/dist/implement/async/pipeAsync.mjs.map +1 -1
- package/dist/implement/async/pipeAsyncSideEffect.d.ts +11 -0
- package/dist/implement/async/pipeAsyncSideEffect.d.ts.map +1 -1
- package/dist/implement/async/pipeAsyncSideEffect.mjs.map +1 -1
- package/dist/implement/composition/compose.d.ts +25 -9
- package/dist/implement/composition/compose.d.ts.map +1 -1
- package/dist/implement/composition/compose.mjs.map +1 -1
- package/dist/implement/composition/compose.type-test.d.ts +35 -0
- package/dist/implement/composition/compose.type-test.d.ts.map +1 -0
- package/dist/implement/composition/compose.util.type-test.d.ts +31 -0
- package/dist/implement/composition/compose.util.type-test.d.ts.map +1 -0
- package/dist/implement/composition/curry.d.ts +5 -5
- package/dist/implement/composition/curry.d.ts.map +1 -1
- package/dist/implement/composition/curry.mjs.map +1 -1
- package/dist/implement/composition/index.d.ts +4 -0
- package/dist/implement/composition/index.d.ts.map +1 -1
- package/dist/implement/composition/pipe.d.ts +3 -0
- package/dist/implement/composition/pipe.d.ts.map +1 -1
- package/dist/implement/composition/pipe.mjs.map +1 -1
- package/dist/implement/composition/pipe.type-test.d.ts +117 -1
- package/dist/implement/composition/pipe.type-test.d.ts.map +1 -1
- package/dist/implement/composition/pipe.util.type-test.d.ts +75 -0
- package/dist/implement/composition/pipe.util.type-test.d.ts.map +1 -0
- package/dist/implement/composition/sideEffect.d.ts +1 -1
- package/dist/implement/composition/sideEffect.d.ts.map +1 -1
- package/dist/implement/composition/sideEffect.mjs.map +1 -1
- package/dist/implement/composition/tap0.d.ts +6 -0
- package/dist/implement/composition/tap0.d.ts.map +1 -0
- package/dist/implement/composition/tap0.mjs +9 -0
- package/dist/implement/composition/tap0.mjs.map +1 -0
- package/dist/implement/object/assocPath.d.ts +2 -1
- package/dist/implement/object/assocPath.d.ts.map +1 -1
- package/dist/implement/object/assocPath.mjs.map +1 -1
- package/dist/implement/object/dissocPath.d.ts +2 -1
- package/dist/implement/object/dissocPath.d.ts.map +1 -1
- package/dist/implement/object/dissocPath.mjs.map +1 -1
- package/dist/implement/object/index.d.ts +1 -0
- package/dist/implement/object/index.d.ts.map +1 -1
- package/dist/implement/object/path.d.ts +4 -2
- package/dist/implement/object/path.d.ts.map +1 -1
- package/dist/implement/object/path.mjs.map +1 -1
- package/dist/implement/object/pathKey.d.ts +2 -0
- package/dist/implement/object/pathKey.d.ts.map +1 -0
- package/dist/implement/object/pathOr.d.ts +5 -3
- package/dist/implement/object/pathOr.d.ts.map +1 -1
- package/dist/implement/object/pathOr.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +230 -228
- package/dist/index.mjs.map +1 -1
- package/dist/skills/fp-pack/SKILL.md +19 -16
- package/dist/skills/fp-pack.md +19 -16
- package/dist/stream/index.d.ts +1 -0
- package/dist/stream/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/implement/async/pipeAsync.ts +71 -0
- package/src/implement/async/pipeAsyncSideEffect.ts +74 -0
- package/src/implement/composition/compose.test.ts +14 -0
- package/src/implement/composition/compose.ts +133 -21
- package/src/implement/composition/compose.type-test.ts +109 -0
- package/src/implement/composition/compose.util.type-test.ts +128 -0
- package/src/implement/composition/curry.ts +5 -5
- package/src/implement/composition/index.ts +4 -0
- package/src/implement/composition/pipe.ts +4 -0
- package/src/implement/composition/pipe.type-test.ts +269 -1
- package/src/implement/composition/pipe.util.type-test.ts +256 -0
- package/src/implement/composition/sideEffect.ts +1 -1
- package/src/implement/composition/tap0.test.ts +16 -0
- package/src/implement/composition/tap0.ts +10 -0
- package/src/implement/object/assocPath.ts +2 -2
- package/src/implement/object/dissocPath.ts +2 -2
- package/src/implement/object/index.ts +1 -0
- package/src/implement/object/path.ts +5 -3
- package/src/implement/object/pathKey.ts +1 -0
- package/src/implement/object/pathOr.ts +6 -4
- package/src/index.ts +3 -0
- package/src/stream/index.ts +1 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import compose from './compose';
|
|
2
|
+
import from from './from';
|
|
3
|
+
|
|
4
|
+
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2)
|
|
5
|
+
? true
|
|
6
|
+
: false;
|
|
7
|
+
type Expect<T extends true> = T;
|
|
8
|
+
|
|
9
|
+
export const pureCompose = compose(
|
|
10
|
+
(value: string) => `n:${value}`,
|
|
11
|
+
(value: number) => `${value}`,
|
|
12
|
+
(value: number) => value * 2,
|
|
13
|
+
(value: number) => value + 1
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
type PureComposeExpected = (input: number) => string;
|
|
17
|
+
export type ComposePureIsStrict = Expect<Equal<typeof pureCompose, PureComposeExpected>>;
|
|
18
|
+
|
|
19
|
+
export const pureComposeSix = compose(
|
|
20
|
+
(value: number) => `n:${value}`,
|
|
21
|
+
(value: number) => value + 1,
|
|
22
|
+
(value: string) => value.length,
|
|
23
|
+
(value: number) => `${value}`,
|
|
24
|
+
(value: number) => value * 2,
|
|
25
|
+
(value: number) => value + 1
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
type PureComposeSixExpected = (input: number) => string;
|
|
29
|
+
export type ComposePureSixIsStrict = Expect<Equal<typeof pureComposeSix, PureComposeSixExpected>>;
|
|
30
|
+
|
|
31
|
+
export const pureComposeTen = compose(
|
|
32
|
+
(value: string) => `n:${value}`,
|
|
33
|
+
(value: string) => value.padStart(4, '0'),
|
|
34
|
+
(value: number) => `${value}`,
|
|
35
|
+
(value: number) => value + 1,
|
|
36
|
+
(value: string) => value.length,
|
|
37
|
+
(value: string) => value.padStart(3, '0'),
|
|
38
|
+
(value: number) => `${value}`,
|
|
39
|
+
(value: number) => value * 2,
|
|
40
|
+
(value: number) => value + 1,
|
|
41
|
+
(value: number) => value + 1
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
type PureComposeTenExpected = (input: number) => string;
|
|
45
|
+
export type ComposePureTenIsStrict = Expect<Equal<typeof pureComposeTen, PureComposeTenExpected>>;
|
|
46
|
+
|
|
47
|
+
export const composeZero = compose(
|
|
48
|
+
(value: number) => value + 1,
|
|
49
|
+
(value: number) => value * 2,
|
|
50
|
+
() => 1
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
type ComposeZeroExpected = () => number;
|
|
54
|
+
export type ComposeZeroIsStrict = Expect<Equal<typeof composeZero, ComposeZeroExpected>>;
|
|
55
|
+
|
|
56
|
+
export const composeZeroValue = composeZero();
|
|
57
|
+
|
|
58
|
+
type ComposeZeroValueExpected = number;
|
|
59
|
+
export type ComposeZeroValueIsStrict = Expect<Equal<typeof composeZeroValue, ComposeZeroValueExpected>>;
|
|
60
|
+
|
|
61
|
+
export const composeFromNoInput = compose(from(1));
|
|
62
|
+
|
|
63
|
+
type ComposeFromNoInputExpected = (input?: unknown) => number;
|
|
64
|
+
export type ComposeFromNoInputIsStrict = Expect<Equal<typeof composeFromNoInput, ComposeFromNoInputExpected>>;
|
|
65
|
+
|
|
66
|
+
export const composeFromNoInputValue = composeFromNoInput();
|
|
67
|
+
|
|
68
|
+
type ComposeFromNoInputValueExpected = number;
|
|
69
|
+
export type ComposeFromNoInputValueIsStrict = Expect<
|
|
70
|
+
Equal<typeof composeFromNoInputValue, ComposeFromNoInputValueExpected>
|
|
71
|
+
>;
|
|
72
|
+
|
|
73
|
+
export const composeFromNoInputValueWithArg = composeFromNoInput('input');
|
|
74
|
+
|
|
75
|
+
type ComposeFromNoInputValueWithArgExpected = number;
|
|
76
|
+
export type ComposeFromNoInputValueWithArgIsStrict = Expect<
|
|
77
|
+
Equal<typeof composeFromNoInputValueWithArg, ComposeFromNoInputValueWithArgExpected>
|
|
78
|
+
>;
|
|
79
|
+
|
|
80
|
+
export const composeFromTen = compose(
|
|
81
|
+
(value: string) => `n:${value}`,
|
|
82
|
+
(value: string) => value.padStart(4, '0'),
|
|
83
|
+
(value: number) => `${value}`,
|
|
84
|
+
(value: number) => value + 1,
|
|
85
|
+
(value: string) => value.length,
|
|
86
|
+
(value: string) => value.padStart(3, '0'),
|
|
87
|
+
(value: number) => `${value}`,
|
|
88
|
+
(value: number) => value * 2,
|
|
89
|
+
(value: number) => value + 1,
|
|
90
|
+
from(1)
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export const composeFromTenValue = composeFromTen('input');
|
|
94
|
+
|
|
95
|
+
type ComposeFromTenValueExpected = string;
|
|
96
|
+
export type ComposeFromTenValueIsStrict = Expect<Equal<typeof composeFromTenValue, ComposeFromTenValueExpected>>;
|
|
97
|
+
|
|
98
|
+
export const composeFromTenValueNoInput = composeFromTen();
|
|
99
|
+
|
|
100
|
+
type ComposeFromTenValueNoInputExpected = string;
|
|
101
|
+
export type ComposeFromTenValueNoInputIsStrict = Expect<
|
|
102
|
+
Equal<typeof composeFromTenValueNoInput, ComposeFromTenValueNoInputExpected>
|
|
103
|
+
>;
|
|
104
|
+
|
|
105
|
+
// Negative cases: input required when not using from/zero-arity.
|
|
106
|
+
// @ts-expect-error input required for unary compose
|
|
107
|
+
pureCompose();
|
|
108
|
+
// @ts-expect-error input required for direct compose call
|
|
109
|
+
compose((value: number) => value + 1)();
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import compose from './compose';
|
|
2
|
+
import filter from '../array/filter';
|
|
3
|
+
import flattenDeep from '../array/flattenDeep';
|
|
4
|
+
import map from '../array/map';
|
|
5
|
+
import sum from '../math/sum';
|
|
6
|
+
import gt from '../equality/gt';
|
|
7
|
+
import when from '../control/when';
|
|
8
|
+
import ifElse from '../control/ifElse';
|
|
9
|
+
import log from '../debug/log';
|
|
10
|
+
import tap from './tap';
|
|
11
|
+
import prop from '../object/prop';
|
|
12
|
+
import mergeAll from '../object/mergeAll';
|
|
13
|
+
import getOrElse from '../nullable/getOrElse';
|
|
14
|
+
import mapMaybe from '../nullable/mapMaybe';
|
|
15
|
+
import join from '../string/join';
|
|
16
|
+
import trim from '../string/trim';
|
|
17
|
+
import toUpper from '../string/toUpper';
|
|
18
|
+
import streamFilter from '../../stream/filter';
|
|
19
|
+
import streamMap from '../../stream/map';
|
|
20
|
+
import streamRange from '../../stream/range';
|
|
21
|
+
import streamReduce from '../../stream/reduce';
|
|
22
|
+
import streamToArray from '../../stream/toArray';
|
|
23
|
+
|
|
24
|
+
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2)
|
|
25
|
+
? true
|
|
26
|
+
: false;
|
|
27
|
+
type Expect<T extends true> = T;
|
|
28
|
+
|
|
29
|
+
type User = {
|
|
30
|
+
name?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type TagOwner = {
|
|
34
|
+
tags?: Array<string | null>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type Config = {
|
|
38
|
+
value?: number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const getName = prop('name') as (user: User) => string | undefined;
|
|
42
|
+
const getTags = prop('tags') as (owner: TagOwner) => Array<string | null> | undefined;
|
|
43
|
+
const mergeConfig = mergeAll as (configs: Config[]) => Config;
|
|
44
|
+
const getValue = prop('value') as (config: Config) => number | undefined;
|
|
45
|
+
const streamMapNumber = streamMap((value: number) => value + 1) as (iterable: Iterable<number>) => IterableIterator<number>;
|
|
46
|
+
const streamFilterNumber = streamFilter((value: number) => value > 1) as (
|
|
47
|
+
iterable: Iterable<number>
|
|
48
|
+
) => IterableIterator<number>;
|
|
49
|
+
const streamReduceNumber = streamReduce((acc: number, value: number) => acc + value, 0) as (
|
|
50
|
+
iterable: Iterable<number>
|
|
51
|
+
) => number;
|
|
52
|
+
const streamMapAsyncNumber = streamMap(async (value: number) => value + 1) as (
|
|
53
|
+
iterable: Iterable<number>
|
|
54
|
+
) => IterableIterator<Promise<number>>;
|
|
55
|
+
const whenPositive = when<number>(gt(0), (value) => value + 1);
|
|
56
|
+
|
|
57
|
+
export const composeArrayControlString = compose(
|
|
58
|
+
log('total'),
|
|
59
|
+
toUpper,
|
|
60
|
+
trim,
|
|
61
|
+
(value: number) => `${value}`,
|
|
62
|
+
when(gt(10), (value) => value + 1),
|
|
63
|
+
sum,
|
|
64
|
+
map((value: number) => value * 2),
|
|
65
|
+
filter(gt(1)),
|
|
66
|
+
flattenDeep<number>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
type ComposeArrayControlStringExpected = (input: any[]) => string;
|
|
70
|
+
export type ComposeArrayControlStringIsStrict = Expect<
|
|
71
|
+
Equal<typeof composeArrayControlString, ComposeArrayControlStringExpected>
|
|
72
|
+
>;
|
|
73
|
+
|
|
74
|
+
export const composeObjectNullableControl = compose(
|
|
75
|
+
tap((value: string) => value.length),
|
|
76
|
+
ifElse(
|
|
77
|
+
(value: string) => value.length > 0,
|
|
78
|
+
toUpper,
|
|
79
|
+
() => 'UNKNOWN'
|
|
80
|
+
),
|
|
81
|
+
getOrElse(''),
|
|
82
|
+
getName
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
type ComposeObjectNullableControlExpected = (input: User) => string;
|
|
86
|
+
export type ComposeObjectNullableControlIsStrict = Expect<
|
|
87
|
+
Equal<typeof composeObjectNullableControl, ComposeObjectNullableControlExpected>
|
|
88
|
+
>;
|
|
89
|
+
|
|
90
|
+
export const composeTags = compose(
|
|
91
|
+
join('|'),
|
|
92
|
+
map((tag: string) => tag.toUpperCase()),
|
|
93
|
+
mapMaybe((tag: string | null) => (tag ? tag.trim() : null)),
|
|
94
|
+
getOrElse<Array<string | null>>([]),
|
|
95
|
+
getTags
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
type ComposeTagsExpected = (input: TagOwner) => string;
|
|
99
|
+
export type ComposeTagsIsStrict = Expect<Equal<typeof composeTags, ComposeTagsExpected>>;
|
|
100
|
+
|
|
101
|
+
export const composeConfigValue = compose(
|
|
102
|
+
whenPositive,
|
|
103
|
+
getOrElse(0),
|
|
104
|
+
getValue,
|
|
105
|
+
mergeConfig
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
type ComposeConfigValueExpected = (input: Config[]) => number;
|
|
109
|
+
export type ComposeConfigValueIsStrict = Expect<Equal<typeof composeConfigValue, ComposeConfigValueExpected>>;
|
|
110
|
+
|
|
111
|
+
export const composeStreamSync = compose(
|
|
112
|
+
streamReduceNumber,
|
|
113
|
+
streamFilterNumber,
|
|
114
|
+
streamMapNumber,
|
|
115
|
+
(end: number) => streamRange(0, end)
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
type ComposeStreamSyncExpected = (input: number) => number;
|
|
119
|
+
export type ComposeStreamSyncIsStrict = Expect<Equal<typeof composeStreamSync, ComposeStreamSyncExpected>>;
|
|
120
|
+
|
|
121
|
+
export const composeStreamToArray = compose(
|
|
122
|
+
streamToArray,
|
|
123
|
+
streamMapAsyncNumber,
|
|
124
|
+
(end: number) => streamRange(0, end)
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
type ComposeStreamToArrayExpected = (input: number) => Promise<number[]>;
|
|
128
|
+
export type ComposeStreamToArrayIsStrict = Expect<Equal<typeof composeStreamToArray, ComposeStreamToArrayExpected>>;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Supports functions with 2-5 parameters and keeps data-last call order.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
type Curry2<Fn> = Fn extends (a: infer A, b: infer B) => infer R
|
|
6
|
+
export type Curry2<Fn> = Fn extends (a: infer A, b: infer B) => infer R
|
|
7
7
|
? {
|
|
8
8
|
(...args: [A]): (b: B) => R;
|
|
9
9
|
(...args: [A, B]): R;
|
|
10
10
|
}
|
|
11
11
|
: never;
|
|
12
12
|
|
|
13
|
-
type Curry3<Fn> = Fn extends (a: infer A, b: infer B, c: infer C) => infer R
|
|
13
|
+
export type Curry3<Fn> = Fn extends (a: infer A, b: infer B, c: infer C) => infer R
|
|
14
14
|
? {
|
|
15
15
|
(...args: [A]): (b: B) => (c: C) => R;
|
|
16
16
|
(...args: [A, B]): (c: C) => R;
|
|
@@ -18,7 +18,7 @@ type Curry3<Fn> = Fn extends (a: infer A, b: infer B, c: infer C) => infer R
|
|
|
18
18
|
}
|
|
19
19
|
: never;
|
|
20
20
|
|
|
21
|
-
type Curry4<Fn> = Fn extends (a: infer A, b: infer B, c: infer C, d: infer D) => infer R
|
|
21
|
+
export type Curry4<Fn> = Fn extends (a: infer A, b: infer B, c: infer C, d: infer D) => infer R
|
|
22
22
|
? {
|
|
23
23
|
(...args: [A]): (b: B) => (c: C) => (d: D) => R;
|
|
24
24
|
(...args: [A, B]): (c: C) => (d: D) => R;
|
|
@@ -27,7 +27,7 @@ type Curry4<Fn> = Fn extends (a: infer A, b: infer B, c: infer C, d: infer D) =>
|
|
|
27
27
|
}
|
|
28
28
|
: never;
|
|
29
29
|
|
|
30
|
-
type Curry5<Fn> = Fn extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => infer R
|
|
30
|
+
export type Curry5<Fn> = Fn extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => infer R
|
|
31
31
|
? {
|
|
32
32
|
(...args: [A]): (b: B) => (c: C) => (d: D) => (e: E) => R;
|
|
33
33
|
(...args: [A, B]): (c: C) => (d: D) => (e: E) => R;
|
|
@@ -53,7 +53,7 @@ type CurryByArity<Fn extends (...args: any[]) => any> = Parameters<Fn>['length']
|
|
|
53
53
|
? Curry5<Fn>
|
|
54
54
|
: CurryVariadic<Fn>;
|
|
55
55
|
|
|
56
|
-
type Curried<Fn extends (...args: any[]) => any> = CurryByArity<Fn>;
|
|
56
|
+
export type Curried<Fn extends (...args: any[]) => any> = CurryByArity<Fn>;
|
|
57
57
|
|
|
58
58
|
function curry<Fn extends (...args: any[]) => any>(fn: Fn): Curried<Fn>;
|
|
59
59
|
|
|
@@ -3,15 +3,19 @@ export { default as pipeSideEffect } from './pipeSideEffect';
|
|
|
3
3
|
export { default as pipeSideEffectStrict } from './pipeSideEffectStrict';
|
|
4
4
|
export { default as compose } from './compose';
|
|
5
5
|
export { default as curry } from './curry';
|
|
6
|
+
export type { Curried, Curry2, Curry3, Curry4, Curry5 } from './curry';
|
|
6
7
|
export { default as partial } from './partial';
|
|
7
8
|
export { default as flip } from './flip';
|
|
8
9
|
export { default as complement } from './complement';
|
|
9
10
|
export { default as identity } from './identity';
|
|
10
11
|
export { default as constant } from './constant';
|
|
11
12
|
export { default as from } from './from';
|
|
13
|
+
export type { FromFn } from './from';
|
|
12
14
|
export { default as tap } from './tap';
|
|
15
|
+
export { default as tap0 } from './tap0';
|
|
13
16
|
export { default as once } from './once';
|
|
14
17
|
export { default as memoize } from './memoize';
|
|
15
18
|
export { default as SideEffect } from './sideEffect';
|
|
16
19
|
export { SideEffect as SideEffectClass } from './sideEffect';
|
|
17
20
|
export { isSideEffect, matchSideEffect, runPipeResult } from './sideEffect';
|
|
21
|
+
export type { MatchHandlers } from './sideEffect';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { FromFn } from './from';
|
|
2
|
+
|
|
1
3
|
type UnaryFn<A, R> = (a: A) => R;
|
|
2
4
|
type ZeroFn<R> = () => R;
|
|
3
5
|
type PipeInput<Fns extends UnaryFn<any, any>[]> = Fns extends [UnaryFn<infer A, any>, ...UnaryFn<any, any>[]]
|
|
@@ -11,6 +13,7 @@ type PipeOutput<Fns extends UnaryFn<any, any>[]> = Fns extends [UnaryFn<any, inf
|
|
|
11
13
|
: never
|
|
12
14
|
: never;
|
|
13
15
|
type Pipe<Fns extends UnaryFn<any, any>[]> = (input: PipeInput<Fns>) => PipeOutput<Fns>;
|
|
16
|
+
type PipeFrom<Fns extends [FromFn<any>, ...UnaryFn<any, any>[]]> = (input?: PipeInput<Fns>) => PipeOutput<Fns>;
|
|
14
17
|
|
|
15
18
|
function pipe<R>(ab: ZeroFn<R>): () => R;
|
|
16
19
|
function pipe<B, R>(ab: ZeroFn<B>, bc: UnaryFn<B, R>): () => R;
|
|
@@ -73,6 +76,7 @@ function pipe<B, C, D, E, F, G, H, I, J, R>(
|
|
|
73
76
|
ij: UnaryFn<I, J>,
|
|
74
77
|
jk: UnaryFn<J, R>
|
|
75
78
|
): () => R;
|
|
79
|
+
function pipe<Fns extends [FromFn<any>, ...UnaryFn<any, any>[]]>(...funcs: Fns): PipeFrom<Fns>;
|
|
76
80
|
function pipe<A, R>(ab: UnaryFn<A, R>): (a: A) => R;
|
|
77
81
|
function pipe<A, B, R>(ab: UnaryFn<A, B>, bc: UnaryFn<B, R>): (a: A) => R;
|
|
78
82
|
function pipe<A, B, C, R>(ab: UnaryFn<A, B>, bc: UnaryFn<B, C>, cd: UnaryFn<C, R>): (a: A) => R;
|