sculp-js 0.0.1 → 0.1.1

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.
@@ -0,0 +1,72 @@
1
+ /*!
2
+ * sculp-js v0.1.0
3
+ * (c) 2023-2023 chandq
4
+ * Released under the MIT License.
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ var string = require('./string.js');
10
+ var type = require('./type.js');
11
+
12
+ /**
13
+ * 随机整数
14
+ * @param {number} min
15
+ * @param {number} max
16
+ * @returns {number}
17
+ */
18
+ const randomNumber = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);
19
+ const STRING_POOL = `${string.STRING_ARABIC_NUMERALS}${string.STRING_UPPERCASE_ALPHA}${string.STRING_LOWERCASE_ALPHA}`;
20
+ /**
21
+ * 随机字符串
22
+ * @param {number | string} length
23
+ * @param {string} pool
24
+ * @returns {string}
25
+ */
26
+ const randomString = (length, pool) => {
27
+ let _length = 0;
28
+ let _pool = STRING_POOL;
29
+ if (type.isString(pool)) {
30
+ _length = length;
31
+ _pool = pool;
32
+ }
33
+ else if (type.isNumber(length)) {
34
+ _length = length;
35
+ }
36
+ else if (type.isString(length)) {
37
+ _pool = length;
38
+ }
39
+ let times = Math.max(_length, 1);
40
+ let result = '';
41
+ const min = 0;
42
+ const max = _pool.length - 1;
43
+ if (max < 2)
44
+ throw new Error('字符串池长度不能少于 2');
45
+ while (times--) {
46
+ const index = randomNumber(min, max);
47
+ result += _pool[index];
48
+ }
49
+ return result;
50
+ };
51
+ /**
52
+ * 优先浏览器原生能力获取 UUID v4
53
+ * @returns {string}
54
+ */
55
+ function randomUuid() {
56
+ if (typeof URL === 'undefined' || !URL.createObjectURL || typeof Blob === 'undefined') {
57
+ const hex = '0123456789abcdef';
58
+ const model = 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx';
59
+ let str = '';
60
+ for (let i = 0; i < model.length; i++) {
61
+ const rnd = randomNumber(0, 15);
62
+ str += model[i] == '-' || model[i] == '4' ? model[i] : hex[rnd];
63
+ }
64
+ return str;
65
+ }
66
+ return /[^/]+$/.exec(URL.createObjectURL(new Blob()).slice())[0];
67
+ }
68
+
69
+ exports.STRING_POOL = STRING_POOL;
70
+ exports.randomNumber = randomNumber;
71
+ exports.randomString = randomString;
72
+ exports.randomUuid = randomUuid;
package/lib/cjs/string.js CHANGED
@@ -1,11 +1,13 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
7
  'use strict';
8
8
 
9
+ var type = require('./type.js');
10
+
9
11
  /**
10
12
  * 将字符串转换为驼峰格式
11
13
  * @param {string} string
@@ -122,10 +124,41 @@ const stringEscapeHtml = (html) => {
122
124
  * @returns {string}
123
125
  */
124
126
  const stringFill = (length, value = ' ') => new Array(length).fill(value).join('');
127
+ /**
128
+ * 字符串的像素宽度
129
+ * @param {string} str 目标字符串
130
+ * @param {number} fontSize 字符串字体大小
131
+ * @param {boolean} isRemoveDom 计算后是否移除中间dom元素
132
+ * @return {*}
133
+ */
134
+ function getStrWidthPx(str, fontSize = 14, isRemoveDom = false) {
135
+ let strWidth = 0;
136
+ console.assert(type.isString(str), `${str} 不是有效的字符串`);
137
+ if (type.isString(str) && str.length > 0) {
138
+ let getEle = document.querySelector('#getStrWidth1494304949567');
139
+ if (!getEle) {
140
+ const _ele = document.createElement('span');
141
+ _ele.id = 'getStrWidth1494304949567';
142
+ _ele.style.fontSize = fontSize + 'px';
143
+ _ele.style.whiteSpace = 'nowrap';
144
+ _ele.style.visibility = 'hidden';
145
+ _ele.textContent = str;
146
+ document.body.appendChild(_ele);
147
+ getEle = _ele;
148
+ }
149
+ getEle.textContent = str;
150
+ strWidth = getEle.offsetWidth;
151
+ if (isRemoveDom) {
152
+ document.body.appendChild(getEle);
153
+ }
154
+ }
155
+ return strWidth;
156
+ }
125
157
 
126
158
  exports.STRING_ARABIC_NUMERALS = STRING_ARABIC_NUMERALS;
