pepka 0.13.0-b5 → 0.13.0-b9
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 +3 -5
- package/package.json +1 -1
- package/src/safe.ts +5 -3
package/dist/bundle.d.ts
CHANGED
|
@@ -35,7 +35,8 @@ export declare const equals: {
|
|
|
35
35
|
};
|
|
36
36
|
export declare const ifElse: FT.Curry<AnyFunc<any, AnyArgs>>;
|
|
37
37
|
export declare const when: FT.Curry<(cond: (s: any) => boolean, pipe: (s: any) => any, s: any) => any>;
|
|
38
|
-
export
|
|
38
|
+
export type Composed = <TIn = any, TOut = any>(x: TIn) => TOut;
|
|
39
|
+
export declare const compose: (...fns: AnyFunc[]) => Composed;
|
|
39
40
|
export declare const bind: {
|
|
40
41
|
(a: symbol, b: any): (a: any) => any;
|
|
41
42
|
(a: any, b: symbol): (b: any) => any;
|
|
@@ -131,10 +132,7 @@ export declare const genBy: {
|
|
|
131
132
|
(a: (i: number) => any, b: number): any[];
|
|
132
133
|
};
|
|
133
134
|
export declare const once: <Func extends AnyFunc<any, AnyArgs>>(fn: Func) => (...args: Parameters<Func>) => any;
|
|
134
|
-
export declare const reverse: (xs: any[]) =>
|
|
135
|
-
] | [
|
|
136
|
-
accum: any
|
|
137
|
-
]) => any>>;
|
|
135
|
+
export declare const reverse: (xs: any[]) => any;
|
|
138
136
|
export declare const gt: {
|
|
139
137
|
(a: symbol, b: number): (a: number) => boolean;
|
|
140
138
|
(a: number, b: symbol): (b: number) => boolean;
|
package/package.json
CHANGED
package/src/safe.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __, curry, curry2, curry3 } from './curry'
|
|
2
|
-
import { isNum,
|
|
2
|
+
import { isNum, isUndef, undef, isNull, isArray, isFunc, isStr, isObj, inf } from './utils'
|
|
3
3
|
import { qmergeDeep, qreduce, qappend, qmapKeys, qmergeDeepX, qmergeDeepAdd } from './quick'
|
|
4
4
|
import { AnyFunc, Cond, AnyObject, Reducer } from './types'
|
|
5
5
|
import { type } from './common'
|
|
@@ -44,8 +44,10 @@ export const when = curry3(
|
|
|
44
44
|
s: any
|
|
45
45
|
) => ifElse(cond, pipe, identity, s)
|
|
46
46
|
)
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
/*: FT.Compose*/
|
|
48
|
+
type Composed = <TIn = any, TOut = any>(x: TIn) => TOut
|
|
49
|
+
export const compose = (
|
|
50
|
+
(...fns: AnyFunc[]): Composed =>
|
|
49
51
|
(s: any = __) => {
|
|
50
52
|
for(let i = length(fns)-1; i>-1; i--) {
|
|
51
53
|
s = s===__ ? fns[i]() : fns[i](s)
|