@whitesev/utils 2.9.5 → 2.9.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.
@@ -80,6 +80,9 @@ var Utils = (function () {
80
80
  if (typeof level !== "number") {
81
81
  level = Number(level);
82
82
  }
83
+ if (isNaN(level)) {
84
+ throw new TypeError(`输入错误的level:${level}`);
85
+ }
83
86
  const rgbc = this.hexToRgb(color);
84
87
  for (let index = 0; index < 3; index++) {
85
88
  const rgbcItemValue = rgbc[index];
@@ -100,6 +103,9 @@ var Utils = (function () {
100
103
  if (typeof level !== "number") {
101
104
  level = Number(level);
102
105
  }
106
+ if (isNaN(level)) {
107
+ throw new TypeError(`输入错误的level:${level}`);
108
+ }
103
109
  const rgbc = this.hexToRgb(color);
104
110
  for (let index = 0; index < 3; index++) {
105
111
  const rgbcItemValue = Number(rgbc[index]);
@@ -583,7 +589,7 @@ var Utils = (function () {
583
589
  }
584
590
  }
585
591
  /**
586
- * 获取多组Cookie
592
+ * 获取多组Cookie
587
593
  * @param option 配置
588
594
  **/
589
595
  getList(option) {
@@ -696,7 +702,8 @@ var Utils = (function () {
696
702
  }
697
703
  }
698
704
  /**
699
- * 解析cookie字符串
705
+ * 解析cookie字符串,按`;`分割
706
+ *
700
707
  * 例如:document.cookie
701
708
  * @param cookieStr
702
709
  */
@@ -2113,31 +2120,31 @@ var Utils = (function () {
2113
2120
  }
2114
2121
  /**
2115
2122
  * 设置当enable为true时默认显示在菜单中前面的emoji图标
2116
- * @param emojiString
2123
+ * @param emojiString emoji字符串
2117
2124
  */
2118
2125
  setEnableTrueEmoji(emojiString) {
2119
2126
  if (typeof emojiString !== "string") {
2120
- throw new Error("参数emojiString必须是string类型");
2127
+ throw new TypeError("参数emojiString必须是string类型");
2121
2128
  }
2122
2129
  this.MenuHandle.$emoji.success = emojiString;
2123
2130
  }
2124
2131
  /**
2125
2132
  * 设置当enable为false时默认显示在菜单中前面的emoji图标
2126
- * @param emojiString
2133
+ * @param emojiString emoji字符串
2127
2134
  */
2128
2135
  setEnableFalseEmoji(emojiString) {
2129
2136
  if (typeof emojiString !== "string") {
2130
- throw new Error("参数emojiString必须是string类型");
2137
+ throw new TypeError("参数emojiString必须是string类型");
2131
2138
  }
2132
2139
  this.MenuHandle.$emoji.error = emojiString;
2133
2140
  }
2134
2141
  /**
2135
2142
  * 设置本地存储的菜单外部的键名
2136
- * @param keyName
2143
+ * @param keyName 键名
2137
2144
  */
2138
2145
  setLocalStorageKeyName(keyName) {
2139
2146
  if (typeof keyName !== "string") {
2140
- throw new Error("参数keyName必须是string类型");
2147
+ throw new TypeError("参数keyName必须是string类型");
2141
2148
  }
2142
2149
  this.MenuHandle.$data.key = keyName;
2143
2150
  }
@@ -5486,7 +5493,7 @@ var Utils = (function () {
5486
5493
  }
5487
5494
  const domUtils = new DOMUtils();
5488
5495
 
5489
- const version = "2.9.5";
5496
+ const version = "2.9.6";
5490
5497
 
5491
5498
  class Utils {
5492
5499
  windowApi;