@mswjs/interceptors 0.22.5 → 0.22.7
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/lib/browser/{chunk-KDXWM46S.js → chunk-BVV2ZW34.js} +1 -8
- package/lib/browser/{chunk-CNZUUPXM.mjs → chunk-PGR64QLT.mjs} +1 -8
- package/lib/browser/interceptors/XMLHttpRequest/index.js +2 -2
- package/lib/browser/interceptors/XMLHttpRequest/index.mjs +1 -1
- package/lib/browser/presets/browser.js +2 -2
- package/lib/browser/presets/browser.mjs +1 -1
- package/lib/node/RemoteHttpInterceptor.js +2 -2
- package/lib/node/RemoteHttpInterceptor.mjs +1 -1
- package/lib/node/{chunk-HTLVOEKP.js → chunk-F7BBA6FT.js} +1 -8
- package/lib/node/{chunk-HGKO2BOA.mjs → chunk-X3TLFWGD.mjs} +1 -8
- package/lib/node/interceptors/XMLHttpRequest/index.js +2 -2
- package/lib/node/interceptors/XMLHttpRequest/index.mjs +1 -1
- package/lib/node/presets/node.js +2 -2
- package/lib/node/presets/node.mjs +1 -1
- package/package.json +9 -9
- package/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts +2 -8
|
@@ -208,14 +208,7 @@ var XMLHttpRequestController = class {
|
|
|
208
208
|
this.request = createProxy(initialRequest, {
|
|
209
209
|
setProperty: ([propertyName, nextValue], invoke) => {
|
|
210
210
|
switch (propertyName) {
|
|
211
|
-
case "
|
|
212
|
-
case "onerror":
|
|
213
|
-
case "onload":
|
|
214
|
-
case "onloadend":
|
|
215
|
-
case "onloadstart":
|
|
216
|
-
case "onprogress":
|
|
217
|
-
case "ontimeout":
|
|
218
|
-
case "onreadystatechange": {
|
|
211
|
+
case "ontimeout": {
|
|
219
212
|
const eventName = propertyName.slice(
|
|
220
213
|
2
|
|
221
214
|
);
|
|
@@ -208,14 +208,7 @@ var XMLHttpRequestController = class {
|
|
|
208
208
|
this.request = createProxy(initialRequest, {
|
|
209
209
|
setProperty: ([propertyName, nextValue], invoke) => {
|
|
210
210
|
switch (propertyName) {
|
|
211
|
-
case "
|
|
212
|
-
case "onerror":
|
|
213
|
-
case "onload":
|
|
214
|
-
case "onloadend":
|
|
215
|
-
case "onloadstart":
|
|
216
|
-
case "onprogress":
|
|
217
|
-
case "ontimeout":
|
|
218
|
-
case "onreadystatechange": {
|
|
211
|
+
case "ontimeout": {
|
|
219
212
|
const eventName = propertyName.slice(
|
|
220
213
|
2
|
|
221
214
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBVV2ZW34js = require('../../chunk-BVV2ZW34.js');
|
|
4
4
|
require('../../chunk-2EIH6L6D.js');
|
|
5
5
|
require('../../chunk-PCFJD76X.js');
|
|
6
6
|
require('../../chunk-OK5YCL7L.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.XMLHttpRequestInterceptor =
|
|
9
|
+
exports.XMLHttpRequestInterceptor = _chunkBVV2ZW34js.XMLHttpRequestInterceptor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBVV2ZW34js = require('../chunk-BVV2ZW34.js');
|
|
4
4
|
require('../chunk-2EIH6L6D.js');
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ require('../chunk-OK5YCL7L.js');
|
|
|
11
11
|
// src/presets/browser.ts
|
|
12
12
|
var browser_default = [
|
|
13
13
|
new (0, _chunk2Z7B3HL5js.FetchInterceptor)(),
|
|
14
|
-
new (0,
|
|
14
|
+
new (0, _chunkBVV2ZW34js.XMLHttpRequestInterceptor)()
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
|
|
@@ -6,7 +6,7 @@ var _chunkSFLY7F52js = require('./chunk-SFLY7F52.js');
|
|
|
6
6
|
var _chunkD7MOETL2js = require('./chunk-D7MOETL2.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkF7BBA6FTjs = require('./chunk-F7BBA6FT.js');
|
|
10
10
|
require('./chunk-MUUQLKVJ.js');
|
|
11
11
|
require('./chunk-VQ4DZOBB.js');
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ var RemoteHttpInterceptor = class extends _chunkSFLY7F52js.BatchInterceptor {
|
|
|
24
24
|
name: "remote-interceptor",
|
|
25
25
|
interceptors: [
|
|
26
26
|
new (0, _chunkD7MOETL2js.ClientRequestInterceptor)(),
|
|
27
|
-
new (0,
|
|
27
|
+
new (0, _chunkF7BBA6FTjs.XMLHttpRequestInterceptor)()
|
|
28
28
|
]
|
|
29
29
|
});
|
|
30
30
|
}
|
|
@@ -210,14 +210,7 @@ var XMLHttpRequestController = class {
|
|
|
210
210
|
this.request = createProxy(initialRequest, {
|
|
211
211
|
setProperty: ([propertyName, nextValue], invoke) => {
|
|
212
212
|
switch (propertyName) {
|
|
213
|
-
case "
|
|
214
|
-
case "onerror":
|
|
215
|
-
case "onload":
|
|
216
|
-
case "onloadend":
|
|
217
|
-
case "onloadstart":
|
|
218
|
-
case "onprogress":
|
|
219
|
-
case "ontimeout":
|
|
220
|
-
case "onreadystatechange": {
|
|
213
|
+
case "ontimeout": {
|
|
221
214
|
const eventName = propertyName.slice(
|
|
222
215
|
2
|
|
223
216
|
);
|
|
@@ -210,14 +210,7 @@ var XMLHttpRequestController = class {
|
|
|
210
210
|
this.request = createProxy(initialRequest, {
|
|
211
211
|
setProperty: ([propertyName, nextValue], invoke) => {
|
|
212
212
|
switch (propertyName) {
|
|
213
|
-
case "
|
|
214
|
-
case "onerror":
|
|
215
|
-
case "onload":
|
|
216
|
-
case "onloadend":
|
|
217
|
-
case "onloadstart":
|
|
218
|
-
case "onprogress":
|
|
219
|
-
case "ontimeout":
|
|
220
|
-
case "onreadystatechange": {
|
|
213
|
+
case "ontimeout": {
|
|
221
214
|
const eventName = propertyName.slice(
|
|
222
215
|
2
|
|
223
216
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkF7BBA6FTjs = require('../../chunk-F7BBA6FT.js');
|
|
4
4
|
require('../../chunk-MUUQLKVJ.js');
|
|
5
5
|
require('../../chunk-VQ4DZOBB.js');
|
|
6
6
|
require('../../chunk-ZJOF5MEZ.js');
|
|
7
7
|
require('../../chunk-62KFIM4W.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.XMLHttpRequestInterceptor =
|
|
10
|
+
exports.XMLHttpRequestInterceptor = _chunkF7BBA6FTjs.XMLHttpRequestInterceptor;
|
package/lib/node/presets/node.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkD7MOETL2js = require('../chunk-D7MOETL2.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkF7BBA6FTjs = require('../chunk-F7BBA6FT.js');
|
|
7
7
|
require('../chunk-MUUQLKVJ.js');
|
|
8
8
|
require('../chunk-VQ4DZOBB.js');
|
|
9
9
|
require('../chunk-ZJOF5MEZ.js');
|
|
@@ -12,7 +12,7 @@ require('../chunk-62KFIM4W.js');
|
|
|
12
12
|
// src/presets/node.ts
|
|
13
13
|
var node_default = [
|
|
14
14
|
new (0, _chunkD7MOETL2js.ClientRequestInterceptor)(),
|
|
15
|
-
new (0,
|
|
15
|
+
new (0, _chunkF7BBA6FTjs.XMLHttpRequestInterceptor)()
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mswjs/interceptors",
|
|
3
3
|
"description": "Low-level HTTP/HTTPS/XHR/fetch request interception library.",
|
|
4
|
-
"version": "0.22.
|
|
4
|
+
"version": "0.22.7",
|
|
5
5
|
"main": "./lib/node/index.js",
|
|
6
6
|
"module": "./lib/node/index.mjs",
|
|
7
7
|
"types": "./lib/node/index.d.ts",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
},
|
|
53
53
|
"./presets/node": {
|
|
54
54
|
"browser": null,
|
|
55
|
-
"types": "./lib/node/
|
|
56
|
-
"require": "./lib/node/
|
|
57
|
-
"import": "./lib/node/
|
|
58
|
-
"default": "./lib/node/
|
|
55
|
+
"types": "./lib/node/presets/node.d.ts",
|
|
56
|
+
"require": "./lib/node/presets/node.js",
|
|
57
|
+
"import": "./lib/node/presets/node.mjs",
|
|
58
|
+
"default": "./lib/node/presets/node.js"
|
|
59
59
|
},
|
|
60
60
|
"./presets/browser": {
|
|
61
61
|
"browser": {
|
|
62
|
-
"types": "./lib/browser/
|
|
63
|
-
"require": "./lib/browser/
|
|
64
|
-
"import": "./lib/browser/
|
|
65
|
-
"default": "./lib/browser/
|
|
62
|
+
"types": "./lib/browser/presets/browser.d.ts",
|
|
63
|
+
"require": "./lib/browser/presets/browser.js",
|
|
64
|
+
"import": "./lib/browser/presets/browser.mjs",
|
|
65
|
+
"default": "./lib/browser/presets/browser.js"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
},
|
|
@@ -48,14 +48,7 @@ export class XMLHttpRequestController {
|
|
|
48
48
|
this.request = createProxy(initialRequest, {
|
|
49
49
|
setProperty: ([propertyName, nextValue], invoke) => {
|
|
50
50
|
switch (propertyName) {
|
|
51
|
-
case '
|
|
52
|
-
case 'onerror':
|
|
53
|
-
case 'onload':
|
|
54
|
-
case 'onloadend':
|
|
55
|
-
case 'onloadstart':
|
|
56
|
-
case 'onprogress':
|
|
57
|
-
case 'ontimeout':
|
|
58
|
-
case 'onreadystatechange': {
|
|
51
|
+
case 'ontimeout': {
|
|
59
52
|
const eventName = propertyName.slice(
|
|
60
53
|
2
|
|
61
54
|
) as keyof XMLHttpRequestEventTargetEventMap
|
|
@@ -66,6 +59,7 @@ export class XMLHttpRequestController {
|
|
|
66
59
|
* on events exclusively.
|
|
67
60
|
*/
|
|
68
61
|
this.request.addEventListener(eventName, nextValue as any)
|
|
62
|
+
|
|
69
63
|
return invoke()
|
|
70
64
|
}
|
|
71
65
|
|