msw 2.4.11 → 2.4.12
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.mjs
CHANGED
|
@@ -371,7 +371,7 @@ You can also automate this process and make the worker script update automatical
|
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
374
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-6HYIRFX2.mjs
|
|
375
375
|
var encoder = new TextEncoder();
|
|
376
376
|
function encodeBuffer(text) {
|
|
377
377
|
return encoder.encode(text);
|
|
@@ -387,7 +387,7 @@ function toArrayBuffer(array) {
|
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
390
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-XVPRNJO7.mjs
|
|
391
391
|
var IS_PATCHED_MODULE = Symbol("isPatchedModule");
|
|
392
392
|
function isPropertyAccessible(obj, key) {
|
|
393
393
|
try {
|
|
@@ -873,7 +873,7 @@ var _Emitter = class {
|
|
|
873
873
|
var Emitter = _Emitter;
|
|
874
874
|
Emitter.defaultMaxListeners = 10;
|
|
875
875
|
|
|
876
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
876
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-QED3Q6Z2.mjs
|
|
877
877
|
var INTERNAL_REQUEST_ID_HEADER_NAME = "x-interceptors-internal-request-id";
|
|
878
878
|
function getGlobalSymbol(symbol) {
|
|
879
879
|
return (
|
|
@@ -1021,7 +1021,7 @@ function createRequestId() {
|
|
|
1021
1021
|
return Math.random().toString(16).slice(2);
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1024
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/index.mjs
|
|
1025
1025
|
var BatchInterceptor = class extends Interceptor {
|
|
1026
1026
|
constructor(options) {
|
|
1027
1027
|
BatchInterceptor.symbol = Symbol(options.name);
|
|
@@ -1305,7 +1305,7 @@ var DeferredPromise = class extends Promise {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
};
|
|
1307
1307
|
|
|
1308
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1308
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-THPGBWJQ.mjs
|
|
1309
1309
|
var InterceptorError = class extends Error {
|
|
1310
1310
|
constructor(message) {
|
|
1311
1311
|
super(message);
|
|
@@ -1473,7 +1473,7 @@ async function handleRequest2(options) {
|
|
|
1473
1473
|
return false;
|
|
1474
1474
|
}
|
|
1475
1475
|
|
|
1476
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1476
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-GHRPKS6J.mjs
|
|
1477
1477
|
function canParseUrl(url) {
|
|
1478
1478
|
try {
|
|
1479
1479
|
new URL(url);
|
|
@@ -1635,12 +1635,12 @@ var _FetchInterceptor = class extends Interceptor {
|
|
|
1635
1635
|
this.logger.info(
|
|
1636
1636
|
"no mocked response received, performing request as-is..."
|
|
1637
1637
|
);
|
|
1638
|
-
return pureFetch(request).then((response) => {
|
|
1638
|
+
return pureFetch(request).then(async (response) => {
|
|
1639
1639
|
this.logger.info("original fetch performed", response);
|
|
1640
1640
|
if (this.emitter.listenerCount("response") > 0) {
|
|
1641
1641
|
this.logger.info('emitting the "response" event...');
|
|
1642
1642
|
const responseClone = response.clone();
|
|
1643
|
-
this.emitter
|
|
1643
|
+
await emitAsync(this.emitter, "response", {
|
|
1644
1644
|
response: responseClone,
|
|
1645
1645
|
isMockedResponse: false,
|
|
1646
1646
|
request,
|
|
@@ -1670,7 +1670,7 @@ var _FetchInterceptor = class extends Interceptor {
|
|
|
1670
1670
|
var FetchInterceptor = _FetchInterceptor;
|
|
1671
1671
|
FetchInterceptor.symbol = Symbol("fetch");
|
|
1672
1672
|
|
|
1673
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1673
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.36.5/node_modules/@mswjs/interceptors/lib/browser/chunk-SUQ32ZQK.mjs
|
|
1674
1674
|
function concatArrayBuffer(left, right) {
|
|
1675
1675
|
const result = new Uint8Array(left.byteLength + right.byteLength);
|
|
1676
1676
|
result.set(left, 0);
|