@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.
- package/dist/index.amd.js +16 -9
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +16 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +16 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +16 -9
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +16 -9
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +16 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/UtilsGMCookie.d.ts +3 -2
- package/dist/types/src/UtilsGMMenu.d.ts +4 -4
- package/package.json +3 -3
- package/src/ColorConversion.ts +6 -0
- package/src/UtilsGMCookie.ts +3 -2
- package/src/UtilsGMMenu.ts +7 -7
package/dist/index.system.js
CHANGED
|
@@ -82,6 +82,9 @@ System.register('Utils', [], (function (exports) {
|
|
|
82
82
|
if (typeof level !== "number") {
|
|
83
83
|
level = Number(level);
|
|
84
84
|
}
|
|
85
|
+
if (isNaN(level)) {
|
|
86
|
+
throw new TypeError(`输入错误的level:${level}`);
|
|
87
|
+
}
|
|
85
88
|
const rgbc = this.hexToRgb(color);
|
|
86
89
|
for (let index = 0; index < 3; index++) {
|
|
87
90
|
const rgbcItemValue = rgbc[index];
|
|
@@ -102,6 +105,9 @@ System.register('Utils', [], (function (exports) {
|
|
|
102
105
|
if (typeof level !== "number") {
|
|
103
106
|
level = Number(level);
|
|
104
107
|
}
|
|
108
|
+
if (isNaN(level)) {
|
|
109
|
+
throw new TypeError(`输入错误的level:${level}`);
|
|
110
|
+
}
|
|
105
111
|
const rgbc = this.hexToRgb(color);
|
|
106
112
|
for (let index = 0; index < 3; index++) {
|
|
107
113
|
const rgbcItemValue = Number(rgbc[index]);
|
|
@@ -585,7 +591,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
585
591
|
}
|
|
586
592
|
}
|
|
587
593
|
/**
|
|
588
|
-
*
|
|
594
|
+
* 获取多组Cookie
|
|
589
595
|
* @param option 配置
|
|
590
596
|
**/
|
|
591
597
|
getList(option) {
|
|
@@ -698,7 +704,8 @@ System.register('Utils', [], (function (exports) {
|
|
|
698
704
|
}
|
|
699
705
|
}
|
|
700
706
|
/**
|
|
701
|
-
* 解析cookie
|
|
707
|
+
* 解析cookie字符串,按`;`分割
|
|
708
|
+
*
|
|
702
709
|
* 例如:document.cookie
|
|
703
710
|
* @param cookieStr
|
|
704
711
|
*/
|
|
@@ -2115,31 +2122,31 @@ System.register('Utils', [], (function (exports) {
|
|
|
2115
2122
|
}
|
|
2116
2123
|
/**
|
|
2117
2124
|
* 设置当enable为true时默认显示在菜单中前面的emoji图标
|
|
2118
|
-
* @param emojiString
|
|
2125
|
+
* @param emojiString emoji字符串
|
|
2119
2126
|
*/
|
|
2120
2127
|
setEnableTrueEmoji(emojiString) {
|
|
2121
2128
|
if (typeof emojiString !== "string") {
|
|
2122
|
-
throw new
|
|
2129
|
+
throw new TypeError("参数emojiString必须是string类型");
|
|
2123
2130
|
}
|
|
2124
2131
|
this.MenuHandle.$emoji.success = emojiString;
|
|
2125
2132
|
}
|
|
2126
2133
|
/**
|
|
2127
2134
|
* 设置当enable为false时默认显示在菜单中前面的emoji图标
|
|
2128
|
-
* @param emojiString
|
|
2135
|
+
* @param emojiString emoji字符串
|
|
2129
2136
|
*/
|
|
2130
2137
|
setEnableFalseEmoji(emojiString) {
|
|
2131
2138
|
if (typeof emojiString !== "string") {
|
|
2132
|
-
throw new
|
|
2139
|
+
throw new TypeError("参数emojiString必须是string类型");
|
|
2133
2140
|
}
|
|
2134
2141
|
this.MenuHandle.$emoji.error = emojiString;
|
|
2135
2142
|
}
|
|
2136
2143
|
/**
|
|
2137
2144
|
* 设置本地存储的菜单外部的键名
|
|
2138
|
-
* @param keyName
|
|
2145
|
+
* @param keyName 键名
|
|
2139
2146
|
*/
|
|
2140
2147
|
setLocalStorageKeyName(keyName) {
|
|
2141
2148
|
if (typeof keyName !== "string") {
|
|
2142
|
-
throw new
|
|
2149
|
+
throw new TypeError("参数keyName必须是string类型");
|
|
2143
2150
|
}
|
|
2144
2151
|
this.MenuHandle.$data.key = keyName;
|
|
2145
2152
|
}
|
|
@@ -5488,7 +5495,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
5488
5495
|
}
|
|
5489
5496
|
const domUtils = new DOMUtils();
|
|
5490
5497
|
|
|
5491
|
-
const version = "2.9.
|
|
5498
|
+
const version = "2.9.6";
|
|
5492
5499
|
|
|
5493
5500
|
class Utils {
|
|
5494
5501
|
windowApi;
|