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