@zimic/interceptor 0.17.1-canary.0 → 0.17.1-canary.2
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/cli.js +3 -4
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +3 -4
- package/dist/cli.mjs.map +1 -1
- package/dist/http.js +44 -11
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +44 -11
- package/dist/http.mjs.map +1 -1
- package/package.json +7 -7
- package/src/cli/browser/init.ts +2 -3
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +1 -4
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"api",
|
|
15
15
|
"static"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.17.1-canary.
|
|
17
|
+
"version": "0.17.1-canary.2",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/zimicjs/zimic.git",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@whatwg-node/server": "0.10.3",
|
|
79
79
|
"execa": "9.5.2",
|
|
80
80
|
"isomorphic-ws": "5.0.0",
|
|
81
|
-
"msw": "2.7.
|
|
81
|
+
"msw": "2.7.4",
|
|
82
82
|
"picocolors": "^1.1.1",
|
|
83
83
|
"ws": "8.18.1",
|
|
84
84
|
"yargs": "17.7.2",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"bufferutil": "4.0.9"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@types/node": "^22.14.
|
|
91
|
+
"@types/node": "^22.14.1",
|
|
92
92
|
"@types/ws": "^8.18.1",
|
|
93
93
|
"@types/yargs": "^17.0.33",
|
|
94
94
|
"@vitest/browser": "^3.1.1",
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
"typescript": "^5.8.3",
|
|
101
101
|
"vitest": "^3.1.1",
|
|
102
102
|
"@zimic/eslint-config-node": "0.0.0",
|
|
103
|
-
"@zimic/tsconfig": "0.0.0",
|
|
104
103
|
"@zimic/lint-staged-config": "0.0.0",
|
|
105
|
-
"@zimic/utils": "0.0.0"
|
|
104
|
+
"@zimic/utils": "0.0.0",
|
|
105
|
+
"@zimic/tsconfig": "0.0.0"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
|
-
"
|
|
109
|
-
"
|
|
108
|
+
"typescript": ">=4.8.0",
|
|
109
|
+
"@zimic/http": "^0.3.0 || 0.3.1-canary.2"
|
|
110
110
|
},
|
|
111
111
|
"peerDependenciesMeta": {
|
|
112
112
|
"typescript": {
|
package/src/cli/browser/init.ts
CHANGED
|
@@ -14,10 +14,9 @@ interface BrowserServiceWorkerInitOptions {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async function initializeBrowserServiceWorker({ publicDirectory }: BrowserServiceWorkerInitOptions) {
|
|
17
|
-
|
|
18
|
-
await fs.promises.mkdir(absolutePublicDirectory, { recursive: true });
|
|
17
|
+
await fs.promises.mkdir(publicDirectory, { recursive: true });
|
|
19
18
|
|
|
20
|
-
const destinationPath = path.join(
|
|
19
|
+
const destinationPath = path.join(publicDirectory, SERVICE_WORKER_FILE_NAME);
|
|
21
20
|
await fs.promises.copyFile(MOCK_SERVICE_WORKER_PATH, destinationPath);
|
|
22
21
|
|
|
23
22
|
logger.info(`Service worker script saved to ${color.magenta(destinationPath)}.`);
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
HttpRequestSearchParamsSchema,
|
|
10
10
|
HttpRequestHeadersSchema,
|
|
11
11
|
} from '@zimic/http';
|
|
12
|
-
import blobContains from '@zimic/utils/data/blobContains';
|
|
13
12
|
import blobEquals from '@zimic/utils/data/blobEquals';
|
|
14
13
|
import jsonContains from '@zimic/utils/data/jsonContains';
|
|
15
14
|
import jsonEquals from '@zimic/utils/data/jsonEquals';
|
|
@@ -338,9 +337,7 @@ class HttpRequestHandlerClient<
|
|
|
338
337
|
};
|
|
339
338
|
}
|
|
340
339
|
|
|
341
|
-
const matchesRestriction =
|
|
342
|
-
? await blobEquals(body, restrictionBody)
|
|
343
|
-
: await blobContains(body, restrictionBody);
|
|
340
|
+
const matchesRestriction = await blobEquals(body, restrictionBody);
|
|
344
341
|
|
|
345
342
|
return matchesRestriction
|
|
346
343
|
? { value: true }
|