@fuman/fetch 0.0.8 → 0.0.10

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/ffetch.cjs CHANGED
@@ -108,6 +108,9 @@ ${stack}`;
108
108
  const res = await this.raw();
109
109
  return res.arrayBuffer();
110
110
  }
111
+ async bytes() {
112
+ return new Uint8Array(await this.arrayBuffer());
113
+ }
111
114
  async blob() {
112
115
  this._headers ??= {};
113
116
  this._headers.Accept ??= OCTET_STREAM_CONTENT_TYPE;
package/ffetch.d.cts CHANGED
@@ -96,7 +96,7 @@ export interface Ffetch<RequestMixin, ResponseMixin> {
96
96
  extend: <const Addons extends FfetchAddon<any, any>[], Combined extends {
97
97
  request: object;
98
98
  response: object;
99
- } = CombineAddons<Addons>>(baseOptions: FfetchBaseOptions<Addons> & Combined['request']) => Ffetch<RequestMixin & Combined['request'], ResponseMixin & Combined['response']>;
99
+ } = CombineAddons<Addons>>(baseOptions: FfetchBaseOptions<Addons> & RequestMixin & Combined['request']) => Ffetch<RequestMixin & Combined['request'], ResponseMixin & Combined['response']>;
100
100
  }
101
101
  /**
102
102
  * an error that is thrown when the response status is not 2xx,
package/ffetch.d.ts CHANGED
@@ -96,7 +96,7 @@ export interface Ffetch<RequestMixin, ResponseMixin> {
96
96
  extend: <const Addons extends FfetchAddon<any, any>[], Combined extends {
97
97
  request: object;
98
98
  response: object;
99
- } = CombineAddons<Addons>>(baseOptions: FfetchBaseOptions<Addons> & Combined['request']) => Ffetch<RequestMixin & Combined['request'], ResponseMixin & Combined['response']>;
99
+ } = CombineAddons<Addons>>(baseOptions: FfetchBaseOptions<Addons> & RequestMixin & Combined['request']) => Ffetch<RequestMixin & Combined['request'], ResponseMixin & Combined['response']>;
100
100
  }
101
101
  /**
102
102
  * an error that is thrown when the response status is not 2xx,
package/ffetch.js CHANGED
@@ -106,6 +106,9 @@ ${stack}`;
106
106
  const res = await this.raw();
107
107
  return res.arrayBuffer();
108
108
  }
109
+ async bytes() {
110
+ return new Uint8Array(await this.arrayBuffer());
111
+ }
109
112
  async blob() {
110
113
  this._headers ??= {};
111
114
  this._headers.Accept ??= OCTET_STREAM_CONTENT_TYPE;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@fuman/fetch",
3
3
  "type": "module",
4
- "version": "0.0.8",
4
+ "version": "0.0.10",
5
5
  "description": "tiny wrapper over fetch",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
- "@fuman/utils": "^0.0.4"
8
+ "@fuman/utils": "^0.0.10"
9
9
  },
10
10
  "peerDependencies": {
11
11
  "@badrap/valita": ">=0.4.0",