msw 2.4.1 → 2.4.2
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/cli/index.js +0 -1
- package/cli/init.js +59 -31
- package/cli/invariant.js +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.js +1 -16
- package/lib/core/utils/internal/parseGraphQLRequest.js.map +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.mjs +1 -3
- package/lib/core/utils/internal/parseGraphQLRequest.mjs.map +1 -1
- package/lib/iife/index.js +1 -6
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +2 -2
- package/src/core/utils/internal/parseGraphQLRequest.ts +8 -6
package/lib/mockServiceWorker.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const PACKAGE_VERSION = '2.4.
|
|
11
|
+
const PACKAGE_VERSION = '2.4.2'
|
|
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.4.
|
|
3
|
+
"version": "2.4.2",
|
|
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",
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
},
|
|
182
182
|
"peerDependencies": {
|
|
183
183
|
"graphql": ">= 16.8.x",
|
|
184
|
-
"typescript": ">= 4.
|
|
184
|
+
"typescript": ">= 4.8.x"
|
|
185
185
|
},
|
|
186
186
|
"peerDependenciesMeta": {
|
|
187
187
|
"graphql": {
|
|
@@ -40,12 +40,14 @@ export function parseDocumentNode(node: DocumentNode): ParsedGraphQLQuery {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
async function parseQuery(query: string): Promise<ParsedGraphQLQuery | Error> {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
/**
|
|
44
|
+
* @note Use `require` to get the "graphql" module here.
|
|
45
|
+
* It has to be scoped to this function because this module leaks to the
|
|
46
|
+
* root export. It has to be `require` because tools like Jest have trouble
|
|
47
|
+
* handling dynamic imports. It gets replaced with a dynamic import on build time.
|
|
48
|
+
*/
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
50
|
+
const { parse } = require('graphql')
|
|
49
51
|
|
|
50
52
|
try {
|
|
51
53
|
const ast = parse(query)
|