pepka 0.14.0-beta5 → 0.14.0-beta7
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.d.ts +6 -2
- package/package.json +1 -1
- package/src/safe.ts +4 -4
package/dist/bundle.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export type AnyArgs = any[];
|
|
|
11
11
|
export type Curried<Args extends AnyArgs = AnyArgs, ReturnT = any> = (arg: Args[number]) => Curried<Args> | ReturnT;
|
|
12
12
|
export type Reducer = <T = any>(accum: T, cur: any, index: number) => T;
|
|
13
13
|
export type AnyFunc<ReturnT = any, Args extends AnyArgs = AnyArgs> = (...args: Args) => ReturnT;
|
|
14
|
-
export type TupleFn<ARG1 = any, ARG2 = any, Out = any> = (a: ARG1, b: ARG2) => Out;
|
|
15
14
|
export type Placeholder = symbol;
|
|
16
15
|
declare const __: Placeholder;
|
|
17
16
|
export declare const curry: <Func extends AnyFunc<any, AnyArgs>>(fn: AnyFunc) => FT.Curry<Func>;
|
|
@@ -64,7 +63,12 @@ export declare const includes: {
|
|
|
64
63
|
(a: unknown, b: unknown[]): boolean;
|
|
65
64
|
};
|
|
66
65
|
export declare const slice: FT.Curry<(from: number, to: number, o: any[] | string) => string | any[]>;
|
|
67
|
-
export declare const flip: <
|
|
66
|
+
export declare const flip: <T extends AnyFunc<any, AnyArgs>>(fn: T) => {
|
|
67
|
+
(a: symbol, b: Parameters<T>[0]): (a: Parameters<T>[1]) => any;
|
|
68
|
+
(a: Parameters<T>[1], b: symbol): (b: Parameters<T>[0]) => any;
|
|
69
|
+
(a: Parameters<T>[1]): (b: Parameters<T>[0]) => any;
|
|
70
|
+
(a: Parameters<T>[1], b: Parameters<T>[0]): any;
|
|
71
|
+
};
|
|
68
72
|
export declare const head: (b: string | unknown[]) => unknown;
|
|
69
73
|
export declare const tail: FT.Curry<(o: string | any[]) => string | any[]>;
|
|
70
74
|
export declare const add: {
|
package/package.json
CHANGED
package/src/safe.ts
CHANGED
|
@@ -87,10 +87,10 @@ export const slice = curry3(
|
|
|
87
87
|
(from: number, to: number, o: any[] | string) =>
|
|
88
88
|
o.slice(from, (isNum(to)?to:inf) as number)
|
|
89
89
|
)
|
|
90
|
-
export const flip =
|
|
91
|
-
fn:
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
export const flip =
|
|
91
|
+
<T extends AnyFunc>(fn: T) => curry2(
|
|
92
|
+
(b: Parameters<T>[1], a: Parameters<T>[0]) => fn(a, b)
|
|
93
|
+
)
|
|
94
94
|
export const head = nth(0)
|
|
95
95
|
export const tail = slice(1, inf) // typeshit.
|
|
96
96
|
export const add = curry2((n: number, m: number) => n+m)
|