pepka 0.13.0-beta10 → 0.13.0-beta11
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 +2 -2
- package/dist/bundle.dev.js +4 -2
- package/dist/es/safe.js +4 -2
- package/package.json +1 -1
- package/src/safe.ts +2 -1
package/dist/bundle.d.ts
CHANGED
|
@@ -298,7 +298,7 @@ export declare const forEach: {
|
|
|
298
298
|
export declare const both: FT.Curry<(cond1: Cond, cond2: Cond, s: any) => boolean>;
|
|
299
299
|
export declare const isEmpty: (s: any) => boolean | null;
|
|
300
300
|
export declare const empty: (s: any) => {} | undefined;
|
|
301
|
-
export declare const replace: FT.Curry<(a: string | RegExp, b: string, where: string) => string>;
|
|
301
|
+
export declare const replace: FT.Curry<(a: string | RegExp, b: string | ((substring: string, ...ps: any[]) => string), where: string) => string>;
|
|
302
302
|
export declare const filter: any;
|
|
303
303
|
export declare const memoize: (fn: Function) => () => any;
|
|
304
304
|
export declare const mergeShallow: {
|
|
@@ -468,7 +468,7 @@ export declare const forEachAsync: {
|
|
|
468
468
|
(a: (item: any) => Promise<any>, b: any[]): Promise<any[]>;
|
|
469
469
|
};
|
|
470
470
|
/** The same as compose, but waits for promises in chains and returns a Promise. */
|
|
471
|
-
export declare const composeAsync:
|
|
471
|
+
export declare const composeAsync: <T = any>(...fns: AnyFunc[]) => (data?: any) => Promise<T>;
|
|
472
472
|
export declare const mirror: (s: any) => any;
|
|
473
473
|
export declare const reflect: (s: any) => any;
|
|
474
474
|
export declare const echo: (s: any) => any;
|
package/dist/bundle.dev.js
CHANGED
|
@@ -370,7 +370,9 @@ const empty = (s) => {
|
|
|
370
370
|
default: return undef;
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
|
-
const replace = curry3((a, b, where
|
|
373
|
+
const replace = curry3((a, b, where
|
|
374
|
+
// @ts-ignore-next Some bug with overload.
|
|
375
|
+
) => where.replace(a, b));
|
|
374
376
|
const filter = curry2((cond, data) => isArray(data)
|
|
375
377
|
? data.filter(cond)
|
|
376
378
|
: compose(fromPairs, filter(([k, v]) => cond(v, k)), toPairs)(data));
|
|
@@ -406,7 +408,7 @@ const forEachAsync = curry2((fn, items) => Promise.all(items.map(fn)));
|
|
|
406
408
|
const composeAsync = (() => {
|
|
407
409
|
const pipe = async (fns, data, i) => ~i ? await pipe(fns, await fns[i](data), --i) : data;
|
|
408
410
|
return (...fns) => (data) => pipe(fns, data, fns.length - 1);
|
|
409
|
-
})();
|
|
411
|
+
})(); // as FT.Compose<'async'>
|
|
410
412
|
// ALIASES
|
|
411
413
|
const mirror = identity;
|
|
412
414
|
const reflect = identity;
|
package/dist/es/safe.js
CHANGED
|
@@ -198,7 +198,9 @@ export const empty = (s) => {
|
|
|
198
198
|
default: return undef;
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
export const replace = curry3((a, b, where
|
|
201
|
+
export const replace = curry3((a, b, where
|
|
202
|
+
// @ts-ignore-next Some bug with overload.
|
|
203
|
+
) => where.replace(a, b));
|
|
202
204
|
export const filter = curry2((cond, data) => isArray(data)
|
|
203
205
|
? data.filter(cond)
|
|
204
206
|
: compose(fromPairs, filter(([k, v]) => cond(v, k)), toPairs)(data));
|
|
@@ -234,7 +236,7 @@ export const forEachAsync = curry2((fn, items) => Promise.all(items.map(fn)));
|
|
|
234
236
|
export const composeAsync = (() => {
|
|
235
237
|
const pipe = async (fns, data, i) => ~i ? await pipe(fns, await fns[i](data), --i) : data;
|
|
236
238
|
return (...fns) => (data) => pipe(fns, data, fns.length - 1);
|
|
237
|
-
})();
|
|
239
|
+
})(); // as FT.Compose<'async'>
|
|
238
240
|
// ALIASES
|
|
239
241
|
export const mirror = identity;
|
|
240
242
|
export const reflect = identity;
|
package/package.json
CHANGED
package/src/safe.ts
CHANGED
|
@@ -311,8 +311,9 @@ export const empty = (s: any) => {
|
|
|
311
311
|
export const replace = curry3(
|
|
312
312
|
(
|
|
313
313
|
a: string | RegExp,
|
|
314
|
-
b: string,
|
|
314
|
+
b: string | ((substring: string, ...ps: any[]) => string),
|
|
315
315
|
where: string
|
|
316
|
+
// @ts-ignore-next Some bug with overload.
|
|
316
317
|
) => where.replace(a, b)
|
|
317
318
|
)
|
|
318
319
|
export const filter = curry2(
|