@warp-drive-mirror/utilities 5.8.0-alpha.6 → 5.8.0-alpha.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.
@@ -40,7 +40,7 @@ import type { Handler } from "@warp-drive-mirror/core/request";
40
40
  * ```
41
41
  *
42
42
  * Errors are not processed by this handler, so if the request fails and the error response
43
- * is not in {JSON:API} format additional processing may be needed.
43
+ * is not in {json:api} format additional processing may be needed.
44
44
  *
45
45
  * @group Handlers
46
46
  */
package/dist/handlers.js CHANGED
@@ -35,7 +35,7 @@ const DEFAULT_CONSTRAINTS = {
35
35
  DataView: 1000,
36
36
  String: 1000
37
37
  };
38
- const TypedArray = Object.getPrototypeOf(Uint8Array.prototype);
38
+ const TypedArray = Object.getPrototypeOf(Uint8Array);
39
39
 
40
40
  /**
41
41
  * A request handler that automatically compresses the request body
@@ -84,7 +84,7 @@ class AutoCompress {
84
84
  const {
85
85
  body
86
86
  } = request;
87
- const shouldCompress = isCompressibleMethod(request.method) && request.options?.compress !== false && (
87
+ const shouldCompress = !!body && isCompressibleMethod(request.method) && request.options?.compress !== false && (
88
88
  // prettier-ignore
89
89
  request.options?.compress ? true : typeof body === 'string' || body instanceof String ? canCompress('String', constraints, body.length) : body instanceof Blob ? canCompress('Blob', constraints, body.size) : body instanceof ArrayBuffer ? canCompress('ArrayBuffer', constraints, body.byteLength) : body instanceof DataView ? canCompress('DataView', constraints, body.byteLength) : body instanceof TypedArray ? canCompress('TypedArray', constraints, body.byteLength) : false);
90
90
  if (!shouldCompress) return next(request);
@@ -218,7 +218,7 @@ class Gate {
218
218
  * ```
219
219
  *
220
220
  * Errors are not processed by this handler, so if the request fails and the error response
221
- * is not in {JSON:API} format additional processing may be needed.
221
+ * is not in {json:api} format additional processing may be needed.
222
222
  *
223
223
  * @group Handlers
224
224
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive-mirror/utilities",
3
- "version": "5.8.0-alpha.6",
3
+ "version": "5.8.0-alpha.7",
4
4
  "description": "Utilities package for WarpDrive | Things your app might find useful",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -36,7 +36,7 @@
36
36
  }
37
37
  },
38
38
  "peerDependencies": {
39
- "@warp-drive-mirror/core": "5.8.0-alpha.6"
39
+ "@warp-drive-mirror/core": "5.8.0-alpha.7"
40
40
  },
41
41
  "dependencies": {
42
42
  "@embroider/macros": "^1.18.1"
@@ -45,8 +45,8 @@
45
45
  "@babel/core": "^7.28.3",
46
46
  "@babel/plugin-transform-typescript": "^7.28.0",
47
47
  "@babel/preset-typescript": "^7.27.1",
48
- "@warp-drive/internal-config": "5.8.0-alpha.6",
49
- "@warp-drive-mirror/core": "5.8.0-alpha.6",
48
+ "@warp-drive/internal-config": "5.8.0-alpha.7",
49
+ "@warp-drive-mirror/core": "5.8.0-alpha.7",
50
50
  "decorator-transforms": "^2.3.0",
51
51
  "expect-type": "^1.2.2",
52
52
  "typescript": "^5.9.2",