msw 2.12.2 → 2.12.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/core/{HttpResponse-BpT5A_2L.d.ts → HttpResponse-DC89RDb7.d.ts} +1 -1
- package/lib/core/{HttpResponse-DGUjNQHG.d.mts → HttpResponse-U6SfxBlj.d.mts} +1 -1
- package/lib/core/HttpResponse.d.mts +1 -1
- package/lib/core/HttpResponse.d.ts +1 -1
- package/lib/core/SetupApi.d.mts +1 -1
- package/lib/core/SetupApi.d.ts +1 -1
- package/lib/core/getResponse.d.mts +1 -1
- package/lib/core/getResponse.d.ts +1 -1
- package/lib/core/graphql.d.mts +1 -1
- package/lib/core/graphql.d.ts +1 -1
- package/lib/core/handlers/GraphQLHandler.d.mts +1 -1
- package/lib/core/handlers/GraphQLHandler.d.ts +1 -1
- package/lib/core/handlers/HttpHandler.d.mts +2 -2
- package/lib/core/handlers/HttpHandler.d.ts +2 -2
- package/lib/core/handlers/HttpHandler.js.map +1 -1
- package/lib/core/handlers/HttpHandler.mjs.map +1 -1
- package/lib/core/handlers/RequestHandler.d.mts +1 -1
- package/lib/core/handlers/RequestHandler.d.ts +1 -1
- package/lib/core/http.d.mts +1 -1
- package/lib/core/http.d.ts +1 -1
- package/lib/core/index.d.mts +2 -2
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/index.mjs.map +1 -1
- package/lib/core/passthrough.d.mts +1 -1
- package/lib/core/passthrough.d.ts +1 -1
- package/lib/core/sse.d.mts +1 -1
- package/lib/core/sse.d.ts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
- package/lib/core/utils/cookieStore.js +2 -2
- package/lib/core/utils/cookieStore.js.map +1 -1
- package/lib/core/utils/cookieStore.mjs +2 -2
- package/lib/core/utils/cookieStore.mjs.map +1 -1
- package/lib/core/utils/executeHandlers.d.mts +1 -1
- package/lib/core/utils/executeHandlers.d.ts +1 -1
- package/lib/core/utils/handleRequest.d.mts +1 -1
- package/lib/core/utils/handleRequest.d.ts +1 -1
- package/lib/core/utils/internal/isHandlerKind.d.mts +1 -1
- package/lib/core/utils/internal/isHandlerKind.d.ts +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.d.mts +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.d.ts +1 -1
- package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
- package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
- package/lib/core/utils/request/toPublicUrl.js +4 -4
- package/lib/core/utils/request/toPublicUrl.js.map +1 -1
- package/lib/core/utils/request/toPublicUrl.mjs +4 -4
- package/lib/core/utils/request/toPublicUrl.mjs.map +1 -1
- package/lib/core/ws/handleWebSocketEvent.d.mts +1 -1
- package/lib/core/ws/handleWebSocketEvent.d.ts +1 -1
- package/lib/iife/index.js +987 -339
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/lib/node/index.mjs +1 -1
- package/package.json +34 -37
- package/src/core/handlers/HttpHandler.ts +1 -1
- package/src/core/index.ts +5 -0
- package/src/core/utils/cookieStore.ts +8 -2
- package/src/core/utils/request/onUnhandledRequest.node.test.ts +62 -0
- package/src/core/utils/request/toPublicUrl.node.test.ts +17 -0
- package/src/core/utils/request/toPublicUrl.test.ts +1 -3
- package/src/core/utils/request/toPublicUrl.ts +8 -7
|
@@ -22,10 +22,10 @@ __export(toPublicUrl_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(toPublicUrl_exports);
|
|
24
24
|
function toPublicUrl(url) {
|
|
25
|
-
if (typeof location === "undefined") {
|
|
26
|
-
return url.toString();
|
|
27
|
-
}
|
|
28
25
|
const urlInstance = url instanceof URL ? url : new URL(url);
|
|
29
|
-
|
|
26
|
+
if (typeof location !== "undefined" && urlInstance.origin === location.origin) {
|
|
27
|
+
return urlInstance.pathname;
|
|
28
|
+
}
|
|
29
|
+
return urlInstance.origin + urlInstance.pathname;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=toPublicUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/utils/request/toPublicUrl.ts"],"sourcesContent":["/**\n * Returns a relative URL if the given request URL is relative\n * to the current origin. Otherwise returns an absolute URL.\n */\nexport function toPublicUrl(url: string | URL): string {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/utils/request/toPublicUrl.ts"],"sourcesContent":["/**\n * Returns a relative URL if the given request URL is relative\n * to the current origin. Otherwise returns an absolute URL.\n */\nexport function toPublicUrl(url: string | URL): string {\n const urlInstance = url instanceof URL ? url : new URL(url)\n\n if (\n typeof location !== 'undefined' &&\n urlInstance.origin === location.origin\n ) {\n return urlInstance.pathname\n }\n\n return urlInstance.origin + urlInstance.pathname\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,SAAS,YAAY,KAA2B;AACrD,QAAM,cAAc,eAAe,MAAM,MAAM,IAAI,IAAI,GAAG;AAE1D,MACE,OAAO,aAAa,eACpB,YAAY,WAAW,SAAS,QAChC;AACA,WAAO,YAAY;AAAA,EACrB;AAEA,SAAO,YAAY,SAAS,YAAY;AAC1C;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
function toPublicUrl(url) {
|
|
2
|
-
if (typeof location === "undefined") {
|
|
3
|
-
return url.toString();
|
|
4
|
-
}
|
|
5
2
|
const urlInstance = url instanceof URL ? url : new URL(url);
|
|
6
|
-
|
|
3
|
+
if (typeof location !== "undefined" && urlInstance.origin === location.origin) {
|
|
4
|
+
return urlInstance.pathname;
|
|
5
|
+
}
|
|
6
|
+
return urlInstance.origin + urlInstance.pathname;
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
9
|
toPublicUrl
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/utils/request/toPublicUrl.ts"],"sourcesContent":["/**\n * Returns a relative URL if the given request URL is relative\n * to the current origin. Otherwise returns an absolute URL.\n */\nexport function toPublicUrl(url: string | URL): string {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/utils/request/toPublicUrl.ts"],"sourcesContent":["/**\n * Returns a relative URL if the given request URL is relative\n * to the current origin. Otherwise returns an absolute URL.\n */\nexport function toPublicUrl(url: string | URL): string {\n const urlInstance = url instanceof URL ? url : new URL(url)\n\n if (\n typeof location !== 'undefined' &&\n urlInstance.origin === location.origin\n ) {\n return urlInstance.pathname\n }\n\n return urlInstance.origin + urlInstance.pathname\n}\n"],"mappings":"AAIO,SAAS,YAAY,KAA2B;AACrD,QAAM,cAAc,eAAe,MAAM,MAAM,IAAI,IAAI,GAAG;AAE1D,MACE,OAAO,aAAa,eACpB,YAAY,WAAW,SAAS,QAChC;AACA,WAAO,YAAY;AAAA,EACrB;AAEA,SAAO,YAAY,SAAS,YAAY;AAC1C;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebSocketConnectionData } from '@mswjs/interceptors/WebSocket';
|
|
2
|
-
import { R as RequestHandler } from '../HttpResponse-
|
|
2
|
+
import { R as RequestHandler } from '../HttpResponse-U6SfxBlj.mjs';
|
|
3
3
|
import { WebSocketHandler } from '../handlers/WebSocketHandler.mjs';
|
|
4
4
|
import { UnhandledRequestStrategy } from '../utils/request/onUnhandledRequest.mjs';
|
|
5
5
|
import '@mswjs/interceptors';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebSocketConnectionData } from '@mswjs/interceptors/WebSocket';
|
|
2
|
-
import { R as RequestHandler } from '../HttpResponse-
|
|
2
|
+
import { R as RequestHandler } from '../HttpResponse-DC89RDb7.js';
|
|
3
3
|
import { WebSocketHandler } from '../handlers/WebSocketHandler.js';
|
|
4
4
|
import { UnhandledRequestStrategy } from '../utils/request/onUnhandledRequest.js';
|
|
5
5
|
import '@mswjs/interceptors';
|