mphttpx 2.6.0-beta.1 → 2.6.1

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.
@@ -4,8 +4,10 @@ var miniprogramXmlhttprequestShim = require('miniprogram-xmlhttprequest-shim');
4
4
  var fetchXhrShim = require('fetch-xhr-shim');
5
5
 
6
6
  const fetches = /*#__PURE__*/ function () {
7
+ // Mini Program requires explicit XHR assignment,
8
+ // otherwise the polyfill won't be picked up.
7
9
  fetchXhrShim.setXMLHttpRequestClass(miniprogramXmlhttprequestShim.XMLHttpRequest);
8
- return [fetchXhrShim.fetch, fetchXhrShim.fetchP];
10
+ return [fetchXhrShim.fetch /* global */, fetchXhrShim.fetchP /* polyfill */];
9
11
  }();
10
12
  const fetchE = /*#__PURE__*/ function () { return fetches[0]; }();
11
13
  const fetchPolyfill = /*#__PURE__*/ function () { return fetches[1]; }();
@@ -2,8 +2,10 @@ import { XMLHttpRequest } from 'miniprogram-xmlhttprequest-shim';
2
2
  import { setXMLHttpRequestClass, fetch, fetchP } from 'fetch-xhr-shim';
3
3
 
4
4
  const fetches = /*#__PURE__*/ function () {
5
+ // Mini Program requires explicit XHR assignment,
6
+ // otherwise the polyfill won't be picked up.
5
7
  setXMLHttpRequestClass(XMLHttpRequest);
6
- return [fetch, fetchP];
8
+ return [fetch /* global */, fetchP /* polyfill */];
7
9
  }();
8
10
  const fetchE = /*#__PURE__*/ function () { return fetches[0]; }();
9
11
  const fetchPolyfill = /*#__PURE__*/ function () { return fetches[1]; }();
@@ -2913,9 +2913,7 @@ var HeadersP = /*#__PURE__*/function (_Symbol$iterator, _Symbol$toStringTag) {
2913
2913
  key: "forEach",
2914
2914
  value: function forEach(callbackfn, thisArg) {
2915
2915
  checkArgsFn(arguments.length, 1, "forEach");
2916
- if (typeof callbackfn !== "function") {
2917
- throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");
2918
- }
2916
+ if (typeof callbackfn !== "function") throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");
2919
2917
  var dict = state$7(this).dict;
2920
2918
  var names = Object.getOwnPropertyNames(dict);
2921
2919
  for (var i = 0; i < names.length; ++i) {
@@ -4849,8 +4847,10 @@ var XMLHttpRequestE = /*#__PURE__*/function () {
4849
4847
  }();
4850
4848
 
4851
4849
  var fetches = /*#__PURE__*/function () {
4850
+ // Mini Program requires explicit XHR assignment,
4851
+ // otherwise the polyfill won't be picked up.
4852
4852
  setXMLHttpRequestClass(XMLHttpRequestE);
4853
- return [fetchE$1, fetchP];
4853
+ return [fetchE$1 /* global */, fetchP /* polyfill */];
4854
4854
  }();
4855
4855
  var fetchE = /*#__PURE__*/function () {
4856
4856
  return fetches[0];
@@ -2911,9 +2911,7 @@ var HeadersP = /*#__PURE__*/function (_Symbol$iterator, _Symbol$toStringTag) {
2911
2911
  key: "forEach",
2912
2912
  value: function forEach(callbackfn, thisArg) {
2913
2913
  checkArgsFn(arguments.length, 1, "forEach");
2914
- if (typeof callbackfn !== "function") {
2915
- throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");
2916
- }
2914
+ if (typeof callbackfn !== "function") throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");
2917
2915
  var dict = state$7(this).dict;
2918
2916
  var names = Object.getOwnPropertyNames(dict);
2919
2917
  for (var i = 0; i < names.length; ++i) {
@@ -4847,8 +4845,10 @@ var XMLHttpRequestE = /*#__PURE__*/function () {
4847
4845
  }();
4848
4846
 
4849
4847
  var fetches = /*#__PURE__*/function () {
4848
+ // Mini Program requires explicit XHR assignment,
4849
+ // otherwise the polyfill won't be picked up.
4850
4850
  setXMLHttpRequestClass(XMLHttpRequestE);
4851
- return [fetchE$1, fetchP];
4851
+ return [fetchE$1 /* global */, fetchP /* polyfill */];
4852
4852
  }();
4853
4853
  var fetchE = /*#__PURE__*/function () {
4854
4854
  return fetches[0];
@@ -2917,9 +2917,7 @@
2917
2917
  key: "forEach",
2918
2918
  value: function forEach(callbackfn, thisArg) {
2919
2919
  checkArgsFn(arguments.length, 1, "forEach");
2920
- if (typeof callbackfn !== "function") {
2921
- throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");
2922
- }
2920
+ if (typeof callbackfn !== "function") throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");
2923
2921
  var dict = state$7(this).dict;
2924
2922
  var names = Object.getOwnPropertyNames(dict);
2925
2923
  for (var i = 0; i < names.length; ++i) {
@@ -4853,8 +4851,10 @@
4853
4851
  }();
4854
4852
 
4855
4853
  var fetches = /*#__PURE__*/function () {
4854
+ // Mini Program requires explicit XHR assignment,
4855
+ // otherwise the polyfill won't be picked up.
4856
4856
  setXMLHttpRequestClass(XMLHttpRequestE);
4857
- return [fetchE$1, fetchP];
4857
+ return [fetchE$1 /* global */, fetchP /* polyfill */];
4858
4858
  }();
4859
4859
  var fetchE = /*#__PURE__*/function () {
4860
4860
  return fetches[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mphttpx",
3
- "version": "2.6.0-beta.1",
3
+ "version": "2.6.1",
4
4
  "license": "MIT",
5
5
  "author": "Xingzeng Bao",
6
6
  "homepage": "https://github.com/baoxingzeng/mphttpx",
@@ -46,10 +46,10 @@
46
46
  "WebSocket"
47
47
  ],
48
48
  "dependencies": {
49
- "fetch-xhr-shim": "^1.1.9-beta",
50
- "miniprogram-platform": "^1.1.9-beta",
51
- "miniprogram-websocket": "^1.1.9-beta.1",
52
- "miniprogram-xmlhttprequest-shim": "^1.1.9-beta"
49
+ "fetch-xhr-shim": "^1.2.0",
50
+ "miniprogram-platform": "^1.2.0",
51
+ "miniprogram-websocket": "^1.2.0",
52
+ "miniprogram-xmlhttprequest-shim": "^1.2.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@babel/core": "^7.29.7",