pepka 0.14.0-beta7 → 0.14.0-beta8
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 +4 -4
- package/package.json +1 -1
- package/src/safe.ts +1 -1
- package/src/types.ts +1 -1
package/dist/bundle.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface AnyObject {
|
|
|
9
9
|
}
|
|
10
10
|
export type AnyArgs = any[];
|
|
11
11
|
export type Curried<Args extends AnyArgs = AnyArgs, ReturnT = any> = (arg: Args[number]) => Curried<Args> | ReturnT;
|
|
12
|
-
export type Reducer
|
|
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
14
|
export type Placeholder = symbol;
|
|
15
15
|
declare const __: Placeholder;
|
|
@@ -266,10 +266,10 @@ export declare const pathEq: FT.Curry<(_path: string[], value: any, o: AnyObject
|
|
|
266
266
|
export declare const pathsEq: FT.Curry<(_path: string[], o1: AnyObject, o2: AnyObject) => (a: any) => boolean>;
|
|
267
267
|
export declare const clone: (s: any, shallow?: boolean) => any;
|
|
268
268
|
export declare const cloneShallow: (s: any) => any;
|
|
269
|
-
export declare const reduce: FT.Curry<(fn: Reducer
|
|
269
|
+
export declare const reduce: FT.Curry<(<T = any>(fn: Reducer<T>, accum: T, arr: any[]) => FT.Curry<(...p: [
|
|
270
270
|
] | [
|
|
271
271
|
accum: any
|
|
272
|
-
]) => any
|
|
272
|
+
]) => any>)>;
|
|
273
273
|
export declare const pickBy: {
|
|
274
274
|
(a: symbol, b: AnyObject): (a: Cond) => any;
|
|
275
275
|
(a: Cond, b: symbol): (b: AnyObject) => any;
|
|
@@ -291,7 +291,7 @@ export declare const omit: {
|
|
|
291
291
|
export declare const fromPairs: (pairs: [
|
|
292
292
|
string,
|
|
293
293
|
any
|
|
294
|
-
][]) => FT.Curry<(fn: Reducer
|
|
294
|
+
][]) => FT.Curry<(fn: Reducer<unknown>, accum: unknown, arr: any[]) => FT.Curry<(...p: [
|
|
295
295
|
] | [
|
|
296
296
|
accum: any
|
|
297
297
|
]) => any>>;
|
package/package.json
CHANGED
package/src/safe.ts
CHANGED
|
@@ -259,7 +259,7 @@ export const clone = (s: any, shallow = false) => {
|
|
|
259
259
|
export const cloneShallow = (s: any) => clone(s, true)
|
|
260
260
|
|
|
261
261
|
export const reduce = curry3(
|
|
262
|
-
(fn: Reducer
|
|
262
|
+
<T = any>(fn: Reducer<T>, accum: T, arr: any[]) =>
|
|
263
263
|
qreduce(fn, clone(accum), arr)
|
|
264
264
|
)
|
|
265
265
|
export const pickBy = curry2(
|
package/src/types.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type Curried<
|
|
|
7
7
|
Args extends AnyArgs = AnyArgs,
|
|
8
8
|
ReturnT = any
|
|
9
9
|
> = (arg: Args[number]) => Curried<Args> | ReturnT
|
|
10
|
-
export type Reducer
|
|
10
|
+
export type Reducer<T=any> = (accum: T, cur: any, index: number) => T
|
|
11
11
|
export type AnyFunc<
|
|
12
12
|
ReturnT = any,
|
|
13
13
|
Args extends AnyArgs = AnyArgs
|