msw 3.0.3 → 3.0.4
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/lib/browser/index.js +1 -1
- package/lib/iife/index.js +2 -2
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +152 -12
- package/lib/utils/is-common-asset-request.js +1 -1
- package/lib/utils/is-common-asset-request.js.map +1 -1
- package/package.json +2 -2
- package/src/mockServiceWorker.js +150 -10
- package/src/utils/is-common-asset-request.test.ts +371 -0
- package/src/utils/is-common-asset-request.ts +1 -1
package/lib/browser/index.js
CHANGED
|
@@ -430,7 +430,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
430
430
|
this.#channel.postMessage("INTEGRITY_CHECK_REQUEST");
|
|
431
431
|
this.#channel.once("INTEGRITY_CHECK_RESPONSE", (event) => {
|
|
432
432
|
const { checksum, packageVersion } = event.data;
|
|
433
|
-
if (checksum !== "
|
|
433
|
+
if (checksum !== "0bd5af64c8dc112df5e0c5e9c8a2b15a") devUtils.warn(`The currently registered Service Worker has been generated by a different version of MSW (${packageVersion}) and may not be fully compatible with the installed version.
|
|
434
434
|
|
|
435
435
|
It's recommended you update your worker script by running this command:
|
|
436
436
|
|
package/lib/iife/index.js
CHANGED
|
@@ -29981,7 +29981,7 @@ accept: "msw/passthrough" },
|
|
|
29981
29981
|
if (/(fonts\.googleapis\.com)/.test(url.hostname)) return true;
|
|
29982
29982
|
if (/node_modules/.test(url.pathname)) return true;
|
|
29983
29983
|
if (url.pathname.includes("@vite")) return true;
|
|
29984
|
-
return /\.(s?css|less|m?jsx?|m?tsx?|html|ttf|otf|woff|woff2|eot|gif|jpe?g|png|avif|webp|svg|mp4|webm|ogg|mov|mp3|wav|ogg|flac|aac|pdf|txt|csv|json|xml|md|zip|tar|gz|rar|7z)$/i.test(url.pathname);
|
|
29984
|
+
return /\.(s?css|less|m?jsx?|m?tsx?|html|ttf|otf|woff|woff2|eot|gif|jpe?g|png|avif|webp|ico|svg|mp4|webm|ogg|mov|mp3|wav|ogg|flac|aac|pdf|txt|csv|json|xml|md|zip|tar|gz|rar|7z)$/i.test(url.pathname);
|
|
29985
29985
|
}
|
|
29986
29986
|
//#endregion
|
|
29987
29987
|
//#region src/core/experimental/sources/network-source.ts
|
|
@@ -31190,7 +31190,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
31190
31190
|
this.#channel.postMessage("INTEGRITY_CHECK_REQUEST");
|
|
31191
31191
|
this.#channel.once("INTEGRITY_CHECK_RESPONSE", (event) => {
|
|
31192
31192
|
const { checksum, packageVersion } = event.data;
|
|
31193
|
-
if (checksum !== "
|
|
31193
|
+
if (checksum !== "0bd5af64c8dc112df5e0c5e9c8a2b15a") devUtils.warn(`The currently registered Service Worker has been generated by a different version of MSW (${packageVersion}) and may not be fully compatible with the installed version.
|
|
31194
31194
|
|
|
31195
31195
|
It's recommended you update your worker script by running this command:
|
|
31196
31196
|
|