File size: 6,572 Bytes
d4b85c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
{
  "name": "@mswjs/interceptors",
  "description": "Low-level HTTP/HTTPS/XHR/fetch request interception library.",
  "version": "0.37.6",
  "main": "./lib/node/index.js",
  "module": "./lib/node/index.mjs",
  "types": "./lib/node/index.d.ts",
  "exports": {
    ".": {
      "types": "./lib/node/index.d.ts",
      "browser": {
        "types": "./lib/browser/index.d.ts",
        "require": "./lib/browser/index.js",
        "import": "./lib/browser/index.mjs",
        "default": "./lib/browser/index.js"
      },
      "require": "./lib/node/index.js",
      "import": "./lib/node/index.mjs",
      "default": "./lib/node/index.js"
    },
    "./ClientRequest": {
      "types": "./lib/node/interceptors/ClientRequest/index.d.ts",
      "node": {
        "require": "./lib/node/interceptors/ClientRequest/index.js",
        "import": "./lib/node/interceptors/ClientRequest/index.mjs"
      },
      "browser": null,
      "require": "./lib/node/interceptors/ClientRequest/index.js",
      "import": "./lib/node/interceptors/ClientRequest/index.mjs",
      "default": "./lib/node/interceptors/ClientRequest/index.js"
    },
    "./XMLHttpRequest": {
      "browser": {
        "types": "./lib/browser/interceptors/XMLHttpRequest/index.d.ts",
        "require": "./lib/browser/interceptors/XMLHttpRequest/index.js",
        "import": "./lib/browser/interceptors/XMLHttpRequest/index.mjs",
        "default": "./lib/browser/interceptors/XMLHttpRequest/index.js"
      },
      "types": "./lib/node/interceptors/XMLHttpRequest/index.d.ts",
      "require": "./lib/node/interceptors/XMLHttpRequest/index.js",
      "import": "./lib/node/interceptors/XMLHttpRequest/index.mjs",
      "default": "./lib/node/interceptors/XMLHttpRequest/index.js"
    },
    "./fetch": {
      "browser": {
        "types": "./lib/browser/interceptors/fetch/index.d.ts",
        "require": "./lib/browser/interceptors/fetch/index.js",
        "import": "./lib/browser/interceptors/fetch/index.mjs",
        "default": "./lib/browser/interceptors/fetch/index.js"
      },
      "types": "./lib/node/interceptors/fetch/index.d.ts",
      "require": "./lib/node/interceptors/fetch/index.js",
      "import": "./lib/node/interceptors/fetch/index.mjs",
      "default": "./lib/node/interceptors/fetch/index.js"
    },
    "./WebSocket": {
      "types": "./lib/browser/interceptors/WebSocket/index.d.ts",
      "require": "./lib/browser/interceptors/WebSocket/index.js",
      "import": "./lib/browser/interceptors/WebSocket/index.mjs",
      "default": "./lib/browser/interceptors/WebSocket/index.js"
    },
    "./RemoteHttpInterceptor": {
      "types": "./lib/node/RemoteHttpInterceptor.d.ts",
      "node": {
        "require": "./lib/node/RemoteHttpInterceptor.js",
        "import": "./lib/node/RemoteHttpInterceptor.mjs"
      },
      "browser": null,
      "require": "./lib/node/RemoteHttpInterceptor.js",
      "import": "./lib/node/RemoteHttpInterceptor.mjs",
      "default": "./lib/node/RemoteHttpInterceptor.js"
    },
    "./presets/node": {
      "types": "./lib/node/presets/node.d.ts",
      "node": {
        "require": "./lib/node/presets/node.js",
        "import": "./lib/node/presets/node.mjs"
      },
      "browser": null,
      "require": "./lib/node/presets/node.js",
      "import": "./lib/node/presets/node.mjs",
      "default": "./lib/node/presets/node.js"
    },
    "./presets/browser": {
      "browser": {
        "types": "./lib/browser/presets/browser.d.ts",
        "require": "./lib/browser/presets/browser.js",
        "import": "./lib/browser/presets/browser.mjs",
        "default": "./lib/browser/presets/browser.js"
      }
    }
  },
  "author": "Artem Zakharchenko",
  "license": "MIT",
  "engines": {
    "node": ">=18"
  },
  "files": [
    "lib",
    "README.md",
    "src",
    "ClientRequest",
    "fetch",
    "RemoteHttpInterceptor",
    "XMLHttpRequest",
    "WebSocket"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/mswjs/interceptors"
  },
  "devDependencies": {
    "@commitlint/cli": "^16.0.2",
    "@commitlint/config-conventional": "^16.0.0",
    "@open-draft/test-server": "^0.5.1",
    "@ossjs/release": "^0.8.1",
    "@playwright/test": "^1.37.1",
    "@types/cors": "^2.8.12",
    "@types/express": "^4.17.13",
    "@types/express-fileupload": "^1.5.0",
    "@types/express-rate-limit": "^6.0.0",
    "@types/follow-redirects": "^1.14.1",
    "@types/jest": "^27.0.3",
    "@types/node": "^18.19.31",
    "@types/node-fetch": "2.5.12",
    "@types/superagent": "^8.1.9",
    "@types/supertest": "^2.0.11",
    "@types/ws": "^8.5.10",
    "axios": "^1.6.0",
    "body-parser": "^1.19.0",
    "commitizen": "^4.2.4",
    "cors": "^2.8.5",
    "cross-env": "^7.0.3",
    "cz-conventional-changelog": "3.3.0",
    "engine.io-parser": "^5.2.1",
    "express": "^4.17.3",
    "express-fileupload": "^1.5.1",
    "express-rate-limit": "^6.3.0",
    "follow-redirects": "^1.15.1",
    "got": "^11.8.3",
    "happy-dom": "^12.10.3",
    "jest": "^27.4.3",
    "node-fetch": "2.6.7",
    "rimraf": "^3.0.2",
    "simple-git-hooks": "^2.7.0",
    "socket.io": "^4.7.4",
    "socket.io-client": "^4.7.4",
    "socket.io-parser": "^4.2.4",
    "superagent": "^10.1.1",
    "supertest": "^6.1.6",
    "ts-jest": "^27.1.1",
    "tsup": "^6.5.0",
    "typescript": "^4.9.4",
    "undici": "^6.6.2",
    "vitest": "^1.2.2",
    "vitest-environment-miniflare": "^2.14.1",
    "wait-for-expect": "^3.0.2",
    "web-encoding": "^1.1.5",
    "webpack-http-server": "^0.5.0",
    "ws": "^8.16.0"
  },
  "dependencies": {
    "@open-draft/deferred-promise": "^2.2.0",
    "@open-draft/logger": "^0.3.0",
    "@open-draft/until": "^2.0.0",
    "is-node-process": "^1.2.0",
    "outvariant": "^1.4.3",
    "strict-event-emitter": "^0.5.1"
  },
  "resolutions": {
    "memfs": "^3.4.13"
  },
  "keywords": [
    "request",
    "intercept",
    "http",
    "https",
    "xmlhttprequest",
    "xhr",
    "fetch",
    "low-level",
    "mock",
    "spy",
    "testing"
  ],
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  },
  "scripts": {
    "start": "tsc --build -w",
    "test": "pnpm test:unit && pnpm test:integration",
    "test:unit": "vitest",
    "test:integration": "pnpm test:node && pnpm test:browser",
    "test:node": "vitest -c test/vitest.config.js",
    "test:browser": "pnpm playwright test -c test/playwright.config.ts",
    "clean": "rimraf lib",
    "build": "pnpm clean && cross-env NODE_ENV=production tsup --splitting",
    "release": "release publish"
  }
}