mezon-js 2.14.18 → 2.14.20

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.
@@ -31682,12 +31682,6 @@ function isSet2(value) {
31682
31682
  function buildFetchOptions(method, options, bodyJson) {
31683
31683
  const fetchOptions = __spreadValues(__spreadValues({}, { method }), options);
31684
31684
  fetchOptions.headers = __spreadValues({}, options.headers);
31685
- if (typeof XMLHttpRequest !== "undefined") {
31686
- const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "withCredentials");
31687
- if (!(descriptor == null ? void 0 : descriptor.set)) {
31688
- fetchOptions.credentials = "cocos-ignore";
31689
- }
31690
- }
31691
31685
  if (!Object.keys(fetchOptions.headers).includes("Accept")) {
31692
31686
  fetchOptions.headers["Accept"] = "application/proto";
31693
31687
  }
@@ -31651,12 +31651,6 @@ function isSet2(value) {
31651
31651
  function buildFetchOptions(method, options, bodyJson) {
31652
31652
  const fetchOptions = __spreadValues(__spreadValues({}, { method }), options);
31653
31653
  fetchOptions.headers = __spreadValues({}, options.headers);
31654
- if (typeof XMLHttpRequest !== "undefined") {
31655
- const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "withCredentials");
31656
- if (!(descriptor == null ? void 0 : descriptor.set)) {
31657
- fetchOptions.credentials = "cocos-ignore";
31658
- }
31659
- }
31660
31654
  if (!Object.keys(fetchOptions.headers).includes("Accept")) {
31661
31655
  fetchOptions.headers["Accept"] = "application/proto";
31662
31656
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.14.18",
3
+ "version": "2.14.20",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/utils.ts CHANGED
@@ -5,16 +5,6 @@ export function buildFetchOptions(method: string, options: any, bodyJson: string
5
5
  const fetchOptions = {...{ method: method }, ...options};
6
6
  fetchOptions.headers = {...options.headers};
7
7
 
8
- if (typeof XMLHttpRequest !== "undefined") {
9
- const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "withCredentials");
10
-
11
- // in Cocos Creator, XMLHttpRequest.withCredentials is not writable, so make the fetch
12
- // polyfill avoid writing to it.
13
- if (!descriptor?.set) {
14
- fetchOptions.credentials = 'cocos-ignore'; // string value is arbitrary, cannot be 'omit' or 'include
15
- }
16
- }
17
-
18
8
  if(!Object.keys(fetchOptions.headers).includes("Accept")) {
19
9
  fetchOptions.headers["Accept"] = "application/proto";
20
10
  }
@@ -23,7 +13,7 @@ export function buildFetchOptions(method: string, options: any, bodyJson: string
23
13
  fetchOptions.headers["Content-Type"] = "application/proto";
24
14
  }
25
15
 
26
- Object.keys(fetchOptions.headers).forEach((key: string) => {
16
+ Object.keys(fetchOptions.headers).forEach((key: string) => {
27
17
  if (!fetchOptions.headers[key]) {
28
18
  delete fetchOptions.headers[key];
29
19
  }