@fuman/fetch 0.0.7 → 0.0.8

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/addons/query.cjs CHANGED
@@ -13,7 +13,7 @@ function query(options = {}) {
13
13
  const obj = ctx.baseOptions.query && ctx.options.query ? {
14
14
  ...ctx.baseOptions.query,
15
15
  ...ctx.options.query
16
- } : ctx.options.query;
16
+ } : ctx.options.query ?? ctx.baseOptions.query;
17
17
  ctx.url = serialize(obj ?? {}, ctx.url);
18
18
  }
19
19
  }
package/addons/query.js CHANGED
@@ -11,7 +11,7 @@ function query(options = {}) {
11
11
  const obj = ctx.baseOptions.query && ctx.options.query ? {
12
12
  ...ctx.baseOptions.query,
13
13
  ...ctx.options.query
14
- } : ctx.options.query;
14
+ } : ctx.options.query ?? ctx.baseOptions.query;
15
15
  ctx.url = serialize(obj ?? {}, ctx.url);
16
16
  }
17
17
  }
package/ffetch.cjs CHANGED
@@ -81,7 +81,7 @@ class FfetchResultImpl {
81
81
  const stack = this.#stack.split("\n").slice(2).join("\n");
82
82
  err.stack = `${err.name}: ${err.message}
83
83
  ${stack}`;
84
- err.cause = { message: origMessage, stack: origStack };
84
+ err.cause = { message: origMessage, stack: origStack, cause: err.cause };
85
85
  throw err;
86
86
  }
87
87
  }
package/ffetch.js CHANGED
@@ -79,7 +79,7 @@ class FfetchResultImpl {
79
79
  const stack = this.#stack.split("\n").slice(2).join("\n");
80
80
  err.stack = `${err.name}: ${err.message}
81
81
  ${stack}`;
82
- err.cause = { message: origMessage, stack: origStack };
82
+ err.cause = { message: origMessage, stack: origStack, cause: err.cause };
83
83
  throw err;
84
84
  }
85
85
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fuman/fetch",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "description": "tiny wrapper over fetch",
6
6
  "license": "MIT",
7
7
  "dependencies": {