utilium 2.5.6 → 2.5.7

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.
@@ -82,7 +82,7 @@ interface SetOptions extends Options {
82
82
  * Make a POST request to set (or create) data on the server and update the cache.
83
83
  * @throws RequestError
84
84
  */
85
- export declare function set(url: string, data: Uint8Array<ArrayBuffer>, options: SetOptions, init?: RequestInit): Promise<void>;
85
+ export declare function set(url: string, data: Uint8Array, options: SetOptions, init?: RequestInit): Promise<void>;
86
86
  /**
87
87
  * Make a DELETE request to remove the resource from the server and clear it from the cache.
88
88
  * @throws RequestError
package/dist/requests.js CHANGED
@@ -138,7 +138,7 @@ export async function set(url, data, options, init = {}) {
138
138
  ...init,
139
139
  method,
140
140
  headers,
141
- body: data,
141
+ body: data.buffer instanceof ArrayBuffer ? data : Uint8Array.from(data),
142
142
  }), {}, true);
143
143
  }
144
144
  resource.add(data, offset);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "2.5.6",
3
+ "version": "2.5.7",
4
4
  "description": "Typescript utilities",
5
5
  "funding": {
6
6
  "type": "individual",