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