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