pepka 1.6.11 → 1.6.13

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.cjs CHANGED
@@ -140,7 +140,7 @@ const qstartsWithWith = (comparator) => curry2((start, s) => {
140
140
  });
141
141
 
142
142
  /* Then next fns seem to be excess due to their safe ver performance should be the same or better:
143
- * qflat, qpick
143
+ * qflat, qpick, qslice, quniq
144
144
  */
145
145
  const qappend = curry2((s, xs) => { xs.push(s); return xs; });
146
146
  const qassoc = curry3((prop, v, obj) => { obj[prop] = v; return obj; });
package/dist/bundle.d.ts CHANGED
@@ -244,7 +244,10 @@ export declare const test: {
244
244
  };
245
245
  type T_tap = {
246
246
  <T>(fn: (x: T) => any, x: T): T;
247
- (fn: AnyFunc): <T>(x: T) => T;
247
+ (fn: AnyFunc): {
248
+ <T>(x: T): T;
249
+ (): undefined;
250
+ };
248
251
  };
249
252
  export declare const tap: T_tap;
250
253
  export declare const append: {
@@ -322,9 +325,12 @@ export declare const genBy: {
322
325
  (a: (i: number) => any): (b: number) => any[];
323
326
  (a: (i: number) => any, b: number): any[];
324
327
  };
325
- export declare const once: <Func extends AnyFunc>(fn: Func) => (...args: Parameters<Func>) => any;
328
+ export declare const once: <Func extends AnyFunc>(fn: Func) => (...args: Parameters<Func>) => ReturnType<Func>;
326
329
  export declare const reverse: <T extends any>(xs: T[]) => T[];
327
- export declare const explore: (caption: string, level?: string) => <T>(x: T) => T;
330
+ export declare const explore: (caption: string, level?: string) => {
331
+ <T>(x: T): T;
332
+ (): undefined;
333
+ };
328
334
  export declare const cond: {
329
335
  (a: symbol, b: any): (a: [
330
336
  Cond,
package/dist/bundle.mjs CHANGED
@@ -138,7 +138,7 @@ const qstartsWithWith = (comparator) => curry2((start, s) => {
138
138
  });
139
139
 
140
140
  /* Then next fns seem to be excess due to their safe ver performance should be the same or better:
141
- * qflat, qpick
141
+ * qflat, qpick, qslice, quniq
142
142
  */
143
143
  const qappend = curry2((s, xs) => { xs.push(s); return xs; });
144
144
  const qassoc = curry3((prop, v, obj) => { obj[prop] = v; return obj; });
package/package.json CHANGED
@@ -41,7 +41,7 @@
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.11",
44
+ "version": "1.6.13",
45
45
  "devDependencies": {
46
46
  "@rollup/plugin-commonjs": "^29.0.0",
47
47
  "@rollup/plugin-node-resolve": "^16.0.3",
package/src/quick.ts CHANGED
@@ -3,7 +3,7 @@ import { includes, type, eq, qstartsWithWith } from "./common"
3
3
  import { AnyObject, Reducer, AnyFunc } from "./types"
4
4
  import { isFunc, isArray, isObj, isNil } from "./utils"
5
5
  /* Then next fns seem to be excess due to their safe ver performance should be the same or better:
6
- * qflat, qpick
6
+ * qflat, qpick, qslice, quniq
7
7
  */
8
8
 
9
9
  export const qappend = curry2((s: any, xs: any[]) => {xs.push(s); return xs})
package/src/safe.ts CHANGED
@@ -130,9 +130,12 @@ 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
132
  <T>(fn: (x: T) => any, x: T): T
133
- (fn: AnyFunc): <T>(x: T) => T
133
+ (fn: AnyFunc): {
134
+ <T>(x: T): T
135
+ (): undefined
136
+ }
134
137
  }
135
- export const tap = curry2(<T>(fn: AnyFunc, x: T): T => { fn(x); return x }) as T_tap
138
+ export const tap = curry2(<T>(fn: AnyFunc, x: T): T => { fn(x); return x }) as any as T_tap
136
139
  export const append = curry2((x: any, xs: any[]) => [...xs, x])
137
140
  export const prepend = curry2((x: any, xs: any[]) => [...xs, x])
138
141
  export const flat = (xs: any[]) => xs.flat(inf)
@@ -197,11 +200,11 @@ export const genBy = curry2(
197
200
  ) => [...Array(length)].map((_, i) => generator(i))
198
201
  )
199
202
  export const once = <Func extends AnyFunc>(fn: Func) => {
200
- let done = false, cache: any
203
+ let done = false, cache: ReturnType<Func>
201
204
  return function(...args: Parameters<Func>) {
202
205
  if(done) return cache
203
206
  done = true
204
- return cache = fn(...args)
207
+ return cache = fn(...args) as ReturnType<Func>
205
208
  }
206
209
  }
207
210
  export const reverse = <T extends any>(xs: T[]): T[] => {