127
159
  exports.STRING_LOWERCASE_ALPHA = STRING_LOWERCASE_ALPHA;
128
160
  exports.STRING_UPPERCASE_ALPHA = STRING_UPPERCASE_ALPHA;
161
+ exports.getStrWidthPx = getStrWidthPx;
129
162
  exports.stringAssign = stringAssign;
130
163
  exports.stringCamelCase = stringCamelCase;
131
164
  exports.stringEscapeHtml = stringEscapeHtml;
package/lib/cjs/type.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -45,3 +45,4 @@ exports.isRegExp = isRegExp;
45
45
  exports.isString = isString;
46
46
  exports.isSymbol = isSymbol;
47
47
  exports.isUndefined = isUndefined;
48
+ exports.typeIs = typeIs;
@@ -0,0 +1,83 @@
1
+ /*!
2
+ * sculp-js v0.1.0
3
+ * (c) 2023-2023 chandq
4
+ * Released under the MIT License.
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ var number = require('./number.js');
10
+ var random = require('./random.js');
11
+ var type = require('./type.js');
12
+
13
+ const padStartWithZero = (str, maxLength = 2) => String(str).padStart(maxLength, '0');
14
+ let safeNo = 0;
15
+ let lastTimestamp = 0;
16
+ // 安全后缀长度,按 1 毫秒运算 99999 次 JS 代码来进行估算
17
+ // 那么,补足长度为 5
18
+ // 时间戳模式长度为 13
19
+ // 取最长 5 + 13 = 18
20
+ const UNIQUE_NUMBER_SAFE_LENGTH = 18;
21
+ const FIX_SAFE_LENGTH = 5;
22
+ const TIMESTAMP_LENGTH = 13;
23
+ /**
24
+ * 生成唯一不重复数值
25
+ * @param {number} length
26
+ * @returns {string}
27
+ */
28
+ const uniqueNumber = (length = UNIQUE_NUMBER_SAFE_LENGTH) => {
29
+ const now = Date.now();
30
+ length = Math.max(length, UNIQUE_NUMBER_SAFE_LENGTH);
31
+ if (now !== lastTimestamp) {
32
+ lastTimestamp = now;
33
+ safeNo = 0;
34
+ }
35
+ const timestamp = `${now}`;
36
+ let random$1 = '';
37
+ const rndLength = length - FIX_SAFE_LENGTH - TIMESTAMP_LENGTH;
38
+ if (rndLength > 0) {
39
+ const rndMin = 10 ** (rndLength - 1);
40
+ const rndMax = 10 ** rndLength - 1;
41
+ const rnd = random.randomNumber(rndMin, rndMax);
42
+ random$1 = `${rnd}`;
43
+ }
44
+ const safe = padStartWithZero(safeNo, FIX_SAFE_LENGTH);
45
+ safeNo++;
46
+ return `${timestamp}${random$1}${safe}`;
47
+ };
48
+ const randomFromPool = (pool) => {
49
+ const poolIndex = random.randomNumber(0, pool.length - 1);
50
+ return pool[poolIndex];
51
+ };
52
+ /**
53
+ * 生成唯一不重复字符串
54
+ * @param {number | string} length
55
+ * @param {string} pool
56
+ * @returns {string}
57
+ */
58
+ const uniqueString = (length, pool) => {
59
+ let _length = 0;
60
+ let _pool = number.HEX_POOL;
61
+ if (type.isString(pool)) {
62
+ _length = length;
63
+ _pool = pool;
64
+ }
65
+ else if (type.isNumber(length)) {
66
+ _length = length;
67
+ }
68
+ else if (type.isString(length)) {
69
+ _pool = length;
70
+ }
71
+ let uniqueString = number.numberToHex(uniqueNumber(), _pool);
72
+ let insertLength = _length - uniqueString.length;
73
+ if (insertLength <= 0)
74
+ return uniqueString;
75
+ while (insertLength--) {
76
+ uniqueString += randomFromPool(_pool);
77
+ }
78
+ return uniqueString;
79
+ };
80
+
81
+ exports.UNIQUE_NUMBER_SAFE_LENGTH = UNIQUE_NUMBER_SAFE_LENGTH;
82
+ exports.uniqueNumber = uniqueNumber;
83
+ exports.uniqueString = uniqueString;
package/lib/cjs/url.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/array.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -31,14 +31,14 @@ const arrayEach = (array, iterator, reverse = false) => {
31
31
  if (reverse) {
32
32
  for (let idx = array.length - 1; idx >= 0; idx--) {
33
33
  const val = array[idx];
34
- if (iterator(val, idx) === false)
34
+ if (iterator(val, idx, array) === false)
35
35
  break;
36
36
  }
37
37
  }
38
38
  else {
39
39
  for (let idx = 0; idx < array.length; idx++) {
40
40
  const val = array[idx];
41
- if (iterator(val, idx) === false)
41
+ if (iterator(val, idx, array) === false)
42
42
  break;
43
43
  }
44
44
  }
@@ -170,39 +170,11 @@ function getTreeIds(tree, nodeId, config) {
170
170
  while (child && child.parentId) {
171
171
  ids = [child.parentId, ...ids];
172
172
  nodes = [child.parent, ...nodes];
173
- child = flatArray.find(_ => _[id] === child.parentId);
173
+ child = flatArray.find(_ => _[id] === child.parentId); // eslint-disable-line
174
174
  }
175
175
  return [ids, nodes];
176
176
  };
177
177
  return getIds(toFlatArray(tree));
178
178
  }
