tools-min-ns 1.5.2

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.
Files changed (162) hide show
  1. package/README.md +85 -0
  2. package/esm/array/ArrayUtil.d.ts +109 -0
  3. package/esm/array/ArrayUtil.js +242 -0
  4. package/esm/array/TreeUtil.d.ts +151 -0
  5. package/esm/array/TreeUtil.js +412 -0
  6. package/esm/base/BaseUtil.d.ts +91 -0
  7. package/esm/base/BaseUtil.js +148 -0
  8. package/esm/browser/BrowserUtil.d.ts +57 -0
  9. package/esm/browser/BrowserUtil.js +337 -0
  10. package/esm/browser/fingerprint.d.ts +120 -0
  11. package/esm/browser/fingerprint.js +1469 -0
  12. package/esm/check/CheckUtil.d.ts +110 -0
  13. package/esm/check/CheckUtil.js +465 -0
  14. package/esm/common.d.ts +43 -0
  15. package/esm/common.js +44 -0
  16. package/esm/config.d.ts +7 -0
  17. package/esm/config.js +7 -0
  18. package/esm/cookie/CookieUtil.d.ts +56 -0
  19. package/esm/cookie/CookieUtil.js +12 -0
  20. package/esm/cookie/cookie.d.ts +2 -0
  21. package/esm/cookie/cookie.js +104 -0
  22. package/esm/date/DateUtil.d.ts +261 -0
  23. package/esm/date/DateUtil.js +763 -0
  24. package/esm/env/EnvUtil.d.ts +27 -0
  25. package/esm/env/EnvUtil.js +29 -0
  26. package/esm/env/env.d.ts +41 -0
  27. package/esm/env/env.js +106 -0
  28. package/esm/func/FunctionUtil.d.ts +77 -0
  29. package/esm/func/FunctionUtil.js +215 -0
  30. package/esm/index.d.ts +19 -0
  31. package/esm/index.js +19 -0
  32. package/esm/number/NumberUtil.d.ts +96 -0
  33. package/esm/number/NumberUtil.js +256 -0
  34. package/esm/object/ObjectUtil.d.ts +41 -0
  35. package/esm/object/ObjectUtil.js +158 -0
  36. package/esm/pwd/PasswordUtil.d.ts +33 -0
  37. package/esm/pwd/PasswordUtil.js +68 -0
  38. package/esm/pwd/crypto.d.ts +6 -0
  39. package/esm/pwd/crypto.js +1824 -0
  40. package/esm/request/RequestUtil.d.ts +52 -0
  41. package/esm/request/RequestUtil.js +53 -0
  42. package/esm/request/jsonp.d.ts +18 -0
  43. package/esm/request/jsonp.js +73 -0
  44. package/esm/request/mgop/env.d.ts +7 -0
  45. package/esm/request/mgop/env.js +15 -0
  46. package/esm/request/mgop/index.d.ts +3 -0
  47. package/esm/request/mgop/index.js +276 -0
  48. package/esm/request/mgop/responseCode.d.ts +20 -0
  49. package/esm/request/mgop/responseCode.js +37 -0
  50. package/esm/request/mgop/type.d.ts +34 -0
  51. package/esm/request/mgop/type.js +1 -0
  52. package/esm/request/uniRquest/index.d.ts +2 -0
  53. package/esm/request/uniRquest/index.js +66 -0
  54. package/esm/request/uniRquest/miniapp/index.d.ts +2 -0
  55. package/esm/request/uniRquest/miniapp/index.js +29 -0
  56. package/esm/request/uniRquest/miniapp-bytedance/index.d.ts +2 -0
  57. package/esm/request/uniRquest/miniapp-bytedance/index.js +41 -0
  58. package/esm/request/uniRquest/types.d.ts +65 -0
  59. package/esm/request/uniRquest/types.js +36 -0
  60. package/esm/request/uniRquest/utils.d.ts +9 -0
  61. package/esm/request/uniRquest/utils.js +69 -0
  62. package/esm/request/uniRquest/web/index.d.ts +2 -0
  63. package/esm/request/uniRquest/web/index.js +85 -0
  64. package/esm/request/uniRquest/wechat-miniprogram/index.d.ts +2 -0
  65. package/esm/request/uniRquest/wechat-miniprogram/index.js +41 -0
  66. package/esm/request/uniRquest/weex/index.d.ts +14 -0
  67. package/esm/request/uniRquest/weex/index.js +59 -0
  68. package/esm/storage/StorageUtil.d.ts +19 -0
  69. package/esm/storage/StorageUtil.js +75 -0
  70. package/esm/string/StringUtil.d.ts +392 -0
  71. package/esm/string/StringUtil.js +556 -0
  72. package/esm/system/SystemUtil.d.ts +46 -0
  73. package/esm/system/SystemUtil.js +122 -0
  74. package/esm/transfer/MapTransferUtil.d.ts +54 -0
  75. package/esm/transfer/MapTransferUtil.js +160 -0
  76. package/esm/transfer/TransferUtil.d.ts +98 -0
  77. package/esm/transfer/TransferUtil.js +323 -0
  78. package/esm/types.d.ts +25 -0
  79. package/esm/types.js +1 -0
  80. package/esm/url/UrlUtil.d.ts +30 -0
  81. package/esm/url/UrlUtil.js +85 -0
  82. package/lib/array/ArrayUtil.d.ts +109 -0
  83. package/lib/array/ArrayUtil.js +252 -0
  84. package/lib/array/TreeUtil.d.ts +151 -0
  85. package/lib/array/TreeUtil.js +422 -0
  86. package/lib/base/BaseUtil.d.ts +91 -0
  87. package/lib/base/BaseUtil.js +153 -0
  88. package/lib/browser/BrowserUtil.d.ts +57 -0
  89. package/lib/browser/BrowserUtil.js +347 -0
  90. package/lib/browser/fingerprint.d.ts +120 -0
  91. package/lib/browser/fingerprint.js +1500 -0
  92. package/lib/check/CheckUtil.d.ts +110 -0
  93. package/lib/check/CheckUtil.js +475 -0
  94. package/lib/common.d.ts +43 -0
  95. package/lib/common.js +50 -0
  96. package/lib/config.d.ts +7 -0
  97. package/lib/config.js +12 -0
  98. package/lib/cookie/CookieUtil.d.ts +56 -0
  99. package/lib/cookie/CookieUtil.js +22 -0
  100. package/lib/cookie/cookie.d.ts +2 -0
  101. package/lib/cookie/cookie.js +109 -0
  102. package/lib/date/DateUtil.d.ts +261 -0
  103. package/lib/date/DateUtil.js +773 -0
  104. package/lib/env/EnvUtil.d.ts +27 -0
  105. package/lib/env/EnvUtil.js +39 -0
  106. package/lib/env/env.d.ts +41 -0
  107. package/lib/env/env.js +112 -0
  108. package/lib/func/FunctionUtil.d.ts +77 -0
  109. package/lib/func/FunctionUtil.js +225 -0
  110. package/lib/index.d.ts +19 -0
  111. package/lib/index.js +144 -0
  112. package/lib/number/NumberUtil.d.ts +96 -0
  113. package/lib/number/NumberUtil.js +266 -0
  114. package/lib/object/ObjectUtil.d.ts +41 -0
  115. package/lib/object/ObjectUtil.js +168 -0
  116. package/lib/pwd/PasswordUtil.d.ts +33 -0
  117. package/lib/pwd/PasswordUtil.js +78 -0
  118. package/lib/pwd/crypto.d.ts +6 -0
  119. package/lib/pwd/crypto.js +1829 -0
  120. package/lib/request/RequestUtil.d.ts +52 -0
  121. package/lib/request/RequestUtil.js +94 -0
  122. package/lib/request/jsonp.d.ts +18 -0
  123. package/lib/request/jsonp.js +80 -0
  124. package/lib/request/mgop/env.d.ts +7 -0
  125. package/lib/request/mgop/env.js +21 -0
  126. package/lib/request/mgop/index.d.ts +3 -0
  127. package/lib/request/mgop/index.js +289 -0
  128. package/lib/request/mgop/responseCode.d.ts +20 -0
  129. package/lib/request/mgop/responseCode.js +42 -0
  130. package/lib/request/mgop/type.d.ts +34 -0
  131. package/lib/request/mgop/type.js +5 -0
  132. package/lib/request/uniRquest/index.d.ts +2 -0
  133. package/lib/request/uniRquest/index.js +77 -0
  134. package/lib/request/uniRquest/miniapp/index.d.ts +2 -0
  135. package/lib/request/uniRquest/miniapp/index.js +35 -0
  136. package/lib/request/uniRquest/miniapp-bytedance/index.d.ts +2 -0
  137. package/lib/request/uniRquest/miniapp-bytedance/index.js +47 -0
  138. package/lib/request/uniRquest/types.d.ts +65 -0
  139. package/lib/request/uniRquest/types.js +42 -0
  140. package/lib/request/uniRquest/utils.d.ts +9 -0
  141. package/lib/request/uniRquest/utils.js +83 -0
  142. package/lib/request/uniRquest/web/index.d.ts +2 -0
  143. package/lib/request/uniRquest/web/index.js +91 -0
  144. package/lib/request/uniRquest/wechat-miniprogram/index.d.ts +2 -0
  145. package/lib/request/uniRquest/wechat-miniprogram/index.js +47 -0
  146. package/lib/request/uniRquest/weex/index.d.ts +14 -0
  147. package/lib/request/uniRquest/weex/index.js +65 -0
  148. package/lib/storage/StorageUtil.d.ts +19 -0
  149. package/lib/storage/StorageUtil.js +85 -0
  150. package/lib/string/StringUtil.d.ts +392 -0
  151. package/lib/string/StringUtil.js +566 -0
  152. package/lib/system/SystemUtil.d.ts +46 -0
  153. package/lib/system/SystemUtil.js +132 -0
  154. package/lib/transfer/MapTransferUtil.d.ts +54 -0
  155. package/lib/transfer/MapTransferUtil.js +165 -0
  156. package/lib/transfer/TransferUtil.d.ts +98 -0
  157. package/lib/transfer/TransferUtil.js +333 -0
  158. package/lib/types.d.ts +25 -0
  159. package/lib/types.js +5 -0
  160. package/lib/url/UrlUtil.d.ts +30 -0
  161. package/lib/url/UrlUtil.js +95 -0
  162. package/package.json +56 -0
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ var __read = this && this.__read || function (o, n) {
4
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5
+ if (!m) return o;
6
+ var i = m.call(o),
7
+ r,
8
+ ar = [],
9
+ e;
10
+ try {
11
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
12
+ } catch (error) {
13
+ e = {
14
+ error: error
15
+ };
16
+ } finally {
17
+ try {
18
+ if (r && !r.done && (m = i["return"])) m.call(i);
19
+ } finally {
20
+ if (e) throw e.error;
21
+ }
22
+ }
23
+ return ar;
24
+ };
25
+ var __importDefault = this && this.__importDefault || function (mod) {
26
+ return mod && mod.__esModule ? mod : {
27
+ "default": mod
28
+ };
29
+ };
30
+ Object.defineProperty(exports, "__esModule", {
31
+ value: true
32
+ });
33
+ var config_1 = __importDefault(require("../config"));
34
+ var StorageUtil;
35
+ (function (StorageUtil) {
36
+ function setItem(name, data, opts) {
37
+ var cacheType = (opts === null || opts === void 0 ? void 0 : opts.type) || config_1.default.cacheType;
38
+ if (name && data !== undefined) window["".concat(cacheType, "Storage")].setItem((opts === null || opts === void 0 ? void 0 : opts.itemName) || "".concat(config_1.default.title).concat(name), JSON.stringify(data));
39
+ }
40
+ StorageUtil.setItem = setItem;
41
+ function getItem(name, opts) {
42
+ var cacheType = (opts === null || opts === void 0 ? void 0 : opts.type) || config_1.default.cacheType;
43
+ var item = window["".concat(cacheType, "Storage")].getItem((opts === null || opts === void 0 ? void 0 : opts.itemName) || "".concat(config_1.default.title).concat(name));
44
+ try {
45
+ return JSON.parse(item);
46
+ } catch (error) {
47
+ return item;
48
+ }
49
+ }
50
+ StorageUtil.getItem = getItem;
51
+ function removeItem(name, opts) {
52
+ var cacheType = (opts === null || opts === void 0 ? void 0 : opts.type) || config_1.default.cacheType;
53
+ if (name) window["".concat(cacheType, "Storage")].removeItem((opts === null || opts === void 0 ? void 0 : opts.itemName) || "".concat(config_1.default.title).concat(name));
54
+ }
55
+ StorageUtil.removeItem = removeItem;
56
+ function clear(opts) {
57
+ var cacheType = (opts === null || opts === void 0 ? void 0 : opts.type) || config_1.default.cacheType;
58
+ window["".concat(cacheType, "Storage")].clear();
59
+ }
60
+ StorageUtil.clear = clear;
61
+ function clearTitle(opts) {
62
+ var cacheType = (opts === null || opts === void 0 ? void 0 : opts.type) || config_1.default.cacheType;
63
+ Object.entries(window["".concat(cacheType, "Storage")]).forEach(function (_a) {
64
+ var _b = __read(_a, 1),
65
+ k = _b[0];
66
+ if (k.includes(config_1.default.title)) window["".concat(cacheType, "Storage")].removeItem(k);
67
+ });
68
+ }
69
+ StorageUtil.clearTitle = clearTitle;
70
+ /**
71
+ * 设置全局缓存前缀
72
+ * @param str 缓存前缀
73
+ */
74
+ StorageUtil.setGlobalTitle = function (str) {
75
+ config_1.default.title = str;
76
+ };
77
+ /**
78
+ * 设置全局缓存类型
79
+ * @param type "session" | "local"
80
+ */
81
+ StorageUtil.setGlobalCacheType = function (type) {
82
+ config_1.default.cacheType = type;
83
+ };
84
+ })(StorageUtil || (StorageUtil = {}));
85
+ exports.default = StorageUtil;
@@ -0,0 +1,392 @@
1
+ declare namespace StringUtil {
2
+ /**
3
+ * 判断字符串是否不为空
4
+ * @param {String} input 输入字符串,如'我是测试的字符串'
5
+ * @example
6
+ * isNotEmpty('我是测试的字符串'); => true
7
+ * isNotEmpty(''); => false
8
+ */
9
+ const isNotEmpty: (input: string) => boolean;
10
+ /**
11
+ * 将字符串去除空格
12
+ * @param {string} input 输入字符串,如'我是测 试的字符串'
13
+ * @returns {string} 去除空格后的字符串
14
+ * @example
15
+ * trim(' 测试字符串 '); => 测试字符串
16
+ * trim('我是测 试的字符串'); => 我是测试的字符串
17
+ */
18
+ const trim: (input: string) => string;
19
+ /**
20
+ * 判断字符串是否以某个字符串开头
21
+ * @param {string} input 输入字符串,如' abcdefg'
22
+ * @param {string} prefix 输入字符串,如'ab'
23
+ * @example
24
+ * startsWith('abcdefg','ab'); => true
25
+ * startsWith('abcdefg','bc'); => false
26
+ * startsWith('abcdefg','a'); => true
27
+ */
28
+ const startsWith: (input: string, prefix: string) => boolean;
29
+ /**
30
+ * 判断字符串是否以某个字符串结束
31
+ * @param {String} input 输入字符串,如' abcdefg '
32
+ * @param {string} suffix 输入字符串,如'fg'
33
+ * @examplec
34
+ * endsWith('abcdefg', 'fg'); => true
35
+ * endsWith('abcdefg', 'ef'); => false
36
+ * endsWith('abcdefg', 'g'); => true
37
+ */
38
+ const endsWith: (input: string, suffix: string) => boolean;
39
+ /**
40
+ * 判断字符串是否包含某个字符串
41
+ * @param {String} input 输入字符串,如'abcdefg'
42
+ * @param {string} searchSeq 输入字符串,如'abc'
43
+ * @example
44
+ * contains('abcdefg', 'abc'); => true
45
+ * contains('abcdefg', 'gh'); => false
46
+ * contains('abcdefg', 'a'); => true
47
+ */
48
+ const contains: (input: string, searchSeq: string) => boolean;
49
+ /**
50
+ * 忽略大小写判断两个字符串是否相等
51
+ * @param {String} input1 输入字符串,如'equalsIgnoreCasE',
52
+ * @param {String} input2 输入字符串,如'equalsIgnoreCase'
53
+ * @example
54
+ * equalsIgnoreCase('equalsIgnoreCasE', 'equalsIgnoreCase'); => true
55
+ * equalsIgnoreCase('equals ', 'equalsIgnoreCase'); => false
56
+ */
57
+ const equalsIgnoreCase: (input1: string, input2: string) => boolean;
58
+ /**
59
+ * 判断字符串是否含有空格
60
+ * @param {String} input 输入字符串,如'我是 测试 的 字符串'
61
+ * @example
62
+ * containsWhitespace('我是 测试 的 字符串 '); => true
63
+ * containsWhitespace('我是测试的字符串'); => false
64
+ * containsWhitespace(' 我是测试的字符串 '); => true
65
+ */
66
+ const containsWhitespace: (input: string) => boolean;
67
+ /**
68
+ * 按指定数量生成给定字符串字符
69
+ * @param {string|number} ch 输入字符串,如'我是测试的字符串', 或 输入数字如 220022
70
+ * @param {number} repeatTimes 输入数字,如 '6'
71
+ * @returns {string} 指定数量的给定字符串
72
+ * @example
73
+ * repeat('AB ',6); => 'AB AB AB AB AB AB '
74
+ * repeat('C D',3); => 'C DC DC D'
75
+ * repeat('20', 3); => '202020'
76
+ */
77
+ const repeat: (ch: string | number, repeatTimes: number) => string;
78
+ /**
79
+ * 去除字符串中的空格
80
+ * @param {string} input 输入字符串,如'我是 测试 的 字符串 '
81
+ * @returns {string} 去除空格后的字符串
82
+ * @example
83
+ * deleteWhitespace('我是 测试 的 字符串 '); => '我是测试的字符串'
84
+ * deleteWhitespace(''); => ''
85
+ */
86
+ const deleteWhitespace: (input: string) => string;
87
+ /**
88
+ * 将给定字符串进行右侧填充
89
+ * @param {string|number} input 输入字符串
90
+ * @param {number} size 输入数量
91
+ * @param {string|number } padStr 输入填充字符
92
+ * @example
93
+ * rightPad(2222, 1, 33); => '222233'
94
+ * rightPad('我是测试的字符串', 2, '--'); => '我是测试的字符串----'
95
+ */
96
+ const rightPad: (input: string | number, size: number, padStr: number | string) => string;
97
+ /**
98
+ * 将给定字符进行左侧填充
99
+ * @param {string|number} input 输入字符串
100
+ * @param {number} size 输入数量
101
+ * @param {string|number} padStr 输入填充字符
102
+ * @returns {string} 左侧填充后的字符串
103
+ * @example
104
+ * leftPad('我是测试的字符串', 2, '--'); => '----我是测试的字符串'
105
+ * leftPad(2222, 2, 3); => '332222'
106
+ */
107
+ const leftPad: (input: string | number, size: number, padStr: number | string) => string;
108
+ /**
109
+ * 将字符串首字母转大写
110
+ * @param {string} input 输入字符串
111
+ * @example
112
+ * capitalize('admin'); => 'Admin'
113
+ * capitalize('capitalize'); => 'Capitalize'
114
+ */
115
+ const capitalize: (input: string) => string;
116
+ /**
117
+ * 将字符串首字母转小写
118
+ * @param {string} input 输入字符串
119
+ * @example
120
+ * unCapitalize('Capitalize'); => 'capitalize'
121
+ * unCapitalize('SetTimeout'); => 'setTimeout'
122
+ */
123
+ const unCapitalize: (input: string) => string;
124
+ /**
125
+ * 将字符串中的字母大写转小写,小写转大写
126
+ * @param {string} input 输入字符串
127
+ * @example
128
+ * swapCase('aBcde'); => 'AbCDE'
129
+ * swapCase('ABCDe'); => 'abcdE'
130
+ */
131
+ const swapCase: (input: string) => string;
132
+ /**
133
+ * 统计含有的子字符串的个数
134
+ * @param {string} input 输入字符串
135
+ * @param {string} sub 输入子字符串
136
+ * @example
137
+ * countMatches('dabddadb', 'da'); => 2
138
+ * countMatches('abcdeabcdeabcde','ab'); => 3
139
+ */
140
+ const countMatches: (input: string, sub: string) => number;
141
+ /**
142
+ * 判断字符串是否为字母
143
+ * @param {string} input 输入字符串
144
+ * @example
145
+ * isAlpha('abce测试'); => false
146
+ * isAlpha('abcdeabcdeabcde'); => true
147
+ */
148
+ const isAlpha: (input: string) => boolean;
149
+ /**
150
+ * 判断字符串是否为字母、空格
151
+ * @param {string} input 输入字符串
152
+ * @example
153
+ * isAlphaSpace(' abc 测试 '); => false
154
+ * isAlphaSpace('abcd eabc deab cde'); => true
155
+ */
156
+ const isAlphaSpace: (input: string) => boolean;
157
+ /**
158
+ * 判断字符串是否为字母、数字
159
+ * @param {string} input 输入字符串
160
+ * @example
161
+ * isAlphanumeric('abcd串abcd'); => false
162
+ * isAlphanumeric('22abcdeabcdeabcde22'); => true
163
+ */
164
+ const isAlphanumeric: (input: string) => boolean;
165
+ /**
166
+ * 判断字符串是否为字母、数字和空格
167
+ * @param {string} input 输入字符串
168
+ * @example
169
+ * isAlphanumericSpace('我是测试的 222字符串'); => false
170
+ * isAlphanumericSpace('22abcde abcde abcde 22'); => true
171
+ */
172
+ const isAlphanumericSpace: (input: string) => boolean;
173
+ /**
174
+ * 判断字符串是否为数字
175
+ * @param {string} input 输入数字
176
+ * @example
177
+ * isNumeric('我是测试的 字符串'); => false
178
+ * isNumeric(220022); => true
179
+ */
180
+ const isNumeric: (input: string) => boolean;
181
+ /**
182
+ * 判断字符串是否为小数
183
+ * @param {string} input 输入数字
184
+ * @example
185
+ * isDecimal('220022'); => false
186
+ * isDecimal(22.0022); => true
187
+ */
188
+ const isDecimal: (input: string) => boolean;
189
+ /**
190
+ * 判断字符串是否为负小数
191
+ * @param {number} input 输入数字
192
+ * @example
193
+ * isNegativeDecimal('22.0022'); => false
194
+ * isNegativeDecimal('-22.0022'); => true
195
+ */
196
+ const isNegativeDecimal: (input: string) => boolean;
197
+ /**
198
+ * 判断字符串是否为正小数
199
+ * @param {string} input 输入数字
200
+ * @example
201
+ * isPositiveDecimal('22.0022'); => true
202
+ * isPositiveDecimal('-22.0022'); => false
203
+ */
204
+ const isPositiveDecimal: (input: string) => boolean;
205
+ /**
206
+ * 判断字符串是否为整数
207
+ * @param {string} input 输入数字
208
+ * @example
209
+ * isInteger('-220022'); => true
210
+ * isInteger('22.0022'); => false
211
+ */
212
+ const isInteger: (input: string) => boolean;
213
+ /**
214
+ * 判断字符串是否为正整数
215
+ * @param {string} input 输入数字
216
+ * @example
217
+ * isPositiveInteger('220022'); => true
218
+ * isPositiveInteger('-22.22'); => false
219
+ */
220
+ const isPositiveInteger: (input: string) => boolean;
221
+ /**
222
+ * 判断字符串是否为负整数
223
+ * @param {string} input 输入数字
224
+ * @example
225
+ * isNegativeInteger('-220022'); => true
226
+ * isNegativeInteger('22.22'); => false
227
+ */
228
+ const isNegativeInteger: (input: string) => boolean;
229
+ /**
230
+ * 判断字符串是否为数字、空格
231
+ * @param {string} input 输入字符串
232
+ * @example
233
+ * isNumericSpace('2 2 0 0 2 2'); => true
234
+ * isNumericSpace('2222aa'); => false
235
+ */
236
+ const isNumericSpace: (input: string) => boolean;
237
+ /**
238
+ * 判断字符串是否为空格
239
+ * @param {string} input 输入字符串
240
+ * @example
241
+ * isWhitespace(' '); => true
242
+ * isWhitespace('22.22'); => false
243
+ */
244
+ const isWhitespace: (input: string) => boolean;
245
+ /**
246
+ * 判断字符串是否为小写字母
247
+ * @param {string} input 输入字符串
248
+ * @example
249
+ * isAllLowerCase('abcdefg'); => true
250
+ * isAllLowerCase('isAllLowerCase'); => false
251
+ */
252
+ const isAllLowerCase: (input: string) => boolean;
253
+ /**
254
+ * 判断字符串是否为大写字母
255
+ * @param {string} input 输入字符串
256
+ * @example
257
+ * isAllUpperCase('ABCDEFG'); => true
258
+ * isAllUpperCase('isAllLowerCase'); => false
259
+ */
260
+ const isAllUpperCase: (input: string) => boolean;
261
+ /**
262
+ * 如果字符串为空则使用默认字符串, 否则不变
263
+ * @param {string} input 输入字符串
264
+ * @param {string} defaultStr 输入字符串
265
+ * @example
266
+ * defaultIfEmpty('', 'abcd'); => 'abcd'
267
+ * defaultIfEmpty('我是测试的字符串isAllLowerCase', '我是测试的字符串'); => '我是测试的字符串isAllLowerCase'
268
+ */
269
+ const defaultIfEmpty: (input: string, defaultStr: string) => string;
270
+ /**
271
+ * 字符串反转
272
+ * @param {string} input 输入字符串
273
+ * @example
274
+ * reverse('abcd'); => 'dcba'
275
+ * reverse('ABCD'); => 'DCBA'
276
+ */
277
+ const reverse: (input: string) => string;
278
+ /**
279
+ * 删掉特殊字符(英文状态下)
280
+ * @param {string} input 输入字符串
281
+ * @example
282
+ * removeSpecialCharacter('remove SpecialCharacter$%%^'); => 'remove SpecialCharacter'
283
+ * removeSpecialCharacter('removeSpecialCharacter##*'); => 'removeSpecialCharacter'
284
+ */
285
+ const removeSpecialCharacter: (input: string) => string;
286
+ /**
287
+ * 只包含特殊字符、数字和字母
288
+ * @param {string} input 输入字符串
289
+ * @example
290
+ * isSpecialCharacterAlphanumeric('2222SpecialCharacter$%%^'); => true
291
+ * isSpecialCharacterAlphanumeric('(字符串2222SpecialCharacter$%%^)'); => false
292
+ */
293
+ const isSpecialCharacterAlphanumeric: (input: string) => boolean;
294
+ /**
295
+ * 中文校验
296
+ * @param {string} input 输入字符串
297
+ * @example
298
+ * isChinese('我是测试的字符串'); => true
299
+ * isChinese('我是测试的字 abc 符串'); => false
300
+ */
301
+ const isChinese: (input: string) => boolean;
302
+ /**
303
+ * 去掉中文字符
304
+ * @param {string} input 输入字符串
305
+ * @example
306
+ * removeChinese('我是测试的字 abc 符串'); => abc
307
+ * removeChinese('测试abcd'); => abc
308
+ */
309
+ const removeChinese: (input: string) => string;
310
+ /**
311
+ * 转义元字符
312
+ * @param {string} input 输入字符串
313
+ * @example
314
+ * escapeMetacharacter('\'\''); => '\'\''
315
+ * escapeMetacharacter('\n\\?'); => '\n\\?'
316
+ */
317
+ const escapeMetacharacter: (input: string) => string;
318
+ /**
319
+ * 转义字符串中的元字符
320
+ * @param {string} input 输入字符串
321
+ * @example
322
+ * escapeMetacharacterOfStr('\'\''); => '\'\''
323
+ * escapeMetacharacterOfStr('我是测试的字abc\n符串'); => '我是测试的字abc\n符串'
324
+ */
325
+ const escapeMetacharacterOfStr: (input: string) => string;
326
+ /**
327
+ * 将中划线分隔形式的字符串,转换为驼峰式的字符串
328
+ * @param {string} input 输入字符串
329
+ * @example
330
+ * camelize('last-index-of'); => 'lastIndexOf'
331
+ * camelize('escape-metacharacter-of-str'); => 'escapeMetacharacterOfStr'
332
+ */
333
+ const camelize: (input: string) => string;
334
+ /**
335
+ * 将驼峰式的字符串转换为中划线分隔形式的字符串
336
+ * @param {string} input 输入字符串
337
+ * @example
338
+ * hyphenate('lastIndexOf'); => 'last-index-of'
339
+ * hyphenate('escapeMetacharacterOfStr'); => 'escape-metacharacter-of-str'
340
+ */
341
+ const hyphenate: (input: string) => string;
342
+ /**
343
+ * 将下划线分隔形式的字符串转换为驼峰式的字符串
344
+ * @param {string} input 输入字符串
345
+ * @example
346
+ * camelize('last_index_of'); => 'lastIndexOf'
347
+ * camelize('escape_metacharacter_of_str'); => 'escapeMetacharacterOfStr'
348
+ */
349
+ const uncamelize: (input: string) => string;
350
+ /**
351
+ * 将驼峰式的字符串转换为下划线分隔形式的字符串
352
+ * @param {string} input 输入字符串
353
+ * @example
354
+ * hyphenate('lastIndexOf'); => 'last_index_of'
355
+ * hyphenate('escapeMetacharacterOfStr'); => 'escape_metacharacter_of_str'
356
+ */
357
+ const unhyphenate: (input: string) => string;
358
+ /**
359
+ * 检测密码强度
360
+ * @param {string} str 密码
361
+ * @example
362
+ * checkPwd('data123') => 2
363
+ */
364
+ const checkPwd: (str: string) => number;
365
+ /**
366
+ * html转换文本
367
+ * @param {string} str html代码段
368
+ * @example
369
+ * filterTag('<p>你好</p>') => 你好
370
+ */
371
+ const filterTag: (str: string) => string;
372
+ /**
373
+ * 格式化json
374
+ * @param {string} str
375
+ * @example
376
+ * verifyJson('{"a":1}') => {\n\t"a": 1\n}
377
+ */
378
+ const verifyJson: (str: string) => string;
379
+ /**
380
+ * 生成一个用不重复的ID
381
+ * @default 9
382
+ */
383
+ function getUuiD(randomLength?: number): string;
384
+ /** 默认颜色数组 */
385
+ const DEFAULT_COLORS: string[];
386
+ /**
387
+ * @name 获取颜色值
388
+ * @param index 默认随机
389
+ */
390
+ const getColor: (index?: number) => string;
391
+ }
392
+ export default StringUtil;