@zimic/interceptor 1.0.0-rc.4 → 1.0.0-rc.6

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/dist/server.js CHANGED
@@ -1,29 +1,29 @@
1
1
  'use strict';
2
2
 
3
- var chunkP23SDDCC_js = require('./chunk-P23SDDCC.js');
3
+ var chunkLWUFSWRA_js = require('./chunk-LWUFSWRA.js');
4
4
  require('./chunk-WCQVDF3K.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "DEFAULT_ACCESS_CONTROL_HEADERS", {
9
9
  enumerable: true,
10
- get: function () { return chunkP23SDDCC_js.DEFAULT_ACCESS_CONTROL_HEADERS; }
10
+ get: function () { return chunkLWUFSWRA_js.DEFAULT_ACCESS_CONTROL_HEADERS; }
11
11
  });
12
12
  Object.defineProperty(exports, "DEFAULT_PREFLIGHT_STATUS_CODE", {
13
13
  enumerable: true,
14
- get: function () { return chunkP23SDDCC_js.DEFAULT_PREFLIGHT_STATUS_CODE; }
14
+ get: function () { return chunkLWUFSWRA_js.DEFAULT_PREFLIGHT_STATUS_CODE; }
15
15
  });
16
16
  Object.defineProperty(exports, "NotRunningInterceptorServerError", {
17
17
  enumerable: true,
18
- get: function () { return chunkP23SDDCC_js.NotRunningInterceptorServerError_default; }
18
+ get: function () { return chunkLWUFSWRA_js.NotRunningInterceptorServerError_default; }
19
19
  });
20
20
  Object.defineProperty(exports, "RunningInterceptorServerError", {
21
21
  enumerable: true,
22
- get: function () { return chunkP23SDDCC_js.RunningInterceptorServerError_default; }
22
+ get: function () { return chunkLWUFSWRA_js.RunningInterceptorServerError_default; }
23
23
  });
24
24
  Object.defineProperty(exports, "createInterceptorServer", {
25
25
  enumerable: true,
26
- get: function () { return chunkP23SDDCC_js.createInterceptorServer; }
26
+ get: function () { return chunkLWUFSWRA_js.createInterceptorServer; }
27
27
  });
28
28
  //# sourceMappingURL=server.js.map
29
29
  //# sourceMappingURL=server.js.map
package/dist/server.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { DEFAULT_ACCESS_CONTROL_HEADERS, DEFAULT_PREFLIGHT_STATUS_CODE, NotRunningInterceptorServerError_default as NotRunningInterceptorServerError, RunningInterceptorServerError_default as RunningInterceptorServerError, createInterceptorServer } from './chunk-CZIDAF2X.mjs';
1
+ export { DEFAULT_ACCESS_CONTROL_HEADERS, DEFAULT_PREFLIGHT_STATUS_CODE, NotRunningInterceptorServerError_default as NotRunningInterceptorServerError, RunningInterceptorServerError_default as RunningInterceptorServerError, createInterceptorServer } from './chunk-7DRPXOOJ.mjs';
2
2
  import './chunk-CGILA3WO.mjs';
3
3
  //# sourceMappingURL=server.mjs.map
4
4
  //# sourceMappingURL=server.mjs.map
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "api",
15
15
  "static"
16
16
  ],
17
- "version": "1.0.0-rc.4",
17
+ "version": "1.0.0-rc.6",
18
18
  "repository": {
19
19
  "type": "git",
20
20
  "url": "https://github.com/zimicjs/zimic.git",
@@ -79,14 +79,14 @@
79
79
  "./package.json": "./package.json"
80
80
  },
81
81
  "dependencies": {
82
- "@whatwg-node/server": "0.10.10",
82
+ "@whatwg-node/server": "0.10.12",
83
83
  "execa": "9.6.0",
84
84
  "isomorphic-ws": "5.0.0",
85
85
  "msw": "2.10.4",
86
86
  "picocolors": "^1.1.1",
87
87
  "ws": "8.18.3",
88
88
  "yargs": "18.0.0",
89
- "zod": "^4.0.10"
89
+ "zod": "^4.0.14"
90
90
  },
91
91
  "optionalDependencies": {
92
92
  "bufferutil": "4.0.9"
@@ -97,20 +97,20 @@
97
97
  "@types/yargs": "^17.0.33",
98
98
  "@vitest/browser": "^3.2.4",
99
99
  "@vitest/coverage-istanbul": "^3.2.4",
100
- "dotenv-cli": "^9.0.0",
100
+ "dotenv-cli": "^10.0.0",
101
101
  "eslint": "^9.32.0",
102
- "playwright": "^1.54.1",
102
+ "playwright": "^1.54.2",
103
103
  "tsup": "^8.4.0",
104
- "typescript": "^5.8.3",
104
+ "typescript": "^5.9.2",
105
105
  "vitest": "^3.2.4",
106
106
  "@zimic/eslint-config-node": "0.0.0",
107
- "@zimic/lint-staged-config": "0.0.0",
108
107
  "@zimic/tsconfig": "0.0.0",
109
- "@zimic/utils": "0.0.0"
108
+ "@zimic/utils": "0.0.0",
109
+ "@zimic/lint-staged-config": "0.0.0"
110
110
  },
111
111
  "peerDependencies": {
112
112
  "typescript": ">=5.0.0",
113
- "@zimic/http": "^0.7.0 || ^1.0.0-rc || 1.0.0-rc.3"
113
+ "@zimic/http": "^0.7.0 || ^1.0.0-rc || 1.0.0-rc.5"
114
114
  },
115
115
  "peerDependenciesMeta": {
116
116
  "typescript": {
@@ -350,7 +350,10 @@ class HttpRequestHandlerClient<
350
350
  if (restrictionBody instanceof ArrayBuffer) {
351
351
  restrictionBodyAsBlob = convertArrayBufferToBlob(restrictionBody, { type: body.type });
352
352
  } else if (restrictionBody instanceof ReadableStream) {
353
- restrictionBodyAsBlob = await convertReadableStreamToBlob(restrictionBody, { type: body.type });
353
+ restrictionBodyAsBlob = await convertReadableStreamToBlob(
354
+ restrictionBody as ReadableStream<Uint8Array<ArrayBuffer>>,
355
+ { type: body.type },
356
+ );
354
357
  } else {
355
358
  restrictionBodyAsBlob = restrictionBody;
356
359
  }
package/src/utils/data.ts CHANGED
@@ -1,17 +1,20 @@
1
1
  import { isClientSide } from './environment';
2
2
 
3
- export async function convertReadableStreamToBlob(stream: ReadableStream, options?: BlobPropertyBag): Promise<Blob> {
4
- const chunks: Uint8Array[] = [];
5
- const reader = stream.getReader() as ReadableStreamDefaultReader<Uint8Array>;
3
+ export async function convertReadableStreamToBlob(
4
+ stream: ReadableStream<Uint8Array<ArrayBuffer>>,
5
+ options?: BlobPropertyBag,
6
+ ): Promise<Blob> {
7
+ const chunks: Uint8Array<ArrayBuffer>[] = [];
8
+ const reader = stream.getReader();
6
9
 
7
10
  while (true) {
8
- const readResult = await reader.read();
11
+ const result = await reader.read();
9
12
 
10
- if (readResult.value) {
11
- chunks.push(readResult.value);
13
+ if (result.value) {
14
+ chunks.push(result.value);
12
15
  }
13
16
 
14
- if (readResult.done) {
17
+ if (result.done) {
15
18
  break;
16
19
  }
17
20
  }