klubok 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ function klubok(...fns) {
22
22
  return await Promise.resolve(fn(ctx)).then(resp => ({ ...ctx, [fn.key]: resp }));
23
23
  }
24
24
  catch (error) {
25
- await onError?.(error);
25
+ await onError?.({ ...ctx, $error: error });
26
26
  if (error instanceof Error) {
27
27
  error.stack += '\ncontext: ' + (0, node_util_1.inspect)(ctx);
28
28
  }
@@ -41,7 +41,7 @@ function klubok(...fns) {
41
41
  : fn(ctx)).then(resp => ({ ...ctx, [fn.key]: resp }));
42
42
  }
43
43
  catch (error) {
44
- await onError?.(error);
44
+ await onError?.({ ...ctx, $error: error });
45
45
  if (error instanceof Error) {
46
46
  error.stack += '\ncontext: ' + (0, node_util_1.inspect)(ctx);
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klubok",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Do notation pipes for Promise-based or pure functions which easy to mock",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",