Comparing version 2.2.7 to 2.2.8
@@ -26,16 +26,19 @@ "use strict"; | ||
function mergeRight(left, right) { | ||
return Object.entries(right).reduce((result, [key, rightValue]) => { | ||
const leftValue = result[key]; | ||
if (Array.isArray(leftValue) && Array.isArray(rightValue)) { | ||
result[key] = leftValue.concat(rightValue); | ||
return Object.entries(right).reduce( | ||
(result, [key, rightValue]) => { | ||
const leftValue = result[key]; | ||
if (Array.isArray(leftValue) && Array.isArray(rightValue)) { | ||
result[key] = leftValue.concat(rightValue); | ||
return result; | ||
} | ||
if ((0, import_isObject.isObject)(leftValue) && (0, import_isObject.isObject)(rightValue)) { | ||
result[key] = mergeRight(leftValue, rightValue); | ||
return result; | ||
} | ||
result[key] = rightValue; | ||
return result; | ||
} | ||
if ((0, import_isObject.isObject)(leftValue) && (0, import_isObject.isObject)(rightValue)) { | ||
result[key] = mergeRight(leftValue, rightValue); | ||
return result; | ||
} | ||
result[key] = rightValue; | ||
return result; | ||
}, Object.assign({}, left)); | ||
}, | ||
Object.assign({}, left) | ||
); | ||
} | ||
//# sourceMappingURL=mergeRight.js.map |
@@ -11,3 +11,3 @@ /* eslint-disable */ | ||
const PACKAGE_VERSION = '2.2.7' | ||
const PACKAGE_VERSION = '2.2.8' | ||
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423' | ||
@@ -14,0 +14,0 @@ const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') |
{ | ||
"name": "msw", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "Seamless REST/GraphQL API mocking library for browser and Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/core/index.js", |
@@ -103,3 +103,3 @@ > **MSW 2.0 is finally here! 🎉** Read the [Release notes](https://github.com/mswjs/msw/releases/tag/v2.0.0) and please follow the [**Migration guidelines**](https://mswjs.io/docs/migrations/1.x-to-2.x) to upgrade. If you're having any questions while upgrading, please reach out in our [Discord server](https://kettanaito.com/discord). | ||
// 3. Start request interception by starting the Service Worker. | ||
worker.start() | ||
await worker.start() | ||
``` | ||
@@ -106,0 +106,0 @@ |
@@ -24,4 +24,2 @@ import type { | ||
console.log('RESPONSE LISTENER', responseJson, context.requests) | ||
/** | ||
@@ -28,0 +26,0 @@ * CORS requests with `mode: "no-cors"` result in "opaque" responses. |
@@ -11,11 +11,11 @@ type Fn = (...arg: any[]) => any | ||
: /** | ||
* @note The "Fn" type satisfies the predicate below. | ||
* It must always come first, before the Record check. | ||
*/ | ||
Type extends Record<string, any> | ||
? { | ||
[Key in keyof Type]-?: NonNullable<Type[Key]> extends NonNullable<U> | ||
? NonNullable<Type[Key]> | ||
: RequiredDeep<NonNullable<Type[Key]>, U> | ||
} | ||
: Type | ||
* @note The "Fn" type satisfies the predicate below. | ||
* It must always come first, before the Record check. | ||
*/ | ||
Type extends Record<string, any> | ||
? { | ||
[Key in keyof Type]-?: NonNullable<Type[Key]> extends NonNullable<U> | ||
? NonNullable<Type[Key]> | ||
: RequiredDeep<NonNullable<Type[Key]>, U> | ||
} | ||
: Type |
@@ -11,18 +11,21 @@ import { isObject } from './isObject' | ||
) { | ||
return Object.entries(right).reduce((result, [key, rightValue]) => { | ||
const leftValue = result[key] | ||
return Object.entries(right).reduce( | ||
(result, [key, rightValue]) => { | ||
const leftValue = result[key] | ||
if (Array.isArray(leftValue) && Array.isArray(rightValue)) { | ||
result[key] = leftValue.concat(rightValue) | ||
return result | ||
} | ||
if (Array.isArray(leftValue) && Array.isArray(rightValue)) { | ||
result[key] = leftValue.concat(rightValue) | ||
return result | ||
} | ||
if (isObject(leftValue) && isObject(rightValue)) { | ||
result[key] = mergeRight(leftValue, rightValue) | ||
if (isObject(leftValue) && isObject(rightValue)) { | ||
result[key] = mergeRight(leftValue, rightValue) | ||
return result | ||
} | ||
result[key] = rightValue | ||
return result | ||
} | ||
result[key] = rightValue | ||
return result | ||
}, Object.assign({}, left)) | ||
}, | ||
Object.assign({}, left), | ||
) | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25825
2056060