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.
@@ -8,7 +8,7 @@
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const PACKAGE_VERSION = '2.2.7'
11
+ const PACKAGE_VERSION = '2.2.8'
12
12
  const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
13
13
  const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
14
14
  const activeClientIds = new Set()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "msw",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "description": "Seamless REST/GraphQL API mocking library for browser and Node.js.",
5
5
  "main": "./lib/core/index.js",
6
6
  "module": "./lib/core/index.mjs",
@@ -21,8 +21,6 @@ export function createResponseListener(context: SetupWorkerInternalContext) {
21
21
  const request = context.requests.get(requestId)!
22
22
  context.requests.delete(requestId)
23
23
 
24
- console.log('RESPONSE LISTENER', responseJson, context.requests)
25
-
26
24
  /**
27
25
  * CORS requests with `mode: "no-cors"` result in "opaque" responses.
28
26
  * That kind of responses cannot be manipulated in JavaScript due
@@ -8,13 +8,13 @@ export type RequiredDeep<
8
8
  > = Type extends Fn
9
9
  ? Type
10
10
  : /**
11
- * @note The "Fn" type satisfies the predicate below.
12
- * It must always come first, before the Record check.
13
- */
14
- Type extends Record<string, any>
15
- ? {
16
- [Key in keyof Type]-?: NonNullable<Type[Key]> extends NonNullable<U>
17
- ? NonNullable<Type[Key]>
18
- : RequiredDeep<NonNullable<Type[Key]>, U>
19
- }
20
- : Type
11
+ * @note The "Fn" type satisfies the predicate below.
12
+ * It must always come first, before the Record check.
13
+ */
14
+ Type extends Record<string, any>
15
+ ? {
16
+ [Key in keyof Type]-?: NonNullable<Type[Key]> extends NonNullable<U>
17
+ ? NonNullable<Type[Key]>
18
+ : RequiredDeep<NonNullable<Type[Key]>, U>
19
+ }
20
+ : Type
@@ -8,20 +8,23 @@ export function mergeRight(
8
8
  left: Record<string, any>,
9
9
  right: Record<string, any>,
10
10
  ) {
11
- return Object.entries(right).reduce((result, [key, rightValue]) => {
12
- const leftValue = result[key]
11
+ return Object.entries(right).reduce(
12
+ (result, [key, rightValue]) => {
13
+ const leftValue = result[key]
13
14
 
14
- if (Array.isArray(leftValue) && Array.isArray(rightValue)) {
15
- result[key] = leftValue.concat(rightValue)
16
- return result
17
- }
15
+ if (Array.isArray(leftValue) && Array.isArray(rightValue)) {
16
+ result[key] = leftValue.concat(rightValue)
17
+ return result
18
+ }
18
19
 
19
- if (isObject(leftValue) && isObject(rightValue)) {
20
- result[key] = mergeRight(leftValue, rightValue)
21
- return result
22
- }
20
+ if (isObject(leftValue) && isObject(rightValue)) {
21
+ result[key] = mergeRight(leftValue, rightValue)
22
+ return result
23
+ }
23
24
 
24
- result[key] = rightValue
25
- return result
26
- }, Object.assign({}, left))
25
+ result[key] = rightValue
26
+ return result
27
+ },
28
+ Object.assign({}, left),
29
+ )
27
30
  }