179
- /**
180
- * 异步ForEach函数
181
- * @param {array} array
182
- * @param {asyncFuntion} callback
183
- * // asyncForEach 使用范例如下
184
- // const start = async () => {
185
- // await asyncForEach(result, async (item) => {
186
- // await request(item);
187
- // count++;
188
- // });
189
-
190
- // console.log('发送次数', count);
191
- // }
192
-
193
- // for await...of 使用范例如下
194
- // const loadImages = async (images) => {
195
- // for await (const item of images) {
196
- // await request(item);
197
- // count++;
198
- // }
199
- // }
200
- * @return {*}
201
- */
202
- async function asyncForEach(array, callback) {
203
- for (let index = 0, len = array.length; index < len; index++) {
204
- await callback(array[index], index, array);
205
- }
206
- }
207
179
 
208
- export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayLike, arrayRemove, asyncForEach, deepTraversal, getTreeIds };
180
+ export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayLike, arrayRemove, deepTraversal, getTreeIds };
package/lib/es/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/cookie.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/date.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -54,16 +54,16 @@ const formatDate = (date = new Date(), format = 'YYYY-MM-DD HH:mm:ss') => {
54
54
  */
55
55
  function calculateDate(strDate, n, sep = '-') {
56
56
  //strDate 为字符串日期 如:'2019-01-01' n为你要传入的参数,当前为0,前一天为-1,后一天为1
57
- let dateArr = strDate.split(sep); //这边给定一个特定时间
58
- let newDate = new Date(+dateArr[0], +dateArr[1] - 1, +dateArr[2]);
59
- let befminuts = newDate.getTime() + 1000 * 60 * 60 * 24 * parseInt(String(n)); //计算前几天用减,计算后几天用加,最后一个就是多少天的数量
60
- let beforeDat = new Date();
57
+ const dateArr = strDate.split(sep); //这边给定一个特定时间
58
+ const newDate = new Date(+dateArr[0], +dateArr[1] - 1, +dateArr[2]);
59
+ const befminuts = newDate.getTime() + 1000 * 60 * 60 * 24 * parseInt(String(n)); //计算前几天用减,计算后几天用加,最后一个就是多少天的数量
60
+ const beforeDat = new Date();
61
61
  beforeDat.setTime(befminuts);
62
- let befMonth = beforeDat.getMonth() + 1;
63
- let mon = befMonth >= 10 ? befMonth : '0' + befMonth;
64
- let befDate = beforeDat.getDate();
65
- let da = befDate >= 10 ? befDate : '0' + befDate;
66
- let finalNewDate = beforeDat.getFullYear() + '-' + mon + '-' + da;
62
+ const befMonth = beforeDat.getMonth() + 1;
63
+ const mon = befMonth >= 10 ? befMonth : '0' + befMonth;
64
+ const befDate = beforeDat.getDate();
65
+ const da = befDate >= 10 ? befDate : '0' + befDate;
66
+ const finalNewDate = beforeDat.getFullYear() + '-' + mon + '-' + da;
67
67
  return finalNewDate;
68
68
  }
69
69
  /**
@@ -74,9 +74,9 @@ function calculateDate(strDate, n, sep = '-') {
74
74
  * @return {*}
75
75
  */
76
76
  function calculateDateTime(n, dateSep = '-', timeSep = ':') {
77
- let date = new Date();
78
- let separator1 = '-';
79
- let separator2 = ':';
77
+ const date = new Date();
78
+ const separator1 = '-';
79
+ const separator2 = ':';
80
80
  let year = date.getFullYear();
81
81
  let month = date.getMonth() + 1;
82
82
  let strDate = date.getDate() + n;
package/lib/es/dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -139,5 +139,16 @@ function onDomReady(callback) {
139
139
  domReadyCallbacks.push(callback);
140
140
  }
141
141
  }
142
+ /**
143
+ * 获取元素样式属性的计算值
144
+ * @param {HTMLElement} el
145
+ * @param {string} property
146
+ * @param {boolean} reNumber
147
+ * @return {string|number}
148
+ */
149
+ function getComputedCssVal(el, property, reNumber = true) {
150
+ const originVal = getComputedStyle(el).getPropertyValue(property) ?? '';
151
+ return reNumber ? Number(originVal.replace(/([0-9]*)(.*)/g, '$1')) : originVal;
152
+ }
142
153
 
143
- export { addClass, getStyle, hasClass, isDomReady, onDomReady, removeClass, setStyle, smoothScroll };
154
+ export { addClass, getComputedCssVal, getStyle, hasClass, isDomReady, onDomReady, removeClass, setStyle, smoothScroll };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/easing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
package/lib/es/func.js ADDED
@@ -0,0 +1,154 @@
1
+ /*!
2
+ * sculp-js v0.1.0
3
+ * (c) 2023-2023 chandq
4
+ * Released under the MIT License.
5
+ */
6
+
7
+ /**
8
+ * 防抖函数
9
+ * 当函数被连续调用时,该函数并不执行,只有当其全部停止调用超过一定时间后才执行1次。
10
+ * 例如:上电梯的时候,大家陆陆续续进来,电梯的门不会关上,只有当一段时间都没有人上来,电梯才会关门。
11
+ * @param {F} func
12
+ * @param {number} wait
13
+ * @returns {DebounceFunc<F>}
14
+ */
15
+ const debounce = (func, wait) => {
16
+ let timeout;
17
+ let canceled = false;
18
+ const f = function (...args) {
19
+ if (canceled)
20
+ return;
21
+ clearTimeout(timeout);
22
+ timeout = setTimeout(() => {
23
+ func.call(this, ...args);
24
+ }, wait);
25
+ };
26
+ f.cancel = () => {
27
+ clearTimeout(timeout);
28
+ canceled = true;
29
+ };
30
+ return f;
31
+ };
32
+ /**
33
+ * 节流函数
34
+ * 节流就是节约流量,将连续触发的事件稀释成预设评率。 比如每间隔1秒执行一次函数,无论这期间触发多少次事件。
35
+ * 这有点像公交车,无论在站点等车的人多不多,公交车只会按时来一班,不会来一个人就来一辆公交车。
36
+ * @param {F} func
37
+ * @param {number} wait
38
+ * @param {boolean} immediate
39
+ * @returns {ThrottleFunc<F>}
40
+ */
41
+ const throttle = (func, wait, immediate) => {
42
+ let timeout;
43
+ let canceled = false;
44
+ let lastCalledTime = 0;
45
+ const f = function (...args) {
46
+ if (canceled)
47
+ return;
48
+ const now = Date.now();
49
+ const call = () => {
50
+ lastCalledTime = now;
51
+ func.call(this, ...args);
52
+ };
53
+ // 第一次执行
54
+ if (lastCalledTime === 0) {
55
+ if (immediate) {
56
+ return call();
57
+ }
58
+ else {
59
+ lastCalledTime = now;
60
+ return;
61
+ }
62
+ }
63
+ const remain = lastCalledTime + wait - now;
64
+ if (remain > 0) {
65
+ clearTimeout(timeout);
66
+ timeout = setTimeout(() => call(), wait);
67
+ }
68
+ else {
69
+ call();
70
+ }
71
+ };
72
+ f.cancel = () => {
73
+ clearTimeout(timeout);
74
+ canceled = true;
75
+ };
76
+ return f;
77
+ };
78
+ /**
79
+ * 单次函数
80
+ * @param {AnyFunc} func
81
+ * @returns {AnyFunc}
82
+ */
83
+ const once = (func) => {
84
+ let called = false;
85
+ let result;
86
+ return function (...args) {
87
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
88
+ if (called)
89
+ return result;
90
+ called = true;
91
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
92
+ result = func.call(this, ...args);
93
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
94
+ return result;
95
+ };
96
+ };
97
+ /**
98
+ * 设置全局变量
99
+ * @param {string | number | symbol} key
100
+ * @param val
101
+ */
102
+ function setGlobal(key, val) {
103
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
104
+ // @ts-ignore
105
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
106
+ if (typeof globalThis !== 'undefined')
107
+ globalThis[key] = val;
108
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
109
+ // @ts-ignore
110
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
111
+ else if (typeof window !== 'undefined')
112
+ window[key] = val;
113
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
114
+ // @ts-ignore
115
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
116
+ else if (typeof global !== 'undefined')
117
+ global[key] = val;
118
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
119
+ // @ts-ignore
120
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
121
+ else if (typeof self !== 'undefined')
122
+ self[key] = val;
123
+ else
124
+ throw new SyntaxError('当前环境下无法设置全局属性');
125
+ }
126
+ /**
127
+ * 设置全局变量
128
+ * @param {string | number | symbol} key
129
+ * @param val
130
+ */
131
+ function getGlobal(key) {
132
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
133
+ // @ts-ignore
134
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
135
+ if (typeof globalThis !== 'undefined')
136
+ return globalThis[key];
137
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
138
+ // @ts-ignore
139
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
140
+ else if (typeof window !== 'undefined')
141
+ return window[key];
142
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
143
+ // @ts-ignore
144
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
145
+ else if (typeof global !== 'undefined')
146
+ return global[key];
147
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
148
+ // @ts-ignore
149
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
150
+ else if (typeof self !== 'undefined')
151
+ return self[key];
152
+ }
153
+
154
+ export { debounce, getGlobal, once, setGlobal, throttle };
package/lib/es/index.js CHANGED
@@ -1,35 +1,25 @@
1
1
  /*!
2
- * sculp-js v0.0.1
2
+ * sculp-js v0.1.0
3
3
  * (c) 2023-2023 chandq
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
- import * as array from './array.js';
8
- export { array };
9
- import * as clipboard from './clipboard.js';
10
- export { clipboard };
11
- import * as cookie from './cookie.js';
12
- export { cookie };
13
- import * as date from './date.js';
14
- export { date };
15
- import * as dom from './dom.js';
16
- export { dom };
17
- import * as download from './download.js';
18
- export { download };
19
- import * as object from './object.js';
20
- export { object };
21
- import * as path from './path.js';
22
- export { path };
23
- import * as qs from './qs.js';
24
- export { qs };
25
- import * as string from './string.js';
26
- export { string };
27
- import * as type from './type.js';
28
- export { type };
29
- import * as url from './url.js';
30
- export { url };
31
- import * as async from './async.js';
32
- export { async };
33
- import * as file from './file.js';
34
- export { file };
7
+ export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayLike, arrayRemove, deepTraversal, getTreeIds } from './array.js';
8
+ export { copyText } from './clipboard.js';
9
+ export { cookieDel, cookieGet, cookieSet } from './cookie.js';
10
+ export { calculateDate, calculateDateTime, formatDate } from './date.js';
11
+ export { addClass, getComputedCssVal, getStyle, hasClass, isDomReady, onDomReady, removeClass, setStyle, smoothScroll } from './dom.js';
12
+ export { downloadBlob, downloadData, downloadHref, downloadURL } from './download.js';
13
+ export { cloneDeep, isPlainObject, objectAssign, objectEach, objectEachAsync, objectFill, objectGet, objectHas, objectMap, objectAssign as objectMerge, objectOmit, objectPick } from './object.js';
14
+ export { pathJoin, pathNormalize } from './path.js';
15
+ export { qsParse, qsStringify } from './qs.js';
16
+ export { STRING_ARABIC_NUMERALS, STRING_LOWERCASE_ALPHA, STRING_UPPERCASE_ALPHA, getStrWidthPx, stringAssign, stringCamelCase, stringEscapeHtml, stringFill, stringFormat, stringKebabCase } from './string.js';
17
+ export { isArray, isBigInt, isBoolean, isDate, isError, isFunction, isNaN, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined, typeIs } from './type.js';
18
+ export { urlDelParams, urlParse, urlSetParams, urlStringify } from './url.js';
19
+ export { asyncMap, wait } from './async.js';
20
+ export { chooseLocalFile } from './file.js';
35
21
  export { genCanvasWM } from './watermark.js';
22
+ export { debounce, getGlobal, once, setGlobal, throttle } from './func.js';
23
+ export { STRING_POOL, randomNumber, randomString, randomUuid } from './random.js';
24
+ export { HEX_POOL, formatNumber, numberAbbr, numberToHex } from './number.js';
25
+ export { UNIQUE_NUMBER_SAFE_LENGTH, uniqueNumber, uniqueString } from './unique.js';