@whitesev/utils 2.5.4 → 2.5.6

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.esm.js CHANGED
@@ -435,6 +435,27 @@ class UtilsGMCookie {
435
435
  }
436
436
  }
437
437
  }
438
+ /**
439
+ * 解析cookie字符串
440
+ * 例如:document.cookie
441
+ * @param cookieStr
442
+ */
443
+ parseCookie(cookieStr) {
444
+ let cookies = cookieStr.split(";");
445
+ let result = [];
446
+ for (const cookieItem of cookies) {
447
+ let item = cookieItem.trim();
448
+ let itemSplit = item.split("=");
449
+ let itemName = itemSplit[0];
450
+ itemSplit.splice(0, 1);
451
+ let itemValue = decodeURIComponent(itemSplit.join(""));
452
+ result.push({
453
+ key: itemName,
454
+ value: itemValue,
455
+ });
456
+ }
457
+ return result;
458
+ }
438
459
  }
439
460
 
440
461
  // @name ajaxHooker
@@ -4118,7 +4139,7 @@ class Utils {
4118
4139
  this.windowApi = new WindowApi(option);
4119
4140
  }
4120
4141
  /** 版本号 */
4121
- version = "2024.12.3";
4142
+ version = "2024.12.25";
4122
4143
  addStyle(cssText) {
4123
4144
  if (typeof cssText !== "string") {
4124
4145
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");
@@ -4836,6 +4857,8 @@ class Utils {
4836
4857
  getMaxZIndexNodeInfo(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
4837
4858
  deviation = Number.isNaN(deviation) ? 1 : deviation;
4838
4859
  const UtilsContext = this;
4860
+ // 最大值 2147483647
4861
+ // const maxZIndex = Math.pow(2, 31) - 1;
4839
4862
  // 比较值 2000000000
4840
4863
  const maxZIndexCompare = 2 * Math.pow(10, 9);
4841
4864
  // 当前页面最大的z-index