msw 2.4.11 → 2.4.13
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
CHANGED
|
@@ -398,7 +398,7 @@ You can also automate this process and make the worker script update automatical
|
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
401
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-6HYIRFX2.mjs
|
|
402
402
|
var encoder = new TextEncoder();
|
|
403
403
|
function encodeBuffer(text) {
|
|
404
404
|
return encoder.encode(text);
|
|
@@ -414,7 +414,7 @@ function toArrayBuffer(array) {
|
|
|
414
414
|
);
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
417
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-XVPRNJO7.mjs
|
|
418
418
|
var IS_PATCHED_MODULE = Symbol("isPatchedModule");
|
|
419
419
|
function isPropertyAccessible(obj, key) {
|
|
420
420
|
try {
|
|
@@ -900,7 +900,7 @@ var _Emitter = class {
|
|
|
900
900
|
var Emitter = _Emitter;
|
|
901
901
|
Emitter.defaultMaxListeners = 10;
|
|
902
902
|
|
|
903
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
903
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-QED3Q6Z2.mjs
|
|
904
904
|
var INTERNAL_REQUEST_ID_HEADER_NAME = "x-interceptors-internal-request-id";
|
|
905
905
|
function getGlobalSymbol(symbol) {
|
|
906
906
|
return (
|
|
@@ -1048,7 +1048,7 @@ function createRequestId() {
|
|
|
1048
1048
|
return Math.random().toString(16).slice(2);
|
|
1049
1049
|
}
|
|
1050
1050
|
|
|
1051
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1051
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/index.mjs
|
|
1052
1052
|
var BatchInterceptor = class extends Interceptor {
|
|
1053
1053
|
constructor(options) {
|
|
1054
1054
|
BatchInterceptor.symbol = Symbol(options.name);
|
|
@@ -1332,7 +1332,7 @@ var DeferredPromise = class extends Promise {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
};
|
|
1334
1334
|
|
|
1335
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1335
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-THPGBWJQ.mjs
|
|
1336
1336
|
var InterceptorError = class extends Error {
|
|
1337
1337
|
constructor(message) {
|
|
1338
1338
|
super(message);
|
|
@@ -1500,7 +1500,7 @@ async function handleRequest2(options) {
|
|
|
1500
1500
|
return false;
|
|
1501
1501
|
}
|
|
1502
1502
|
|
|
1503
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1503
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-GHRPKS6J.mjs
|
|
1504
1504
|
function canParseUrl(url) {
|
|
1505
1505
|
try {
|
|
1506
1506
|
new URL(url);
|
|
@@ -1662,12 +1662,12 @@ var _FetchInterceptor = class extends Interceptor {
|
|
|
1662
1662
|
this.logger.info(
|
|
1663
1663
|
"no mocked response received, performing request as-is..."
|
|
1664
1664
|
);
|
|
1665
|
-
return pureFetch(request).then((response) => {
|
|
1665
|
+
return pureFetch(request).then(async (response) => {
|
|
1666
1666
|
this.logger.info("original fetch performed", response);
|
|
1667
1667
|
if (this.emitter.listenerCount("response") > 0) {
|
|
1668
1668
|
this.logger.info('emitting the "response" event...');
|
|
1669
1669
|
const responseClone = response.clone();
|
|
1670
|
-
this.emitter
|
|
1670
|
+
await emitAsync(this.emitter, "response", {
|
|
1671
1671
|
response: responseClone,
|
|
1672
1672
|
isMockedResponse: false,
|
|
1673
1673
|
request,
|
|
@@ -1697,7 +1697,7 @@ var _FetchInterceptor = class extends Interceptor {
|
|
|
1697
1697
|
var FetchInterceptor = _FetchInterceptor;
|
|
1698
1698
|
FetchInterceptor.symbol = Symbol("fetch");
|
|
1699
1699
|
|
|
1700
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1700
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-SUQ32ZQK.mjs
|
|
1701
1701
|
function concatArrayBuffer(left, right) {
|
|
1702
1702
|
const result = new Uint8Array(left.byteLength + right.byteLength);
|
|
1703
1703
|
result.set(left, 0);
|