msw 2.2.3 → 2.2.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.
Files changed (46) hide show
  1. package/cli/init.js +1 -1
  2. package/lib/core/{GraphQLHandler-AenIUdwE.d.mts → GraphQLHandler-BumTfgY4.d.mts} +1 -1
  3. package/lib/core/{GraphQLHandler-jOzqbxSK.d.ts → GraphQLHandler-DqVT0Gbq.d.ts} +1 -1
  4. package/lib/core/HttpResponse.d.mts +1 -1
  5. package/lib/core/HttpResponse.d.ts +1 -1
  6. package/lib/core/SetupApi.d.mts +1 -1
  7. package/lib/core/SetupApi.d.ts +1 -1
  8. package/lib/core/getResponse.d.mts +1 -1
  9. package/lib/core/getResponse.d.ts +1 -1
  10. package/lib/core/graphql.d.mts +2 -2
  11. package/lib/core/graphql.d.ts +2 -2
  12. package/lib/core/handlers/GraphQLHandler.d.mts +2 -2
  13. package/lib/core/handlers/GraphQLHandler.d.ts +2 -2
  14. package/lib/core/handlers/HttpHandler.d.mts +1 -1
  15. package/lib/core/handlers/HttpHandler.d.ts +1 -1
  16. package/lib/core/handlers/RequestHandler.d.mts +1 -1
  17. package/lib/core/handlers/RequestHandler.d.ts +1 -1
  18. package/lib/core/http.d.mts +1 -1
  19. package/lib/core/http.d.ts +1 -1
  20. package/lib/core/index.d.mts +2 -2
  21. package/lib/core/index.d.ts +2 -2
  22. package/lib/core/passthrough.d.mts +1 -1
  23. package/lib/core/passthrough.d.ts +1 -1
  24. package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
  25. package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
  26. package/lib/core/utils/HttpResponse/decorators.js +4 -1
  27. package/lib/core/utils/HttpResponse/decorators.js.map +1 -1
  28. package/lib/core/utils/HttpResponse/decorators.mjs +4 -1
  29. package/lib/core/utils/HttpResponse/decorators.mjs.map +1 -1
  30. package/lib/core/utils/executeHandlers.d.mts +1 -1
  31. package/lib/core/utils/executeHandlers.d.ts +1 -1
  32. package/lib/core/utils/handleRequest.d.mts +1 -1
  33. package/lib/core/utils/handleRequest.d.ts +1 -1
  34. package/lib/core/utils/internal/parseGraphQLRequest.d.mts +2 -2
  35. package/lib/core/utils/internal/parseGraphQLRequest.d.ts +2 -2
  36. package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
  37. package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
  38. package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
  39. package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
  40. package/lib/iife/index.js +3 -1
  41. package/lib/iife/index.js.map +1 -1
  42. package/lib/mockServiceWorker.js +1 -1
  43. package/package.json +5 -5
  44. package/src/core/utils/HttpResponse/decorators.ts +8 -4
  45. /package/lib/core/{HttpResponse-wcp03c7-.d.mts → HttpResponse-C94XLD-W.d.mts} +0 -0
  46. /package/lib/core/{HttpResponse-_514VQ9z.d.ts → HttpResponse-jHZ0p2dL.d.ts} +0 -0
@@ -2,7 +2,7 @@
2
2
  /* tslint:disable */
3
3
 
4
4
  /**
5
- * Mock Service Worker (2.2.3).
5
+ * Mock Service Worker (2.2.4).
6
6
  * @see https://github.com/mswjs/msw
7
7
  * - Please do NOT modify this file.
8
8
  * - Please do NOT serve this file on production.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "msw",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
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",
@@ -126,7 +126,7 @@
126
126
  "@commitlint/cli": "^18.4.4",
127
127
  "@commitlint/config-conventional": "^18.4.4",
128
128
  "@open-draft/test-server": "^0.4.2",
129
- "@ossjs/release": "^0.8.0",
129
+ "@ossjs/release": "^0.8.1",
130
130
  "@playwright/test": "^1.40.1",
131
131
  "@swc/core": "^1.3.102",
132
132
  "@types/express": "^4.17.21",
@@ -134,8 +134,8 @@
134
134
  "@types/glob": "^8.1.0",
135
135
  "@types/json-bigint": "^1.0.4",
136
136
  "@types/node": "18.x",
137
- "@typescript-eslint/eslint-plugin": "^5.11.0",
138
- "@typescript-eslint/parser": "^5.11.0",
137
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
138
+ "@typescript-eslint/parser": "^7.2.0",
139
139
  "@web/dev-server": "^0.1.38",
140
140
  "axios": "^1.6.5",
141
141
  "babel-minify": "^0.5.1",
@@ -145,7 +145,7 @@
145
145
  "cz-conventional-changelog": "3.3.0",
146
146
  "esbuild": "^0.19.11",
147
147
  "esbuild-loader": "^4.0.2",
148
- "eslint": "^8.56.0",
148
+ "eslint": "^8.57.0",
149
149
  "eslint-config-prettier": "^9.1.0",
150
150
  "eslint-plugin-prettier": "^5.1.3",
151
151
  "express": "^4.18.2",
@@ -1,5 +1,6 @@
1
1
  import statuses from '@bundled-es-modules/statuses'
2
2
  import type { HttpResponseInit } from '../../HttpResponse'
3
+ import { Headers as HeadersPolyfill } from 'headers-polyfill'
3
4
 
4
5
  const { message } = statuses
5
6
 
@@ -40,10 +41,13 @@ export function decorateResponse(
40
41
  // Cookie forwarding is only relevant in the browser.
41
42
  if (typeof document !== 'undefined') {
42
43
  // Write the mocked response cookies to the document.
43
- // Note that Fetch API Headers will concatenate multiple "Set-Cookie"
44
- // headers into a single comma-separated string, just as it does
45
- // with any other multi-value headers.
46
- const responseCookies = init.headers.get('Set-Cookie')?.split(',') || []
44
+ // Use `headers-polyfill` to get the Set-Cookie header value correctly.
45
+ // This is an alternative until TypeScript 5.2
46
+ // and Node.js v20 become the minimum supported version
47
+ // and getSetCookie in Headers can be used directly.
48
+ const responseCookies = HeadersPolyfill.prototype.getSetCookie.call(
49
+ init.headers,
50
+ )
47
51
 
48
52
  for (const cookieString of responseCookies) {
49
53
  // No need to parse the cookie headers because it's defined