@whitesev/utils 2.3.2 → 2.3.3

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/dist/index.cjs.js CHANGED
@@ -1755,6 +1755,8 @@ class Httpx {
1755
1755
  data: details.data || this.context.#defaultDetails.data,
1756
1756
  redirect: details.redirect || this.context.#defaultDetails.redirect,
1757
1757
  cookie: details.cookie || this.context.#defaultDetails.cookie,
1758
+ cookiePartition: details.cookiePartition ||
1759
+ this.context.#defaultDetails.cookiePartition,
1758
1760
  binary: details.binary || this.context.#defaultDetails.binary,
1759
1761
  nocache: details.nocache || this.context.#defaultDetails.nocache,
1760
1762
  revalidate: details.revalidate || this.context.#defaultDetails.revalidate,
@@ -1856,6 +1858,15 @@ class Httpx {
1856
1858
  else {
1857
1859
  result.fetchInit = details.fetchInit;
1858
1860
  }
1861
+ // 处理新的cookiePartition
1862
+ if (typeof result.cookiePartition === "object" &&
1863
+ result.cookiePartition != null) {
1864
+ if (Reflect.has(result.cookiePartition, "topLevelSite") &&
1865
+ typeof result.cookiePartition.topLevelSite !== "string") {
1866
+ // topLevelSite必须是字符串
1867
+ Reflect.deleteProperty(result.cookiePartition, "topLevelSite");
1868
+ }
1869
+ }
1859
1870
  return result;
1860
1871
  },
1861
1872
  /**
@@ -2345,6 +2356,7 @@ class Httpx {
2345
2356
  data: void 0,
2346
2357
  redirect: void 0,
2347
2358
  cookie: void 0,
2359
+ cookiePartition: void 0,
2348
2360
  binary: void 0,
2349
2361
  nocache: void 0,
2350
2362
  revalidate: void 0,
@@ -3928,7 +3940,7 @@ class Utils {
3928
3940
  this.windowApi = new WindowApi(option);
3929
3941
  }
3930
3942
  /** 版本号 */
3931
- version = "2024.9.10";
3943
+ version = "2024.9.28";
3932
3944
  addStyle(cssText) {
3933
3945
  if (typeof cssText !== "string") {
3934
3946
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");