pepka 0.12.3 → 0.13.0-b2
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 +10 -7
- package/dist/bundle.d.ts +476 -85
- package/dist/bundle.dev.js +113 -72
- package/dist/bundle.js +1 -1
- package/dist/es/curry.js +29 -1
- package/dist/es/index.js +1 -0
- package/dist/es/quick.js +8 -8
- package/dist/es/safe.js +69 -65
- package/dist/es/uncurry.js +3 -0
- package/dist/es/utils.js +1 -0
- package/dts-fix.js +8 -0
- package/package.json +15 -12
- package/rollup.config.js +2 -1
- package/src/curry.ts +55 -11
- package/src/index.ts +1 -0
- package/src/quick.ts +9 -9
- package/src/safe.ts +83 -95
- package/src/types.ts +10 -3
- package/src/uncurry.ts +11 -0
- package/src/utils.ts +1 -0
- package/tsconfig.json +2 -4
package/README.md
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
HI! Meet pepka - JavaScript/TypeScript functional programming
|
|
3
|
+
HI! Meet pepka - JavaScript/TypeScript functional programming utility library named after my parakeet.
|
|
4
4
|
|
|
5
5
|
This lib is intended to be a functional toolkit more flexible than ramda is.
|
|
6
6
|
Its' basic API is similimar to ramda's one.
|
|
7
7
|
Other goals are:
|
|
8
|
-
- Async pipes. They are
|
|
9
|
-
- Most flexible types
|
|
10
|
-
- Tree-shakeble
|
|
11
|
-
- Has "quick" alternatives of most computation-heavy functions with `q` prefix which are not completely safe by fp means
|
|
8
|
+
- Async pipes. They are very handy, but are not 100% pure in terms of Haskell c:
|
|
9
|
+
- Most flexible types possible (Let'em be any better than crashing because of their failures. I'm currently working on full JSDocs and better basic types).
|
|
10
|
+
- Tree-shakeble and smallest possible. What could be native, is native.
|
|
11
|
+
- Has "quick" alternatives of most computation-heavy functions with `q` prefix which are not completely safe by fp means: most of them do mutations and it may be needed to `clone` or `cloneShallow` data in a first pipe of `compose(...)`.
|
|
12
|
+
- Has basic toolbelt-types like AnyObject and AnyFunc<ReturnType?, [...args]?> etc.
|
|
12
13
|
- Has some basic additinal must-have stuff that ramda does not.
|
|
13
14
|
|
|
14
15
|
Full docs are coming,
|
|
15
16
|
please reference ramda's ones for most operations and examples: https://ramdajs.com/docs/
|
|
16
17
|
|
|
17
18
|
Basic API differences:
|
|
19
|
+
- clone() clones deeply as possible any type possible.
|
|
20
|
+
- cloneShallow() clones only by 1st level of folding also any type possible.
|
|
18
21
|
- mergeDeep - replaces arrays.
|
|
19
|
-
- mergeDeepX - replaces elements with same indexes.
|
|
20
|
-
- mergeDeepAdd - adds new
|
|
22
|
+
- mergeDeepX - replaces its' elements with same indexes.
|
|
23
|
+
- mergeDeepAdd - adds new elements to arrays.
|
|
21
24
|
- type - returns type UpperCased of anything passed to it, including classes and typed arrays.
|
|
22
25
|
- mapKeys - changes existing keys and data by map or function like usual mapper.
|
|
23
26
|
- explore(label)(data) - `compose(explore('the number'))(42)` results in `'the number', 42` in console passing by the data.
|
package/dist/bundle.d.ts
CHANGED
|
@@ -1,28 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
import {F as FT} from 'ts-toolbelt'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export declare const toLower: (s: string) => string;
|
|
7
|
-
export declare const toUpper: (s: string) => string;
|
|
8
|
-
export declare const type: (s: any) => any;
|
|
3
|
+
// Generated by dts-bundle-generator v7.1.0
|
|
4
|
+
|
|
5
|
+
export type Cond = (...xs: any[]) => boolean;
|
|
9
6
|
export interface AnyObject {
|
|
10
7
|
[k: string]: any;
|
|
11
8
|
}
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
export declare const
|
|
19
|
-
export
|
|
20
|
-
export declare
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
export type AnyArgs = any[];
|
|
10
|
+
export type Curried<Args extends AnyArgs = AnyArgs, ReturnT = any> = (arg: Args[number]) => Curried<Args> | ReturnT;
|
|
11
|
+
export type Reducer = <T = any>(accum: T, cur: any, index: number) => T;
|
|
12
|
+
export type AnyFunc<ReturnT = any, Args extends AnyArgs = AnyArgs> = (...args: Args) => ReturnT;
|
|
13
|
+
declare const __: unique symbol;
|
|
14
|
+
export type Placeholder = typeof __;
|
|
15
|
+
export declare const curry: <Func extends AnyFunc<any, AnyArgs>>(fn: AnyFunc) => FT.Curry<Func>;
|
|
16
|
+
export type Func2 = (a: any, b: any) => any;
|
|
17
|
+
export declare function curry2<Func extends Func2>(fn: Func): {
|
|
18
|
+
(a: Parameters<Func>[0]): (b: Parameters<Func>[1]) => ReturnType<Func>;
|
|
19
|
+
(a: Parameters<Func>[0], b: Parameters<Func>[1]): ReturnType<Func>;
|
|
20
|
+
(a: Placeholder, b: Parameters<Func>[1]): (a: Parameters<Func>[0]) => ReturnType<Func>;
|
|
21
|
+
(a: Parameters<Func>[0], b: Placeholder): (b: Parameters<Func>[1]) => ReturnType<Func>;
|
|
22
|
+
};
|
|
23
|
+
export type Func3 = (a: any, b: any, c: any) => any;
|
|
24
|
+
export declare function curry3<Func extends Func3>(fn: Func): FT.Curry<Func>;
|
|
25
|
+
export declare const uncurry: <Args extends any[] = any[], ReturnT = any>(fn: Curried<Args, any>) => AnyFunc;
|
|
26
|
+
export declare const toLower: (s: string) => string;
|
|
27
|
+
export declare const toUpper: (s: string) => string;
|
|
28
|
+
export declare const type: (s: any) => any;
|
|
29
|
+
export declare const equals: {
|
|
30
|
+
(a: any): (b: any) => boolean;
|
|
31
|
+
(a: any, b: any): boolean;
|
|
32
|
+
(a: typeof __, b: any): (a: any) => boolean;
|
|
33
|
+
(a: any, b: typeof __): (b: any) => boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const ifElse: FT.Curry<AnyFunc<any, AnyArgs>>;
|
|
36
|
+
export declare const when: FT.Curry<(cond: (s: any) => boolean, pipe: (s: any) => any, s: any) => any>;
|
|
37
|
+
export declare const compose: FT.Compose;
|
|
38
|
+
export declare const bind: {
|
|
39
|
+
(a: any): (b: any) => any;
|
|
40
|
+
(a: any, b: any): any;
|
|
41
|
+
(a: typeof __, b: any): (a: any) => any;
|
|
42
|
+
(a: any, b: typeof __): (b: any) => any;
|
|
43
|
+
};
|
|
44
|
+
export declare const nth: {
|
|
45
|
+
(a: number): (b: unknown[]) => unknown;
|
|
46
|
+
(a: number, b: unknown[]): unknown;
|
|
47
|
+
(a: typeof __, b: unknown[]): (a: number) => unknown;
|
|
48
|
+
(a: number, b: typeof __): (b: unknown[]) => unknown;
|
|
49
|
+
};
|
|
50
|
+
export declare const includes: {
|
|
51
|
+
(a: unknown): (b: unknown[]) => boolean;
|
|
52
|
+
(a: unknown, b: unknown[]): boolean;
|
|
53
|
+
(a: typeof __, b: unknown[]): (a: unknown) => boolean;
|
|
54
|
+
(a: unknown, b: typeof __): (b: unknown[]) => boolean;
|
|
55
|
+
};
|
|
56
|
+
export declare const slice: FT.Curry<(from: number, to: number, o: any[] | string) => string | any[]>;
|
|
57
|
+
export declare const head: (b: unknown[]) => unknown;
|
|
58
|
+
export declare const tail: FT.Curry<(o: string | any[]) => string | any[]>;
|
|
59
|
+
export declare const add: {
|
|
60
|
+
(a: number): (b: number) => number;
|
|
61
|
+
(a: number, b: number): number;
|
|
62
|
+
(a: typeof __, b: number): (a: number) => number;
|
|
63
|
+
(a: number, b: typeof __): (b: number) => number;
|
|
64
|
+
};
|
|
65
|
+
export declare const subtract: {
|
|
66
|
+
(a: number): (b: number) => number;
|
|
67
|
+
(a: number, b: number): number;
|
|
68
|
+
(a: typeof __, b: number): (a: number) => number;
|
|
69
|
+
(a: number, b: typeof __): (b: number) => number;
|
|
70
|
+
};
|
|
71
|
+
export declare const flip: (fn: Function) => FT.Curry<AnyFunc<any, AnyArgs>>;
|
|
26
72
|
export declare const isNil: (s: any) => boolean;
|
|
27
73
|
export declare const length: (s: any[] | string) => number;
|
|
28
74
|
export declare const always: <T = any>(s: T) => () => T;
|
|
@@ -37,91 +83,436 @@ export declare const toPairs: (o: AnyObject | any[]) => [
|
|
|
37
83
|
string,
|
|
38
84
|
any
|
|
39
85
|
][];
|
|
40
|
-
export declare const test:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
86
|
+
export declare const test: {
|
|
87
|
+
(a: RegExp): (b: string) => boolean;
|
|
88
|
+
(a: RegExp, b: string): boolean;
|
|
89
|
+
(a: typeof __, b: string): (a: RegExp) => boolean;
|
|
90
|
+
(a: RegExp, b: typeof __): (b: string) => boolean;
|
|
91
|
+
};
|
|
92
|
+
export declare const tap: {
|
|
93
|
+
(a: Function): (b: any) => any;
|
|
94
|
+
(a: Function, b: any): any;
|
|
95
|
+
(a: typeof __, b: any): (a: Function) => any;
|
|
96
|
+
(a: Function, b: typeof __): (b: any) => any;
|
|
97
|
+
};
|
|
98
|
+
export declare const append: {
|
|
99
|
+
(a: any): (b: any[]) => any[];
|
|
100
|
+
(a: any, b: any[]): any[];
|
|
101
|
+
(a: typeof __, b: any[]): (a: any) => any[];
|
|
102
|
+
(a: any, b: typeof __): (b: any[]) => any[];
|
|
103
|
+
};
|
|
104
|
+
export declare const split: {
|
|
105
|
+
(a: string): (b: string) => string[];
|
|
106
|
+
(a: string, b: string): string[];
|
|
107
|
+
(a: typeof __, b: string): (a: string) => string[];
|
|
108
|
+
(a: string, b: typeof __): (b: string) => string[];
|
|
109
|
+
};
|
|
44
110
|
export declare const T: (...args: any[]) => true;
|
|
45
111
|
export declare const F: (...args: any[]) => false;
|
|
46
112
|
export declare const sizeof: (s: any[] | string | AnyObject) => number;
|
|
47
|
-
export declare const range:
|
|
113
|
+
export declare const range: {
|
|
114
|
+
(a: number): (b: number) => any[];
|
|
115
|
+
(a: number, b: number): any[];
|
|
116
|
+
(a: typeof __, b: number): (a: number) => any[];
|
|
117
|
+
(a: number, b: typeof __): (b: number) => any[];
|
|
118
|
+
};
|
|
48
119
|
export declare const uniq: (xs: any[]) => any;
|
|
49
|
-
export declare const intersection:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export declare const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export declare const
|
|
62
|
-
export declare const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export declare const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export declare const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export declare const
|
|
79
|
-
|
|
80
|
-
|
|
120
|
+
export declare const intersection: {
|
|
121
|
+
(a: any[]): (b: any[]) => any[];
|
|
122
|
+
(a: any[], b: any[]): any[];
|
|
123
|
+
(a: typeof __, b: any[]): (a: any[]) => any[];
|
|
124
|
+
(a: any[], b: typeof __): (b: any[]) => any[];
|
|
125
|
+
};
|
|
126
|
+
export declare const genBy: {
|
|
127
|
+
(a: (i: number) => any): (b: number) => any[];
|
|
128
|
+
(a: (i: number) => any, b: number): any[];
|
|
129
|
+
(a: typeof __, b: number): (a: (i: number) => any) => any[];
|
|
130
|
+
(a: (i: number) => any, b: typeof __): (b: number) => any[];
|
|
131
|
+
};
|
|
132
|
+
export declare const once: <Func extends AnyFunc<any, AnyArgs>>(fn: Func) => (...args: Parameters<Func>) => any;
|
|
133
|
+
export declare const reverse: (xs: any[]) => FT.Curry<(fn: Reducer, accum: any, arr: any[]) => FT.Curry<(...p: [
|
|
134
|
+
] | [
|
|
135
|
+
accum: any
|
|
136
|
+
]) => any>>;
|
|
137
|
+
export declare const gt: {
|
|
138
|
+
(a: number): (b: number) => boolean;
|
|
139
|
+
(a: number, b: number): boolean;
|
|
140
|
+
(a: typeof __, b: number): (a: number) => boolean;
|
|
141
|
+
(a: number, b: typeof __): (b: number) => boolean;
|
|
142
|
+
};
|
|
143
|
+
export declare const lt: {
|
|
144
|
+
(a: number): (b: number) => boolean;
|
|
145
|
+
(a: number, b: number): boolean;
|
|
146
|
+
(a: typeof __, b: number): (a: number) => boolean;
|
|
147
|
+
(a: number, b: typeof __): (b: number) => boolean;
|
|
148
|
+
};
|
|
149
|
+
export declare const gte: {
|
|
150
|
+
(a: number): (b: number) => boolean;
|
|
151
|
+
(a: number, b: number): boolean;
|
|
152
|
+
(a: typeof __, b: number): (a: number) => boolean;
|
|
153
|
+
(a: number, b: typeof __): (b: number) => boolean;
|
|
154
|
+
};
|
|
155
|
+
export declare const lte: {
|
|
156
|
+
(a: number): (b: number) => boolean;
|
|
157
|
+
(a: number, b: number): boolean;
|
|
158
|
+
(a: typeof __, b: number): (a: number) => boolean;
|
|
159
|
+
(a: number, b: typeof __): (b: number) => boolean;
|
|
160
|
+
};
|
|
161
|
+
export declare const sort: {
|
|
162
|
+
(a: any): (b: any[]) => any[];
|
|
163
|
+
(a: any, b: any[]): any[];
|
|
164
|
+
(a: typeof __, b: any[]): (a: any) => any[];
|
|
165
|
+
(a: any, b: typeof __): (b: any[]) => any[];
|
|
166
|
+
};
|
|
167
|
+
export declare const find: {
|
|
168
|
+
(a: Cond): (b: any[]) => any;
|
|
169
|
+
(a: Cond, b: any[]): any;
|
|
170
|
+
(a: typeof __, b: any[]): (a: Cond) => any;
|
|
171
|
+
(a: Cond, b: typeof __): (b: any[]) => any;
|
|
172
|
+
};
|
|
173
|
+
export declare const findIndex: {
|
|
174
|
+
(a: Cond): (b: any[]) => number;
|
|
175
|
+
(a: Cond, b: any[]): number;
|
|
176
|
+
(a: typeof __, b: any[]): (a: Cond) => number;
|
|
177
|
+
(a: Cond, b: typeof __): (b: any[]) => number;
|
|
178
|
+
};
|
|
179
|
+
export declare const indexOf: {
|
|
180
|
+
(a: any): (b: any[]) => number;
|
|
181
|
+
(a: any, b: any[]): number;
|
|
182
|
+
(a: typeof __, b: any[]): (a: any) => number;
|
|
183
|
+
(a: any, b: typeof __): (b: any[]) => number;
|
|
184
|
+
};
|
|
185
|
+
export declare const explore: (caption: string, level?: string) => (b: any) => any;
|
|
186
|
+
export declare const cond: {
|
|
187
|
+
(a: [
|
|
188
|
+
Cond,
|
|
189
|
+
Function
|
|
190
|
+
][]): (b: any) => any;
|
|
191
|
+
(a: [
|
|
192
|
+
Cond,
|
|
193
|
+
Function
|
|
194
|
+
][], b: any): any;
|
|
195
|
+
(a: typeof __, b: any): (a: [
|
|
196
|
+
Cond,
|
|
197
|
+
Function
|
|
198
|
+
][]) => any;
|
|
199
|
+
(a: [
|
|
200
|
+
Cond,
|
|
201
|
+
Function
|
|
202
|
+
][], b: typeof __): (b: any) => any;
|
|
203
|
+
};
|
|
204
|
+
export declare const assoc: FT.Curry<(prop: string, v: any, obj: AnyObject) => {
|
|
205
|
+
[x: string]: any;
|
|
206
|
+
}>;
|
|
207
|
+
export declare const assocPath: any;
|
|
208
|
+
export declare const all: {
|
|
209
|
+
(a: Cond): (b: any[]) => boolean;
|
|
210
|
+
(a: Cond, b: any[]): boolean;
|
|
211
|
+
(a: typeof __, b: any[]): (a: Cond) => boolean;
|
|
212
|
+
(a: Cond, b: typeof __): (b: any[]) => boolean;
|
|
213
|
+
};
|
|
214
|
+
export declare const any: {
|
|
215
|
+
(a: Cond): (b: any[]) => boolean;
|
|
216
|
+
(a: Cond, b: any[]): boolean;
|
|
217
|
+
(a: typeof __, b: any[]): (a: Cond) => boolean;
|
|
218
|
+
(a: Cond, b: typeof __): (b: any[]) => boolean;
|
|
219
|
+
};
|
|
220
|
+
export declare const allPass: {
|
|
221
|
+
(a: Cond[]): (b: any) => boolean;
|
|
222
|
+
(a: Cond[], b: any): boolean;
|
|
223
|
+
(a: typeof __, b: any): (a: Cond[]) => boolean;
|
|
224
|
+
(a: Cond[], b: typeof __): (b: any) => boolean;
|
|
225
|
+
};
|
|
226
|
+
export declare const anyPass: {
|
|
227
|
+
(a: Cond[]): (b: any) => boolean;
|
|
228
|
+
(a: Cond[], b: any): boolean;
|
|
229
|
+
(a: typeof __, b: any): (a: Cond[]) => boolean;
|
|
230
|
+
(a: Cond[], b: typeof __): (b: any) => boolean;
|
|
231
|
+
};
|
|
232
|
+
export declare const prop: {
|
|
233
|
+
(a: string): (b: AnyObject) => any;
|
|
234
|
+
(a: string, b: AnyObject): any;
|
|
235
|
+
(a: typeof __, b: AnyObject): (a: string) => any;
|
|
236
|
+
(a: string, b: typeof __): (b: AnyObject) => any;
|
|
237
|
+
};
|
|
238
|
+
export declare const propEq: FT.Curry<(key: string, value: any, o: AnyObject) => boolean>;
|
|
239
|
+
export declare const propsEq: FT.Curry<(key: string, o1: any, o2: AnyObject) => boolean>;
|
|
240
|
+
export declare const pathOr: FT.Curry<(_default: any, path: string[], o: any) => any>;
|
|
241
|
+
export declare const path: FT.Curry<(path: string[], o: any) => any>;
|
|
242
|
+
export declare const pathEq: FT.Curry<(_path: string[], value: any, o: AnyObject) => boolean>;
|
|
243
|
+
export declare const pathsEq: FT.Curry<(_path: string[], o1: AnyObject, o2: AnyObject) => boolean>;
|
|
244
|
+
export declare const clone: (s: any, shallow?: boolean) => any;
|
|
245
|
+
export declare const cloneShallow: (s: any) => any;
|
|
246
|
+
export declare const reduce: FT.Curry<(fn: Reducer, accum: any, arr: any[]) => FT.Curry<(...p: [
|
|
247
|
+
] | [
|
|
248
|
+
accum: any
|
|
249
|
+
]) => any>>;
|
|
250
|
+
export declare const pickBy: {
|
|
251
|
+
(a: Cond): (b: AnyObject) => any;
|
|
252
|
+
(a: Cond, b: AnyObject): any;
|
|
253
|
+
(a: typeof __, b: AnyObject): (a: Cond) => any;
|
|
254
|
+
(a: Cond, b: typeof __): (b: AnyObject) => any;
|
|
255
|
+
};
|
|
256
|
+
export declare const pick: {
|
|
257
|
+
(a: string[]): (b: AnyObject) => {};
|
|
258
|
+
(a: string[], b: AnyObject): {};
|
|
259
|
+
(a: typeof __, b: AnyObject): (a: string[]) => {};
|
|
260
|
+
(a: string[], b: typeof __): (b: AnyObject) => {};
|
|
261
|
+
};
|
|
262
|
+
export declare const omit: {
|
|
263
|
+
(a: string[]): (b: AnyObject) => any;
|
|
264
|
+
(a: string[], b: AnyObject): any;
|
|
265
|
+
(a: typeof __, b: AnyObject): (a: string[]) => any;
|
|
266
|
+
(a: string[], b: typeof __): (b: AnyObject) => any;
|
|
267
|
+
};
|
|
81
268
|
export declare const fromPairs: (pairs: [
|
|
82
269
|
string,
|
|
83
270
|
any
|
|
84
|
-
][]) => any
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
export declare const
|
|
89
|
-
|
|
271
|
+
][]) => FT.Curry<(fn: Reducer, accum: any, arr: any[]) => FT.Curry<(...p: [
|
|
272
|
+
] | [
|
|
273
|
+
accum: any
|
|
274
|
+
]) => any>>;
|
|
275
|
+
export declare const concat: {
|
|
276
|
+
(a: string | any[]): (b: string | any[]) => string | any[];
|
|
277
|
+
(a: string | any[], b: string | any[]): string | any[];
|
|
278
|
+
(a: typeof __, b: string | any[]): (a: string | any[]) => string | any[];
|
|
279
|
+
(a: string | any[], b: typeof __): (b: string | any[]) => string | any[];
|
|
280
|
+
};
|
|
281
|
+
export declare const join: {
|
|
282
|
+
(a: string): (b: string[]) => string;
|
|
283
|
+
(a: string, b: string[]): string;
|
|
284
|
+
(a: typeof __, b: string[]): (a: string) => string;
|
|
285
|
+
(a: string, b: typeof __): (b: string[]) => string;
|
|
286
|
+
};
|
|
287
|
+
export declare const map: {
|
|
288
|
+
(a: (s: any) => any): (b: any[]) => any[];
|
|
289
|
+
(a: (s: any) => any, b: any[]): any[];
|
|
290
|
+
(a: typeof __, b: any[]): (a: (s: any) => any) => any[];
|
|
291
|
+
(a: (s: any) => any, b: typeof __): (b: any[]) => any[];
|
|
292
|
+
};
|
|
293
|
+
export declare const forEach: {
|
|
294
|
+
(a: (s: any) => any): (b: any[]) => void;
|
|
295
|
+
(a: (s: any) => any, b: any[]): void;
|
|
296
|
+
(a: typeof __, b: any[]): (a: (s: any) => any) => void;
|
|
297
|
+
(a: (s: any) => any, b: typeof __): (b: any[]) => void;
|
|
298
|
+
};
|
|
299
|
+
export declare const both: FT.Curry<(cond1: Cond, cond2: Cond, s: any) => boolean>;
|
|
90
300
|
export declare const isEmpty: (s: any) => boolean | null;
|
|
91
301
|
export declare const empty: (s: any) => {} | undefined;
|
|
92
|
-
export declare const replace: (
|
|
93
|
-
export declare const filter:
|
|
302
|
+
export declare const replace: FT.Curry<(a: string | RegExp, b: string, where: string) => string>;
|
|
303
|
+
export declare const filter: any;
|
|
94
304
|
export declare const memoize: (fn: Function) => () => any;
|
|
95
|
-
export declare const mergeShallow:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
305
|
+
export declare const mergeShallow: {
|
|
306
|
+
(a: AnyObject): (b: AnyObject) => AnyObject;
|
|
307
|
+
(a: AnyObject, b: AnyObject): AnyObject;
|
|
308
|
+
(a: typeof __, b: AnyObject): (a: AnyObject) => AnyObject;
|
|
309
|
+
(a: AnyObject, b: typeof __): (b: AnyObject) => AnyObject;
|
|
310
|
+
};
|
|
311
|
+
export declare const mergeDeep: {
|
|
312
|
+
(a: AnyObject): (b: AnyObject) => FT.Curry<(...p: [
|
|
313
|
+
] | [
|
|
314
|
+
o1: AnyObject,
|
|
315
|
+
o2: AnyObject
|
|
316
|
+
] | [
|
|
317
|
+
o2: AnyObject
|
|
318
|
+
] | [
|
|
319
|
+
o1: AnyObject
|
|
320
|
+
]) => any>;
|
|
321
|
+
(a: AnyObject, b: AnyObject): FT.Curry<(...p: [
|
|
322
|
+
] | [
|
|
323
|
+
o1: AnyObject,
|
|
324
|
+
o2: AnyObject
|
|
325
|
+
] | [
|
|
326
|
+
o2: AnyObject
|
|
327
|
+
] | [
|
|
328
|
+
o1: AnyObject
|
|
329
|
+
]) => any>;
|
|
330
|
+
(a: typeof __, b: AnyObject): (a: AnyObject) => FT.Curry<(...p: [
|
|
331
|
+
] | [
|
|
332
|
+
o1: AnyObject,
|
|
333
|
+
o2: AnyObject
|
|
334
|
+
] | [
|
|
335
|
+
o2: AnyObject
|
|
336
|
+
] | [
|
|
337
|
+
o1: AnyObject
|
|
338
|
+
]) => any>;
|
|
339
|
+
(a: AnyObject, b: typeof __): (b: AnyObject) => FT.Curry<(...p: [
|
|
340
|
+
] | [
|
|
341
|
+
o1: AnyObject,
|
|
342
|
+
o2: AnyObject
|
|
343
|
+
] | [
|
|
344
|
+
o2: AnyObject
|
|
345
|
+
] | [
|
|
346
|
+
o1: AnyObject
|
|
347
|
+
]) => any>;
|
|
348
|
+
};
|
|
349
|
+
export declare const mergeDeepX: {
|
|
350
|
+
(a: AnyObject): (b: AnyObject) => FT.Curry<(...p: [
|
|
351
|
+
] | [
|
|
352
|
+
o1: AnyObject,
|
|
353
|
+
o2: AnyObject
|
|
354
|
+
] | [
|
|
355
|
+
o2: AnyObject
|
|
356
|
+
] | [
|
|
357
|
+
o1: AnyObject
|
|
358
|
+
]) => any>;
|
|
359
|
+
(a: AnyObject, b: AnyObject): FT.Curry<(...p: [
|
|
360
|
+
] | [
|
|
361
|
+
o1: AnyObject,
|
|
362
|
+
o2: AnyObject
|
|
363
|
+
] | [
|
|
364
|
+
o2: AnyObject
|
|
365
|
+
] | [
|
|
366
|
+
o1: AnyObject
|
|
367
|
+
]) => any>;
|
|
368
|
+
(a: typeof __, b: AnyObject): (a: AnyObject) => FT.Curry<(...p: [
|
|
369
|
+
] | [
|
|
370
|
+
o1: AnyObject,
|
|
371
|
+
o2: AnyObject
|
|
372
|
+
] | [
|
|
373
|
+
o2: AnyObject
|
|
374
|
+
] | [
|
|
375
|
+
o1: AnyObject
|
|
376
|
+
]) => any>;
|
|
377
|
+
(a: AnyObject, b: typeof __): (b: AnyObject) => FT.Curry<(...p: [
|
|
378
|
+
] | [
|
|
379
|
+
o1: AnyObject,
|
|
380
|
+
o2: AnyObject
|
|
381
|
+
] | [
|
|
382
|
+
o2: AnyObject
|
|
383
|
+
] | [
|
|
384
|
+
o1: AnyObject
|
|
385
|
+
]) => any>;
|
|
386
|
+
};
|
|
387
|
+
export declare const mergeDeepAdd: {
|
|
388
|
+
(a: AnyObject): (b: AnyObject) => FT.Curry<(...p: [
|
|
389
|
+
] | [
|
|
390
|
+
o1: AnyObject,
|
|
391
|
+
o2: AnyObject
|
|
392
|
+
] | [
|
|
393
|
+
o2: AnyObject
|
|
394
|
+
] | [
|
|
395
|
+
o1: AnyObject
|
|
396
|
+
]) => any>;
|
|
397
|
+
(a: AnyObject, b: AnyObject): FT.Curry<(...p: [
|
|
398
|
+
] | [
|
|
399
|
+
o1: AnyObject,
|
|
400
|
+
o2: AnyObject
|
|
401
|
+
] | [
|
|
402
|
+
o2: AnyObject
|
|
403
|
+
] | [
|
|
404
|
+
o1: AnyObject
|
|
405
|
+
]) => any>;
|
|
406
|
+
(a: typeof __, b: AnyObject): (a: AnyObject) => FT.Curry<(...p: [
|
|
407
|
+
] | [
|
|
408
|
+
o1: AnyObject,
|
|
409
|
+
o2: AnyObject
|
|
410
|
+
] | [
|
|
411
|
+
o2: AnyObject
|
|
412
|
+
] | [
|
|
413
|
+
o1: AnyObject
|
|
414
|
+
]) => any>;
|
|
415
|
+
(a: AnyObject, b: typeof __): (b: AnyObject) => FT.Curry<(...p: [
|
|
416
|
+
] | [
|
|
417
|
+
o1: AnyObject,
|
|
418
|
+
o2: AnyObject
|
|
419
|
+
] | [
|
|
420
|
+
o2: AnyObject
|
|
421
|
+
] | [
|
|
422
|
+
o1: AnyObject
|
|
423
|
+
]) => any>;
|
|
424
|
+
};
|
|
425
|
+
export declare const overProp: FT.Curry<(prop: string, pipe: AnyFunc, data: any) => FT.Curry<(...p: [
|
|
426
|
+
] | [
|
|
427
|
+
v: any,
|
|
428
|
+
obj: AnyObject
|
|
429
|
+
] | [
|
|
430
|
+
obj: AnyObject
|
|
431
|
+
] | [
|
|
432
|
+
v: any
|
|
433
|
+
]) => any>>;
|
|
100
434
|
/** mapKeys({ a: 'b' }, { a: 44 }) -> { b: 44 } */
|
|
101
|
-
export declare const mapKeys:
|
|
435
|
+
export declare const mapKeys: {
|
|
436
|
+
(a: {
|
|
437
|
+
[oldKey: string]: string;
|
|
438
|
+
}): (b: AnyObject) => AnyObject;
|
|
439
|
+
(a: {
|
|
440
|
+
[oldKey: string]: string;
|
|
441
|
+
}, b: AnyObject): AnyObject;
|
|
442
|
+
(a: typeof __, b: AnyObject): (a: {
|
|
443
|
+
[oldKey: string]: string;
|
|
444
|
+
}) => AnyObject;
|
|
445
|
+
(a: {
|
|
446
|
+
[oldKey: string]: string;
|
|
447
|
+
}, b: typeof __): (b: AnyObject) => AnyObject;
|
|
448
|
+
};
|
|
102
449
|
/** One promise waits for another. */
|
|
103
|
-
export declare const forEachSerial:
|
|
450
|
+
export declare const forEachSerial: {
|
|
451
|
+
(a: AnyFunc<any, AnyArgs>): (b: any[]) => Promise<void>;
|
|
452
|
+
(a: AnyFunc<any, AnyArgs>, b: any[]): Promise<void>;
|
|
453
|
+
(a: typeof __, b: any[]): (a: AnyFunc<any, AnyArgs>) => Promise<void>;
|
|
454
|
+
(a: AnyFunc<any, AnyArgs>, b: typeof __): (b: any[]) => Promise<void>;
|
|
455
|
+
};
|
|
104
456
|
/** Promise.all wrapper for functional pipelining. */
|
|
105
457
|
export declare const waitAll: (promises: Promise<any>[]) => Promise<any[]>;
|
|
458
|
+
export declare const waitTap: {
|
|
459
|
+
(a: Function): (b: any) => Promise<any>;
|
|
460
|
+
(a: Function, b: any): Promise<any>;
|
|
461
|
+
(a: typeof __, b: any): (a: Function) => Promise<any>;
|
|
462
|
+
(a: Function, b: typeof __): (b: any) => Promise<any>;
|
|
463
|
+
};
|
|
106
464
|
/** Waits for all promises mapped by the fn. */
|
|
107
|
-
export declare const forEachAsync:
|
|
465
|
+
export declare const forEachAsync: {
|
|
466
|
+
(a: (item: any) => Promise<any>): (b: any[]) => Promise<any[]>;
|
|
467
|
+
(a: (item: any) => Promise<any>, b: any[]): Promise<any[]>;
|
|
468
|
+
(a: typeof __, b: any[]): (a: (item: any) => Promise<any>) => Promise<any[]>;
|
|
469
|
+
(a: (item: any) => Promise<any>, b: typeof __): (b: any[]) => Promise<any[]>;
|
|
470
|
+
};
|
|
108
471
|
/** The same as compose, but waits for promises in chains and returns a Promise. */
|
|
109
|
-
export declare const composeAsync:
|
|
472
|
+
export declare const composeAsync: import("ts-toolbelt/out/Function/Compose/Multi/Async").ComposeMultiAsync;
|
|
110
473
|
export declare const mirror: (s: any) => any;
|
|
111
474
|
export declare const reflect: (s: any) => any;
|
|
112
475
|
export declare const echo: (s: any) => any;
|
|
113
|
-
export declare const qappend:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
476
|
+
export declare const qappend: {
|
|
477
|
+
(a: any): (b: any[]) => any[];
|
|
478
|
+
(a: any, b: any[]): any[];
|
|
479
|
+
(a: typeof __, b: any[]): (a: any) => any[];
|
|
480
|
+
(a: any, b: typeof __): (b: any[]) => any[];
|
|
481
|
+
};
|
|
482
|
+
export declare const qassoc: import("ts-toolbelt/out/Function/Curry").Curry<(prop: string, v: any, obj: AnyObject) => AnyObject>;
|
|
483
|
+
export declare const qreduce: import("ts-toolbelt/out/Function/Curry").Curry<(<T>(fn: Reducer, accum: any, arr: T[]) => any)>;
|
|
484
|
+
export declare const qmergeDeep: import("ts-toolbelt/out/Function/Curry").Curry<(o1: AnyObject, o2: AnyObject) => AnyObject>;
|
|
485
|
+
export declare const qmergeDeepX: import("ts-toolbelt/out/Function/Curry").Curry<(o1: AnyObject, o2: AnyObject) => AnyObject>;
|
|
486
|
+
export declare const qmergeDeepAdd: import("ts-toolbelt/out/Function/Curry").Curry<(o1: AnyObject, o2: AnyObject) => AnyObject>;
|
|
119
487
|
/** qmapKeys({ a: 'b' }, { a: 44 }) -> { b: 44 } */
|
|
120
|
-
export declare const qmapKeys:
|
|
121
|
-
|
|
488
|
+
export declare const qmapKeys: {
|
|
489
|
+
(a: {
|
|
490
|
+
[oldKey: string]: string;
|
|
491
|
+
}): (b: AnyObject) => AnyObject;
|
|
492
|
+
(a: {
|
|
493
|
+
[oldKey: string]: string;
|
|
494
|
+
}, b: AnyObject): AnyObject;
|
|
495
|
+
(a: typeof __, b: AnyObject): (a: {
|
|
496
|
+
[oldKey: string]: string;
|
|
497
|
+
}) => AnyObject;
|
|
498
|
+
(a: {
|
|
499
|
+
[oldKey: string]: string;
|
|
500
|
+
}, b: typeof __): (b: AnyObject) => AnyObject;
|
|
501
|
+
};
|
|
502
|
+
export declare const qfilter: {
|
|
503
|
+
(a: (v: any, k: string | number) => boolean): (b: any[] | AnyObject) => any[] | AnyObject;
|
|
504
|
+
(a: (v: any, k: string | number) => boolean, b: any[] | AnyObject): any[] | AnyObject;
|
|
505
|
+
(a: typeof __, b: any[] | AnyObject): (a: (v: any, k: string | number) => boolean) => any[] | AnyObject;
|
|
506
|
+
(a: (v: any, k: string | number) => boolean, b: typeof __): (b: any[] | AnyObject) => any[] | AnyObject;
|
|
507
|
+
};
|
|
122
508
|
/** @deprecated */
|
|
123
|
-
export declare const qindexOf:
|
|
124
|
-
|
|
509
|
+
export declare const qindexOf: {
|
|
510
|
+
(a: any): (b: any[]) => number;
|
|
511
|
+
(a: any, b: any[]): number;
|
|
512
|
+
(a: typeof __, b: any[]): (a: any) => number;
|
|
513
|
+
(a: any, b: typeof __): (b: any[]) => number;
|
|
514
|
+
};
|
|
515
|
+
export type StrTmpl = ((data: AnyObject) => string);
|
|
125
516
|
export declare const getTmpl: (tmpl: string) => StrTmpl;
|
|
126
517
|
|
|
127
518
|
export {};
|