pepka 1.2.1 → 1.3.1
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/bundle.cjs +713 -1
- package/dist/bundle.d.ts +85 -48
- package/dist/bundle.mjs +567 -1
- package/package.json +3 -4
- package/rollup.config.js +2 -2
- package/src/async.ts +36 -0
- package/src/common.ts +42 -6
- package/src/index.ts +1 -0
- package/src/quick.ts +6 -5
- package/src/safe.ts +36 -100
- package/src/strings.ts +2 -2
- package/src/types.ts +2 -1
package/dist/bundle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
3
|
export type Cond = (x1?: any, x2?: any, x3?: any) => boolean;
|
|
4
4
|
export interface AnyObject {
|
|
@@ -9,6 +9,7 @@ export type Reducer<T = any> = (accum: T, cur: any, index: number) => T;
|
|
|
9
9
|
export type AnyFunc<ReturnT = any, Args extends AnyArgs = AnyArgs> = (...args: Args) => ReturnT;
|
|
10
10
|
export type TupleFn<ARG1 = any, ARG2 = any, Out = any> = (a: ARG1, b: ARG2) => Out;
|
|
11
11
|
export type Curried<Args extends AnyArgs = AnyArgs, ReturnT = any> = (arg: Args[number]) => Curried<Args> | ReturnT;
|
|
12
|
+
export type BasicType = "String" | "Object" | "Number" | "Symbol" | "Array" | "Null" | "Undefined";
|
|
12
13
|
type Placeholder = symbol;
|
|
13
14
|
export declare const __: Placeholder;
|
|
14
15
|
export declare const curry: (fn: AnyFunc) => (...args: AnyArgs) => any;
|
|
@@ -25,27 +26,42 @@ export declare const uncurry: <Args extends any[] = any[], ReturnT = any>(fn: Cu
|
|
|
25
26
|
export declare const symbol: unique symbol;
|
|
26
27
|
export declare const toLower: (s: string) => string;
|
|
27
28
|
export declare const toUpper: (s: string) => string;
|
|
28
|
-
export declare const type: (s: any) =>
|
|
29
|
+
export declare const type: (s: any) => string;
|
|
29
30
|
export declare const typeIs: {
|
|
30
31
|
(a: symbol, b: any): (a: string) => boolean;
|
|
31
32
|
(a: string, b: symbol): (b: any) => boolean;
|
|
32
33
|
(a: string): (b: any) => boolean;
|
|
33
34
|
(a: string, b: any): boolean;
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
+
declare const length$1: (s: any[] | string) => number;
|
|
37
|
+
export declare const isNil: (s: any) => boolean;
|
|
36
38
|
export declare const eq: {
|
|
37
39
|
(a: symbol, b: any): (a: any) => boolean;
|
|
38
40
|
(a: any, b: symbol): (b: any) => boolean;
|
|
39
41
|
(a: any): (b: any) => boolean;
|
|
40
42
|
(a: any, b: any): boolean;
|
|
41
43
|
};
|
|
42
|
-
export declare const
|
|
44
|
+
export declare const equals: {
|
|
43
45
|
(a: symbol, b: any): (a: any) => boolean;
|
|
44
46
|
(a: any, b: symbol): (b: any) => boolean;
|
|
45
47
|
(a: any): (b: any) => boolean;
|
|
46
48
|
(a: any, b: any): boolean;
|
|
47
49
|
};
|
|
48
|
-
export declare const
|
|
50
|
+
export declare const includes: {
|
|
51
|
+
(a: symbol, b: unknown[]): (a: unknown) => boolean;
|
|
52
|
+
(a: unknown, b: symbol): (b: unknown[]) => boolean;
|
|
53
|
+
(a: unknown): (b: unknown[]) => boolean;
|
|
54
|
+
(a: unknown, b: unknown[]): boolean;
|
|
55
|
+
};
|
|
56
|
+
/** @param start string | any[] @param s string | any[] */
|
|
57
|
+
export declare const qstartsWithWith: (comparator: (x: any, y: any) => boolean) => {
|
|
58
|
+
(a: symbol, b: string | any[]): (a: string | any[]) => boolean;
|
|
59
|
+
(a: string | any[], b: symbol): (b: string | any[]) => boolean;
|
|
60
|
+
(a: string | any[]): (b: string | any[]) => boolean;
|
|
61
|
+
(a: string | any[], b: string | any[]): boolean;
|
|
62
|
+
};
|
|
63
|
+
export declare const take: (argN: number) => (...args: any[]) => any;
|
|
64
|
+
export declare const weakEq: {
|
|
49
65
|
(a: symbol, b: any): (a: any) => boolean;
|
|
50
66
|
(a: any, b: symbol): (b: any) => boolean;
|
|
51
67
|
(a: any): (b: any) => boolean;
|
|
@@ -67,12 +83,6 @@ export declare const nth: {
|
|
|
67
83
|
(a: number): (b: string | unknown[]) => unknown;
|
|
68
84
|
(a: number, b: string | unknown[]): unknown;
|
|
69
85
|
};
|
|
70
|
-
export declare const includes: {
|
|
71
|
-
(a: symbol, b: unknown[]): (a: unknown) => boolean;
|
|
72
|
-
(a: unknown, b: symbol): (b: unknown[]) => boolean;
|
|
73
|
-
(a: unknown): (b: unknown[]) => boolean;
|
|
74
|
-
(a: unknown, b: unknown[]): boolean;
|
|
75
|
-
};
|
|
76
86
|
export declare const slice: (...args: AnyArgs) => any;
|
|
77
87
|
export declare const flip: <T extends AnyFunc>(fn: T) => {
|
|
78
88
|
(a: symbol, b: Parameters<T>[0]): (a: Parameters<T>[1]) => any;
|
|
@@ -80,44 +90,53 @@ export declare const flip: <T extends AnyFunc>(fn: T) => {
|
|
|
80
90
|
(a: Parameters<T>[1]): (b: Parameters<T>[0]) => any;
|
|
81
91
|
(a: Parameters<T>[1], b: Parameters<T>[0]): any;
|
|
82
92
|
};
|
|
93
|
+
/** @returns first element of an array. */
|
|
83
94
|
export declare const head: <T = any>(xs: T[] | string) => T;
|
|
95
|
+
/** @returns last element of an array. */
|
|
84
96
|
export declare const tail: any;
|
|
97
|
+
/** @param a @param b @returns a+b */
|
|
85
98
|
export declare const add: {
|
|
86
99
|
(a: symbol, b: number): (a: number) => number;
|
|
87
100
|
(a: number, b: symbol): (b: number) => number;
|
|
88
101
|
(a: number): (b: number) => number;
|
|
89
102
|
(a: number, b: number): number;
|
|
90
103
|
};
|
|
104
|
+
/** @param a @param b @returns b-a */
|
|
91
105
|
export declare const subtract: {
|
|
92
106
|
(a: symbol, b: number): (a: number) => number;
|
|
93
107
|
(a: number, b: symbol): (b: number) => number;
|
|
94
108
|
(a: number): (b: number) => number;
|
|
95
109
|
(a: number, b: number): number;
|
|
96
110
|
};
|
|
111
|
+
/**@param a @param b @returns a*b */
|
|
97
112
|
export declare const multiply: {
|
|
98
113
|
(a: symbol, b: number): (a: number) => number;
|
|
99
114
|
(a: number, b: symbol): (b: number) => number;
|
|
100
115
|
(a: number): (b: number) => number;
|
|
101
116
|
(a: number, b: number): number;
|
|
102
117
|
};
|
|
118
|
+
/** @param a @param b @returns a<b */
|
|
103
119
|
export declare const gt: {
|
|
104
120
|
(a: symbol, b: number): (a: number) => boolean;
|
|
105
121
|
(a: number, b: symbol): (b: number) => boolean;
|
|
106
122
|
(a: number): (b: number) => boolean;
|
|
107
123
|
(a: number, b: number): boolean;
|
|
108
124
|
};
|
|
125
|
+
/** @param a @param b @returns a>b */
|
|
109
126
|
export declare const lt: {
|
|
110
127
|
(a: symbol, b: number): (a: number) => boolean;
|
|
111
128
|
(a: number, b: symbol): (b: number) => boolean;
|
|
112
129
|
(a: number): (b: number) => boolean;
|
|
113
130
|
(a: number, b: number): boolean;
|
|
114
131
|
};
|
|
132
|
+
/** @param a @param b @returns a<=b */
|
|
115
133
|
export declare const gte: {
|
|
116
134
|
(a: symbol, b: number): (a: number) => boolean;
|
|
117
135
|
(a: number, b: symbol): (b: number) => boolean;
|
|
118
136
|
(a: number): (b: number) => boolean;
|
|
119
137
|
(a: number, b: number): boolean;
|
|
120
138
|
};
|
|
139
|
+
/** @param a @param b @returns a>=b */
|
|
121
140
|
export declare const lte: {
|
|
122
141
|
(a: symbol, b: number): (a: number) => boolean;
|
|
123
142
|
(a: number, b: symbol): (b: number) => boolean;
|
|
@@ -154,12 +173,17 @@ export declare const divide: {
|
|
|
154
173
|
(a: number): (b: number) => number;
|
|
155
174
|
(a: number, b: number): number;
|
|
156
175
|
};
|
|
157
|
-
export declare const isNil: (s: any) => boolean;
|
|
158
|
-
declare const length$1: (s: any[] | string) => number;
|
|
159
176
|
export declare const always: <T = any>(s: T) => () => T;
|
|
160
177
|
export declare const identity: (s: any) => any;
|
|
161
178
|
export declare const trim: (s: string) => string;
|
|
162
179
|
export declare const last: (s: any[] | string) => any;
|
|
180
|
+
/** @param start string | any[] @param s string | any[] */
|
|
181
|
+
export declare const startsWith: {
|
|
182
|
+
(a: symbol, b: string | any[]): (a: string | any[]) => boolean;
|
|
183
|
+
(a: string | any[], b: symbol): (b: string | any[]) => boolean;
|
|
184
|
+
(a: string | any[]): (b: string | any[]) => boolean;
|
|
185
|
+
(a: string | any[], b: string | any[]): boolean;
|
|
186
|
+
};
|
|
163
187
|
type NotOverload = {
|
|
164
188
|
(x: true): false;
|
|
165
189
|
(x: false): true;
|
|
@@ -239,6 +263,7 @@ export declare const range: {
|
|
|
239
263
|
(a: number): (b: number) => any[];
|
|
240
264
|
(a: number, b: number): any[];
|
|
241
265
|
};
|
|
266
|
+
/** @param xs any[] @returns xs without duplicates. */
|
|
242
267
|
export declare const uniq: (xs: any[]) => any;
|
|
243
268
|
export declare const intersection: {
|
|
244
269
|
(a: symbol, b: any[]): (a: any[]) => any[];
|
|
@@ -304,13 +329,16 @@ export declare const anyPass: {
|
|
|
304
329
|
(a: Cond[]): (b: any) => boolean;
|
|
305
330
|
(a: Cond[], b: any): boolean;
|
|
306
331
|
};
|
|
332
|
+
/** @param key string @param o AnyObject @returns o[key] */
|
|
307
333
|
export declare const prop: {
|
|
308
334
|
(a: symbol, b: AnyObject): (a: string) => any;
|
|
309
335
|
(a: string, b: symbol): (b: AnyObject) => any;
|
|
310
336
|
(a: string): (b: AnyObject) => any;
|
|
311
337
|
(a: string, b: AnyObject): any;
|
|
312
338
|
};
|
|
339
|
+
/** @param key string @param value any @param o AnyObject @returns o[key] equals value */
|
|
313
340
|
export declare const propEq: (...args: AnyArgs) => any;
|
|
341
|
+
/** @param key string @param o1 AnyObject @param o2 AnyObject @returns o₁[key] equals o₂[key] */
|
|
314
342
|
export declare const propsEq: (...args: AnyArgs) => any;
|
|
315
343
|
export declare const pathOr: any;
|
|
316
344
|
export declare const path: any;
|
|
@@ -357,12 +385,6 @@ export declare const concat: {
|
|
|
357
385
|
(a: string | any[]): (b: string | any[]) => string | any[];
|
|
358
386
|
(a: string | any[], b: string | any[]): string | any[];
|
|
359
387
|
};
|
|
360
|
-
export declare const join: {
|
|
361
|
-
(a: symbol, b: string[]): (a: string) => string;
|
|
362
|
-
(a: string, b: symbol): (b: string[]) => string;
|
|
363
|
-
(a: string): (b: string[]) => string;
|
|
364
|
-
(a: string, b: string[]): string;
|
|
365
|
-
};
|
|
366
388
|
export declare const map: {
|
|
367
389
|
(a: symbol, b: any[]): (a: (s: any, i?: number, list?: any[]) => any) => any[];
|
|
368
390
|
(a: (s: any, i?: number, list?: any[]) => any, b: symbol): (b: any[]) => any[];
|
|
@@ -375,6 +397,12 @@ export declare const mapObj: {
|
|
|
375
397
|
(a: (s: any, i?: string, list?: any[]) => any): (b: AnyObject) => (b: AnyObject) => (a: (s: any, i?: number | undefined, list?: any[] | undefined) => any) => any[];
|
|
376
398
|
(a: (s: any, i?: string, list?: any[]) => any, b: AnyObject): (b: AnyObject) => (a: (s: any, i?: number | undefined, list?: any[] | undefined) => any) => any[];
|
|
377
399
|
};
|
|
400
|
+
export declare const join: {
|
|
401
|
+
(a: symbol, b: string[]): (a: string) => string;
|
|
402
|
+
(a: string, b: symbol): (b: string[]) => string;
|
|
403
|
+
(a: string): (b: string[]) => string;
|
|
404
|
+
(a: string, b: string[]): string;
|
|
405
|
+
};
|
|
378
406
|
export declare const forEach: {
|
|
379
407
|
(a: symbol, b: any[]): (a: (s: any) => any) => void;
|
|
380
408
|
(a: (s: any) => any, b: symbol): (b: any[]) => void;
|
|
@@ -451,35 +479,6 @@ export declare const zipObj: {
|
|
|
451
479
|
* @param b T2[]
|
|
452
480
|
*/
|
|
453
481
|
export declare const zipWith: (...args: AnyArgs) => any;
|
|
454
|
-
/** One promise waits for another. */
|
|
455
|
-
export declare const forEachSerial: {
|
|
456
|
-
(a: symbol, b: any[]): (a: AnyFunc) => Promise<void>;
|
|
457
|
-
(a: AnyFunc, b: symbol): (b: any[]) => Promise<void>;
|
|
458
|
-
(a: AnyFunc): (b: any[]) => Promise<void>;
|
|
459
|
-
(a: AnyFunc, b: any[]): Promise<void>;
|
|
460
|
-
};
|
|
461
|
-
/** Promise.all wrapper for functional pipelining. */
|
|
462
|
-
export declare const waitAll: (promises: Promise<any>[]) => Promise<any[]>;
|
|
463
|
-
/** Waits for a Promise that been generated by the first arg, then returns an untoched value. Types T.
|
|
464
|
-
* @param {AnyFunc<Promise>} fn - function to wait.
|
|
465
|
-
* @param {T} s - any value to tap and return back
|
|
466
|
-
* @returns {T}
|
|
467
|
-
*/
|
|
468
|
-
export declare const waitTap: {
|
|
469
|
-
(a: symbol, b: any): (a: AnyFunc) => Promise<any>;
|
|
470
|
-
(a: AnyFunc, b: symbol): (b: any) => Promise<any>;
|
|
471
|
-
(a: AnyFunc): (b: any) => Promise<any>;
|
|
472
|
-
(a: AnyFunc, b: any): Promise<any>;
|
|
473
|
-
};
|
|
474
|
-
/** Waits for all promises mapped by the fn. */
|
|
475
|
-
export declare const forEachAsync: {
|
|
476
|
-
(a: symbol, b: any[]): (a: (item: any) => Promise<any>) => Promise<any[]>;
|
|
477
|
-
(a: (item: any) => Promise<any>, b: symbol): (b: any[]) => Promise<any[]>;
|
|
478
|
-
(a: (item: any) => Promise<any>): (b: any[]) => Promise<any[]>;
|
|
479
|
-
(a: (item: any) => Promise<any>, b: any[]): Promise<any[]>;
|
|
480
|
-
};
|
|
481
|
-
/** The same as compose, but waits for promises in chains and returns a Promise. */
|
|
482
|
-
export declare const composeAsync: <T = any>(...fns: AnyFunc[]) => (...input: any[]) => Promise<T>;
|
|
483
482
|
export declare const mirror: (s: any) => any;
|
|
484
483
|
export declare const reflect: (s: any) => any;
|
|
485
484
|
export declare const echo: (s: any) => any;
|
|
@@ -563,8 +562,46 @@ export declare const qomit: {
|
|
|
563
562
|
(a: string[]): (b: AnyObject) => any[] | AnyObject;
|
|
564
563
|
(a: string[], b: AnyObject): any[] | AnyObject;
|
|
565
564
|
};
|
|
565
|
+
/** @param start string | any[] @param s string | any[] */
|
|
566
|
+
export declare const qstartsWith: {
|
|
567
|
+
(a: symbol, b: string | any[]): (a: string | any[]) => boolean;
|
|
568
|
+
(a: string | any[], b: symbol): (b: string | any[]) => boolean;
|
|
569
|
+
(a: string | any[]): (b: string | any[]) => boolean;
|
|
570
|
+
(a: string | any[], b: string | any[]): boolean;
|
|
571
|
+
};
|
|
566
572
|
type StrTmpl = ((data: AnyObject) => string);
|
|
573
|
+
/** Supports ecrans: '\\{"json": {yes} \\}'
|
|
574
|
+
@returns get_tmpl(one{meme}two)({meme: 42}) -> one42two */
|
|
567
575
|
export declare const getTmpl: (tmpl: string) => StrTmpl;
|
|
576
|
+
/** One promise waits for another. */
|
|
577
|
+
export declare const forEachSerial: {
|
|
578
|
+
(a: symbol, b: any[]): (a: AnyFunc) => Promise<void>;
|
|
579
|
+
(a: AnyFunc, b: symbol): (b: any[]) => Promise<void>;
|
|
580
|
+
(a: AnyFunc): (b: any[]) => Promise<void>;
|
|
581
|
+
(a: AnyFunc, b: any[]): Promise<void>;
|
|
582
|
+
};
|
|
583
|
+
/** Promise.all wrapper for functional pipelining. */
|
|
584
|
+
export declare const waitAll: (promises: Promise<any>[]) => Promise<any[]>;
|
|
585
|
+
/** Waits for a Promise that been generated by the first arg, then returns an untoched value. Types T.
|
|
586
|
+
* @param {AnyFunc<Promise>} fn - function to wait.
|
|
587
|
+
* @param {T} s - any value to tap and return back
|
|
588
|
+
* @returns {T}
|
|
589
|
+
*/
|
|
590
|
+
export declare const waitTap: {
|
|
591
|
+
(a: symbol, b: any): (a: AnyFunc) => Promise<any>;
|
|
592
|
+
(a: AnyFunc, b: symbol): (b: any) => Promise<any>;
|
|
593
|
+
(a: AnyFunc): (b: any) => Promise<any>;
|
|
594
|
+
(a: AnyFunc, b: any): Promise<any>;
|
|
595
|
+
};
|
|
596
|
+
/** Waits for all promises mapped by the fn. */
|
|
597
|
+
export declare const forEachAsync: {
|
|
598
|
+
(a: symbol, b: any[]): (a: (item: any) => Promise<any>) => Promise<any[]>;
|
|
599
|
+
(a: (item: any) => Promise<any>, b: symbol): (b: any[]) => Promise<any[]>;
|
|
600
|
+
(a: (item: any) => Promise<any>): (b: any[]) => Promise<any[]>;
|
|
601
|
+
(a: (item: any) => Promise<any>, b: any[]): Promise<any[]>;
|
|
602
|
+
};
|
|
603
|
+
/** The same as compose, but waits for promises in chains and returns a Promise. */
|
|
604
|
+
export declare const composeAsync: <T = any>(...fns: AnyFunc[]) => (...input: any[]) => Promise<T>;
|
|
568
605
|
|
|
569
606
|
export {
|
|
570
607
|
length$1 as length,
|