@mswjs/interceptors 0.17.1 → 0.17.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/README.md CHANGED
@@ -9,7 +9,7 @@ Low-level HTTP/HTTPS/XHR/fetch request interception library.
9
9
  - `http.get`/`http.request`
10
10
  - `https.get`/`https.request`
11
11
  - `XMLHttpRequest`
12
- - `fetch`
12
+ - `window.fetch`
13
13
  - Any third-party libraries that use the modules above (i.e. `axios`, `request`, `node-fetch`, `supertest`, etc.)
14
14
 
15
15
  ## Motivation
@@ -145,7 +145,10 @@ import { XMLHttpRequestInterceptor } from '@mswjs/interceptors/lib/interceptors/
145
145
 
146
146
  const interceptor = BatchInterceptor({
147
147
  name: 'my-interceptor',
148
- interceptors: [ClientRequestInterceptor, XMLHttpRequestInterceptor],
148
+ interceptors: [
149
+ new ClientRequestInterceptor(),
150
+ new XMLHttpRequestInterceptor(),
151
+ ],
149
152
  })
150
153
 
151
154
  // This "request" listener will be called on both
package/lib/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './BatchInterceptor';
4
4
  export * from './IsomorphicRequest';
5
5
  export * from './InteractiveIsomorphicRequest';
6
6
  export { getCleanUrl } from './utils/getCleanUrl';
7
+ export { encodeBuffer, decodeBuffer } from './utils/bufferUtils';
package/lib/index.js CHANGED
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.getCleanUrl = void 0;
13
+ exports.decodeBuffer = exports.encodeBuffer = exports.getCleanUrl = void 0;
14
14
  __exportStar(require("./glossary"), exports);
15
15
  __exportStar(require("./Interceptor"), exports);
16
16
  __exportStar(require("./BatchInterceptor"), exports);
@@ -19,4 +19,7 @@ __exportStar(require("./InteractiveIsomorphicRequest"), exports);
19
19
  /* Utils */
20
20
  var getCleanUrl_1 = require("./utils/getCleanUrl");
21
21
  Object.defineProperty(exports, "getCleanUrl", { enumerable: true, get: function () { return getCleanUrl_1.getCleanUrl; } });
22
+ var bufferUtils_1 = require("./utils/bufferUtils");
23
+ Object.defineProperty(exports, "encodeBuffer", { enumerable: true, get: function () { return bufferUtils_1.encodeBuffer; } });
24
+ Object.defineProperty(exports, "decodeBuffer", { enumerable: true, get: function () { return bufferUtils_1.decodeBuffer; } });
22
25
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,gDAA6B;AAC7B,qDAAkC;AAClC,sDAAmC;AACnC,iEAA8C;AAE9C,WAAW;AACX,mDAAiD;AAAxC,0GAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,gDAA6B;AAC7B,qDAAkC;AAClC,sDAAmC;AACnC,iEAA8C;AAE9C,WAAW;AACX,mDAAiD;AAAxC,0GAAA,WAAW,OAAA;AACpB,mDAAgE;AAAvD,2GAAA,YAAY,OAAA;AAAE,2GAAA,YAAY,OAAA"}
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.17.1",
4
+ "version": "0.17.2",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "author": "Artem Zakharchenko",
package/src/index.ts CHANGED
@@ -6,3 +6,4 @@ export * from './InteractiveIsomorphicRequest'
6
6
 
7
7
  /* Utils */
8
8
  export { getCleanUrl } from './utils/getCleanUrl'
9
+ export { encodeBuffer, decodeBuffer } from './utils/bufferUtils'