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