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