pepka 1.6.10 → 1.6.11

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 CHANGED
@@ -242,12 +242,11 @@ export declare const test: {
242
242
  (a: RegExp): (b: string) => boolean;
243
243
  (a: RegExp, b: string): boolean;
244
244
  };
245
- export declare const tap: {
246
- (a: symbol, b: any): (a: Function) => any;
247
- (a: Function, b: symbol): (b: any) => any;
248
- (a: Function): (b: any) => any;
249
- (a: Function, b: any): any;
245
+ type T_tap = {
246
+ <T>(fn: (x: T) => any, x: T): T;
247
+ (fn: AnyFunc): <T>(x: T) => T;
250
248
  };
249
+ export declare const tap: T_tap;
251
250
  export declare const append: {
252
251
  (a: symbol, b: any[]): (a: any) => any[];
253
252
  (a: any, b: symbol): (b: any[]) => any[];
@@ -325,7 +324,7 @@ export declare const genBy: {
325
324
  };
326
325
  export declare const once: <Func extends AnyFunc>(fn: Func) => (...args: Parameters<Func>) => any;
327
326
  export declare const reverse: <T extends any>(xs: T[]) => T[];
328
- export declare const explore: (caption: string, level?: string) => (b: any) => any;
327
+ export declare const explore: (caption: string, level?: string) => <T>(x: T) => T;
329
328
  export declare const cond: {
330
329
  (a: symbol, b: any): (a: [
331
330
  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.10",
44
+ "version": "1.6.11",
45
45
  "devDependencies": {
46
- "@rollup/plugin-commonjs": "^28.0.6",
47
- "@rollup/plugin-node-resolve": "^16.0.1",
48
- "@rollup/plugin-replace": "^6.0.2",
49
- "@types/node": "^24.1.0",
50
- "cross-env": "^10.0.0",
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.46.0",
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.8.3"
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,11 @@ 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
- export const tap = curry2((fn: Function, x: any) => { fn(x); return x })
131
+ type T_tap = {
132
+ <T>(fn: (x: T) => any, x: T): T
133
+ (fn: AnyFunc): <T>(x: T) => T
134
+ }
135
+ export const tap = curry2(<T>(fn: AnyFunc, x: T): T => { fn(x); return x }) as T_tap
132
136
  export const append = curry2((x: any, xs: any[]) => [...xs, x])
133
137
  export const prepend = curry2((x: any, xs: any[]) => [...xs, x])
134
138
  export const flat = (xs: any[]) => xs.flat(inf)