pepka 1.6.10 → 1.6.12
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 +12 -7
- package/package.json +8 -8
- package/src/curry.ts +2 -2
- package/src/safe.ts +8 -1
package/dist/bundle.d.ts
CHANGED
|
@@ -242,12 +242,14 @@ export declare const test: {
|
|
|
242
242
|
(a: RegExp): (b: string) => boolean;
|
|
243
243
|
(a: RegExp, b: string): boolean;
|
|
244
244
|
};
|
|
245
|
-
|
|
246
|
-
(
|
|
247
|
-
(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
};
|
|
245
|
+
type T_tap = {
|
|
246
|
+
<T>(fn: (x: T) => any, x: T): T;
|
|
247
|
+
(fn: AnyFunc): {
|
|
248
|
+
<T>(x: T): T;
|
|
249
|
+
(): undefined;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
export declare const tap: T_tap;
|
|
251
253
|
export declare const append: {
|
|
252
254
|
(a: symbol, b: any[]): (a: any) => any[];
|
|
253
255
|
(a: any, b: symbol): (b: any[]) => any[];
|
|
@@ -325,7 +327,10 @@ export declare const genBy: {
|
|
|
325
327
|
};
|
|
326
328
|
export declare const once: <Func extends AnyFunc>(fn: Func) => (...args: Parameters<Func>) => any;
|
|
327
329
|
export declare const reverse: <T extends any>(xs: T[]) => T[];
|
|
328
|
-
export declare const explore: (caption: string, level?: string) =>
|
|
330
|
+
export declare const explore: (caption: string, level?: string) => {
|
|
331
|
+
<T>(x: T): T;
|
|
332
|
+
(): undefined;
|
|
333
|
+
};
|
|
329
334
|
export declare const cond: {
|
|
330
335
|
(a: symbol, b: any): (a: [
|
|
331
336
|
Cond,
|
package/package.json
CHANGED
|
@@ -41,19 +41,19 @@
|
|
|
41
41
|
"prod": "npm run gentypes && npm run prod:es && npm run prod:cjs",
|
|
42
42
|
"all": "npm run dev && npm run prod"
|
|
43
43
|
},
|
|
44
|
-
"version": "1.6.
|
|
44
|
+
"version": "1.6.12",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@rollup/plugin-commonjs": "^
|
|
47
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
48
|
-
"@rollup/plugin-replace": "^6.0.
|
|
49
|
-
"@types/node": "^
|
|
50
|
-
"cross-env": "^10.
|
|
46
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
47
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
48
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
49
|
+
"@types/node": "^25.0.3",
|
|
50
|
+
"cross-env": "^10.1.0",
|
|
51
51
|
"dts-bundle-generator": "^9.5.1",
|
|
52
|
-
"rollup": "^4.
|
|
52
|
+
"rollup": "^4.54.0",
|
|
53
53
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
54
54
|
"ts-node": "^10.9.2",
|
|
55
55
|
"tslint": "^6.1.3",
|
|
56
|
-
"typescript": "^5.
|
|
56
|
+
"typescript": "^5.9.3"
|
|
57
57
|
},
|
|
58
58
|
"sideEffects": false
|
|
59
59
|
}
|
package/src/curry.ts
CHANGED
|
@@ -76,9 +76,9 @@ export function curry2<Func extends Func2>(fn: Func) {
|
|
|
76
76
|
throw new Error('Senseless placeholder usage.')
|
|
77
77
|
return aln>1
|
|
78
78
|
? withPlaceholder1
|
|
79
|
-
? endlessph((a: p0) => fn(a, b))
|
|
79
|
+
? endlessph((a: p0) => fn(a, b) as ReturnType<Func>)
|
|
80
80
|
: fn(a, b) as ReturnType<Func>
|
|
81
|
-
: (b: p1) => fn(a, b)
|
|
81
|
+
: (b: p1) => fn(a, b) as ReturnType<Func>
|
|
82
82
|
}
|
|
83
83
|
return curried2
|
|
84
84
|
}
|
package/src/safe.ts
CHANGED
|
@@ -128,7 +128,14 @@ export const keys: KeysOverload = (o: any) => Object.keys(o)
|
|
|
128
128
|
export const values = (o: AnyObject | any[]) => Object.values(o)
|
|
129
129
|
export const toPairs = (o: AnyObject | any[]) => Object.entries(o)
|
|
130
130
|
export const test = curry2((re: RegExp, s: string) => re.test(s))
|
|
131
|
-
|
|
131
|
+
type T_tap = {
|
|
132
|
+
<T>(fn: (x: T) => any, x: T): T
|
|
133
|
+
(fn: AnyFunc): {
|
|
134
|
+
<T>(x: T): T
|
|
135
|
+
(): undefined
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export const tap = curry2(<T>(fn: AnyFunc, x: T): T => { fn(x); return x }) as any as T_tap
|
|
132
139
|
export const append = curry2((x: any, xs: any[]) => [...xs, x])
|
|
133
140
|
export const prepend = curry2((x: any, xs: any[]) => [...xs, x])
|
|
134
141
|
export const flat = (xs: any[]) => xs.flat(inf)
|