msw 2.2.7 → 2.2.8
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/README.md +1 -1
- package/lib/browser/index.js +0 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +0 -1
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/typeUtils.js.map +1 -1
- package/lib/core/utils/internal/mergeRight.js +15 -12
- package/lib/core/utils/internal/mergeRight.js.map +1 -1
- package/lib/core/utils/internal/mergeRight.mjs +15 -12
- package/lib/core/utils/internal/mergeRight.mjs.map +1 -1
- package/lib/iife/index.js +15 -13
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +1 -1
- package/src/browser/setupWorker/start/createResponseListener.ts +0 -2
- package/src/core/typeUtils.ts +10 -10
- package/src/core/utils/internal/mergeRight.ts +16 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/typeUtils.ts"],"sourcesContent":["type Fn = (...arg: any[]) => any\n\nexport type MaybePromise<T> = T | Promise<T>\n\nexport type RequiredDeep<\n Type,\n U extends Record<string, unknown> | Fn | undefined = undefined,\n> = Type extends Fn\n ? Type\n : /**\n
|
|
1
|
+
{"version":3,"sources":["../../src/core/typeUtils.ts"],"sourcesContent":["type Fn = (...arg: any[]) => any\n\nexport type MaybePromise<T> = T | Promise<T>\n\nexport type RequiredDeep<\n Type,\n U extends Record<string, unknown> | Fn | undefined = undefined,\n> = Type extends Fn\n ? Type\n : /**\n * @note The \"Fn\" type satisfies the predicate below.\n * It must always come first, before the Record check.\n */\n Type extends Record<string, any>\n ? {\n [Key in keyof Type]-?: NonNullable<Type[Key]> extends NonNullable<U>\n ? NonNullable<Type[Key]>\n : RequiredDeep<NonNullable<Type[Key]>, U>\n }\n : Type\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -23,18 +23,21 @@ __export(mergeRight_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(mergeRight_exports);
|
|
24
24
|
var import_isObject = require("./isObject.js");
|
|
25
25
|
function mergeRight(left, right) {
|
|
26
|
-
return Object.entries(right).reduce(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
return Object.entries(right).reduce(
|
|
27
|
+
(result, [key, rightValue]) => {
|
|
28
|
+
const leftValue = result[key];
|
|
29
|
+
if (Array.isArray(leftValue) && Array.isArray(rightValue)) {
|
|
30
|
+
result[key] = leftValue.concat(rightValue);
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
if ((0, import_isObject.isObject)(leftValue) && (0, import_isObject.isObject)(rightValue)) {
|
|
34
|
+
result[key] = mergeRight(leftValue, rightValue);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
result[key] = rightValue;
|
|
30
38
|
return result;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
36
|
-
result[key] = rightValue;
|
|
37
|
-
return result;
|
|
38
|
-
}, Object.assign({}, left));
|
|
39
|
+
},
|
|
40
|
+
Object.assign({}, left)
|
|
41
|
+
);
|
|
39
42
|
}
|
|
40
43
|
//# sourceMappingURL=mergeRight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/utils/internal/mergeRight.ts"],"sourcesContent":["import { isObject } from './isObject'\n\n/**\n * Deeply merges two given objects with the right one\n * having a priority during property assignment.\n */\nexport function mergeRight(\n left: Record<string, any>,\n right: Record<string, any>,\n) {\n return Object.entries(right).reduce((result, [key, rightValue]) => {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/utils/internal/mergeRight.ts"],"sourcesContent":["import { isObject } from './isObject'\n\n/**\n * Deeply merges two given objects with the right one\n * having a priority during property assignment.\n */\nexport function mergeRight(\n left: Record<string, any>,\n right: Record<string, any>,\n) {\n return Object.entries(right).reduce(\n (result, [key, rightValue]) => {\n const leftValue = result[key]\n\n if (Array.isArray(leftValue) && Array.isArray(rightValue)) {\n result[key] = leftValue.concat(rightValue)\n return result\n }\n\n if (isObject(leftValue) && isObject(rightValue)) {\n result[key] = mergeRight(leftValue, rightValue)\n return result\n }\n\n result[key] = rightValue\n return result\n },\n Object.assign({}, left),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AAMlB,SAAS,WACd,MACA,OACA;AACA,SAAO,OAAO,QAAQ,KAAK,EAAE;AAAA,IAC3B,CAAC,QAAQ,CAAC,KAAK,UAAU,MAAM;AAC7B,YAAM,YAAY,OAAO,GAAG;AAE5B,UAAI,MAAM,QAAQ,SAAS,KAAK,MAAM,QAAQ,UAAU,GAAG;AACzD,eAAO,GAAG,IAAI,UAAU,OAAO,UAAU;AACzC,eAAO;AAAA,MACT;AAEA,cAAI,0BAAS,SAAS,SAAK,0BAAS,UAAU,GAAG;AAC/C,eAAO,GAAG,IAAI,WAAW,WAAW,UAAU;AAC9C,eAAO;AAAA,MACT;AAEA,aAAO,GAAG,IAAI;AACd,aAAO;AAAA,IACT;AAAA,IACA,OAAO,OAAO,CAAC,GAAG,IAAI;AAAA,EACxB;AACF;","names":[]}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { isObject } from './isObject.mjs';
|
|
2
2
|
function mergeRight(left, right) {
|
|
3
|
-
return Object.entries(right).reduce(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
return Object.entries(right).reduce(
|
|
4
|
+
(result, [key, rightValue]) => {
|
|
5
|
+
const leftValue = result[key];
|
|
6
|
+
if (Array.isArray(leftValue) && Array.isArray(rightValue)) {
|
|
7
|
+
result[key] = leftValue.concat(rightValue);
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
if (isObject(leftValue) && isObject(rightValue)) {
|
|
11
|
+
result[key] = mergeRight(leftValue, rightValue);
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
result[key] = rightValue;
|
|
7
15
|
return result;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
result[key] = rightValue;
|
|
14
|
-
return result;
|
|
15
|
-
}, Object.assign({}, left));
|
|
16
|
+
},
|
|
17
|
+
Object.assign({}, left)
|
|
18
|
+
);
|
|
16
19
|
}
|
|
17
20
|
export {
|
|
18
21
|
mergeRight
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/utils/internal/mergeRight.ts"],"sourcesContent":["import { isObject } from './isObject'\n\n/**\n * Deeply merges two given objects with the right one\n * having a priority during property assignment.\n */\nexport function mergeRight(\n left: Record<string, any>,\n right: Record<string, any>,\n) {\n return Object.entries(right).reduce((result, [key, rightValue]) => {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/utils/internal/mergeRight.ts"],"sourcesContent":["import { isObject } from './isObject'\n\n/**\n * Deeply merges two given objects with the right one\n * having a priority during property assignment.\n */\nexport function mergeRight(\n left: Record<string, any>,\n right: Record<string, any>,\n) {\n return Object.entries(right).reduce(\n (result, [key, rightValue]) => {\n const leftValue = result[key]\n\n if (Array.isArray(leftValue) && Array.isArray(rightValue)) {\n result[key] = leftValue.concat(rightValue)\n return result\n }\n\n if (isObject(leftValue) && isObject(rightValue)) {\n result[key] = mergeRight(leftValue, rightValue)\n return result\n }\n\n result[key] = rightValue\n return result\n },\n Object.assign({}, left),\n )\n}\n"],"mappings":"AAAA,SAAS,gBAAgB;AAMlB,SAAS,WACd,MACA,OACA;AACA,SAAO,OAAO,QAAQ,KAAK,EAAE;AAAA,IAC3B,CAAC,QAAQ,CAAC,KAAK,UAAU,MAAM;AAC7B,YAAM,YAAY,OAAO,GAAG;AAE5B,UAAI,MAAM,QAAQ,SAAS,KAAK,MAAM,QAAQ,UAAU,GAAG;AACzD,eAAO,GAAG,IAAI,UAAU,OAAO,UAAU;AACzC,eAAO;AAAA,MACT;AAEA,UAAI,SAAS,SAAS,KAAK,SAAS,UAAU,GAAG;AAC/C,eAAO,GAAG,IAAI,WAAW,WAAW,UAAU;AAC9C,eAAO;AAAA,MACT;AAEA,aAAO,GAAG,IAAI;AACd,aAAO;AAAA,IACT;AAAA,IACA,OAAO,OAAO,CAAC,GAAG,IAAI;AAAA,EACxB;AACF;","names":[]}
|
package/lib/iife/index.js
CHANGED
|
@@ -6234,7 +6234,6 @@ You can also automate this process and make the worker script update automatical
|
|
|
6234
6234
|
const { requestId } = responseJson;
|
|
6235
6235
|
const request = context.requests.get(requestId);
|
|
6236
6236
|
context.requests.delete(requestId);
|
|
6237
|
-
console.log("RESPONSE LISTENER", responseJson, context.requests);
|
|
6238
6237
|
if (responseJson.type?.includes("opaque")) {
|
|
6239
6238
|
return;
|
|
6240
6239
|
}
|
|
@@ -6390,19 +6389,22 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
6390
6389
|
|
|
6391
6390
|
// src/core/utils/internal/mergeRight.ts
|
|
6392
6391
|
function mergeRight(left, right) {
|
|
6393
|
-
return Object.entries(right).reduce(
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6392
|
+
return Object.entries(right).reduce(
|
|
6393
|
+
(result, [key, rightValue]) => {
|
|
6394
|
+
const leftValue = result[key];
|
|
6395
|
+
if (Array.isArray(leftValue) && Array.isArray(rightValue)) {
|
|
6396
|
+
result[key] = leftValue.concat(rightValue);
|
|
6397
|
+
return result;
|
|
6398
|
+
}
|
|
6399
|
+
if (isObject(leftValue) && isObject(rightValue)) {
|
|
6400
|
+
result[key] = mergeRight(leftValue, rightValue);
|
|
6401
|
+
return result;
|
|
6402
|
+
}
|
|
6403
|
+
result[key] = rightValue;
|
|
6401
6404
|
return result;
|
|
6402
|
-
}
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
}, Object.assign({}, left));
|
|
6405
|
+
},
|
|
6406
|
+
Object.assign({}, left)
|
|
6407
|
+
);
|
|
6406
6408
|
}
|
|
6407
6409
|
|
|
6408
6410
|
// src/browser/setupWorker/start/utils/prepareStartHandler.ts
|