sculp-js 1.18.2 → 1.19.0
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/README.md +83 -6
- package/dist/cjs/{array.js → array.cjs} +10 -2
- package/dist/cjs/{async.js → async.cjs} +8 -2
- package/dist/cjs/{base64.js → base64.cjs} +11 -4
- package/dist/cjs/{clipboard.js → clipboard.cjs} +9 -4
- package/dist/cjs/{cloneDeep.js → cloneDeep.cjs} +6 -2
- package/dist/cjs/{cookie.js → cookie.cjs} +9 -3
- package/dist/cjs/{date.js → date.cjs} +13 -3
- package/dist/cjs/{dom.js → dom.cjs} +16 -5
- package/dist/cjs/{download.js → download.cjs} +12 -4
- package/dist/cjs/{file.js → file.cjs} +9 -3
- package/dist/cjs/{func.js → func.cjs} +10 -2
- package/dist/cjs/{index.js → index.cjs} +63 -31
- package/dist/cjs/{isEqual.js → isEqual.cjs} +6 -2
- package/dist/cjs/{math.js → math.cjs} +10 -2
- package/dist/cjs/{number.js → number.cjs} +16 -7
- package/dist/cjs/{object.js → object.cjs} +19 -5
- package/dist/cjs/{path.js → path.cjs} +7 -2
- package/dist/cjs/{qs.js → qs.cjs} +9 -4
- package/dist/cjs/{random.js → random.cjs} +11 -4
- package/dist/cjs/{string.js → string.cjs} +15 -2
- package/dist/cjs/{tooltip.js → tooltip.cjs} +8 -4
- package/dist/cjs/{tree.js → tree.cjs} +15 -4
- package/dist/cjs/{type.js → type.cjs} +27 -2
- package/dist/cjs/{unicodeToolkit.js → unicodeToolkit.cjs} +6 -2
- package/dist/cjs/{unique.js → unique.cjs} +11 -5
- package/dist/cjs/{url.js → url.cjs} +12 -5
- package/dist/cjs/{validator.js → validator.cjs} +21 -2
- package/dist/cjs/{variable.js → variable.cjs} +11 -3
- package/dist/cjs/{watermark.js → watermark.cjs} +7 -3
- package/dist/esm/{array.js → array.mjs} +9 -2
- package/dist/esm/{async.js → async.mjs} +7 -2
- package/dist/esm/{base64.js → base64.mjs} +10 -4
- package/dist/esm/{clipboard.js → clipboard.mjs} +8 -4
- package/dist/esm/{cloneDeep.js → cloneDeep.mjs} +5 -2
- package/dist/esm/{cookie.js → cookie.mjs} +8 -3
- package/dist/esm/{date.js → date.mjs} +21 -3
- package/dist/esm/{dom.js → dom.mjs} +25 -5
- package/dist/esm/{download.js → download.mjs} +11 -4
- package/dist/esm/{file.js → file.mjs} +8 -3
- package/dist/esm/{func.js → func.mjs} +9 -2
- package/dist/esm/index.mjs +191 -0
- package/dist/esm/{isEqual.js → isEqual.mjs} +5 -2
- package/dist/esm/{math.js → math.mjs} +9 -2
- package/dist/esm/{number.js → number.mjs} +23 -7
- package/dist/esm/{object.js → object.mjs} +16 -2
- package/dist/esm/{path.js → path.mjs} +6 -2
- package/dist/esm/{qs.js → qs.mjs} +8 -4
- package/dist/esm/{random.js → random.mjs} +10 -4
- package/dist/esm/{string.js → string.mjs} +14 -1
- package/dist/esm/{tooltip.js → tooltip.mjs} +7 -4
- package/dist/esm/{tree.js → tree.mjs} +24 -4
- package/dist/esm/{type.js → type.mjs} +27 -2
- package/dist/esm/{unicodeToolkit.js → unicodeToolkit.mjs} +5 -2
- package/dist/esm/{unique.js → unique.mjs} +10 -5
- package/dist/esm/{url.js → url.mjs} +11 -5
- package/dist/esm/{validator.js → validator.mjs} +20 -1
- package/dist/esm/{variable.js → variable.mjs} +10 -3
- package/dist/esm/{watermark.js → watermark.mjs} +6 -3
- package/dist/types/array.d.ts +8 -0
- package/dist/types/async.d.ts +6 -0
- package/dist/types/base64.d.ts +7 -0
- package/dist/types/clipboard.d.ts +5 -1
- package/dist/types/cloneDeep.d.ts +4 -0
- package/dist/types/cookie.d.ts +6 -0
- package/dist/types/date.d.ts +10 -0
- package/dist/types/dom.d.ts +11 -0
- package/dist/types/download.d.ts +8 -1
- package/dist/types/file.d.ts +6 -1
- package/dist/types/func.d.ts +8 -0
- package/dist/types/isEqual.d.ts +4 -0
- package/dist/types/math.d.ts +8 -1
- package/dist/types/number.d.ts +11 -2
- package/dist/types/object.d.ts +13 -0
- package/dist/types/path.d.ts +5 -0
- package/dist/types/qs.d.ts +5 -0
- package/dist/types/random.d.ts +7 -0
- package/dist/types/string.d.ts +13 -0
- package/dist/types/tooltip.d.ts +7 -0
- package/dist/types/tree.d.ts +11 -0
- package/dist/types/type.d.ts +29 -4
- package/dist/types/unicodeToolkit.d.ts +4 -0
- package/dist/types/unique.d.ts +6 -0
- package/dist/types/url.d.ts +7 -0
- package/dist/types/validator.d.ts +19 -0
- package/dist/types/variable.d.ts +8 -0
- package/dist/types/watermark.d.ts +4 -0
- package/dist/umd/index.min.js +2 -2
- package/package.json +92 -120
- package/dist/esm/index.js +0 -130
- package/dist/types/index.d.ts +0 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -126,10 +126,35 @@ function isEmpty(value) {
|
|
|
126
126
|
function isNodeList(value) {
|
|
127
127
|
return isUndefined(NodeList) ? false : NodeList.prototype.isPrototypeOf(value);
|
|
128
128
|
}
|
|
129
|
+
var type = {
|
|
130
|
+
typeIs,
|
|
131
|
+
objectHas,
|
|
132
|
+
arrayLike,
|
|
133
|
+
isString,
|
|
134
|
+
isBoolean,
|
|
135
|
+
isSymbol,
|
|
136
|
+
isBigInt,
|
|
137
|
+
isNumber,
|
|
138
|
+
isUndefined,
|
|
139
|
+
isNull,
|
|
140
|
+
isPrimitive,
|
|
141
|
+
isNullOrUnDef,
|
|
142
|
+
isNullish: isNullOrUnDef,
|
|
143
|
+
isObject,
|
|
144
|
+
isArray,
|
|
145
|
+
isFunction,
|
|
146
|
+
isNaN,
|
|
147
|
+
isDate,
|
|
148
|
+
isError,
|
|
149
|
+
isRegExp,
|
|
150
|
+
isJsonString,
|
|
151
|
+
isEmpty,
|
|
152
|
+
isNodeList
|
|
153
|
+
};
|
|
129
154
|
|
|
130
155
|
export {
|
|
131
156
|
arrayLike,
|
|
132
|
-
|
|
157
|
+
type as default,
|
|
133
158
|
isArray,
|
|
134
159
|
isBigInt,
|
|
135
160
|
isBoolean,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -113,5 +113,8 @@ class UnicodeToolkit {
|
|
|
113
113
|
return decoded;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
+
var unicodeToolkit = {
|
|
117
|
+
UnicodeToolkit
|
|
118
|
+
};
|
|
116
119
|
|
|
117
|
-
export { UnicodeToolkit };
|
|
120
|
+
export { UnicodeToolkit, unicodeToolkit as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { numberToHex, HEX_POOL } from './number.
|
|
8
|
-
import { randomNumber } from './random.
|
|
9
|
-
import { isString, isNumber } from './type.
|
|
7
|
+
import { numberToHex, HEX_POOL } from './number.mjs';
|
|
8
|
+
import { randomNumber } from './random.mjs';
|
|
9
|
+
import { isString, isNumber } from './type.mjs';
|
|
10
10
|
|
|
11
11
|
const padStartWithZero = (str, maxLength = 2) => String(str).padStart(maxLength, '0');
|
|
12
12
|
let safeNo = 0;
|
|
@@ -72,5 +72,10 @@ const uniqueString = (length, pool) => {
|
|
|
72
72
|
}
|
|
73
73
|
return uniqueString;
|
|
74
74
|
};
|
|
75
|
+
var unique = {
|
|
76
|
+
UNIQUE_NUMBER_SAFE_LENGTH,
|
|
77
|
+
uniqueNumber,
|
|
78
|
+
uniqueString
|
|
79
|
+
};
|
|
75
80
|
|
|
76
|
-
export { UNIQUE_NUMBER_SAFE_LENGTH, uniqueNumber, uniqueString };
|
|
81
|
+
export { UNIQUE_NUMBER_SAFE_LENGTH, unique as default, uniqueNumber, uniqueString };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { isFunction } from './type.
|
|
8
|
-
import { pathJoin } from './path.
|
|
9
|
-
import {
|
|
7
|
+
import { isFunction } from './type.mjs';
|
|
8
|
+
import { pathJoin } from './path.mjs';
|
|
9
|
+
import { qsStringify, qsParse } from './qs.mjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* url 解析
|
|
@@ -84,5 +84,11 @@ const urlDelParams = (url, removeKeys) => {
|
|
|
84
84
|
removeKeys.forEach(key => delete p.searchParams[key]);
|
|
85
85
|
return urlStringify(p);
|
|
86
86
|
};
|
|
87
|
+
var url = {
|
|
88
|
+
urlParse,
|
|
89
|
+
urlStringify,
|
|
90
|
+
urlSetParams,
|
|
91
|
+
urlDelParams
|
|
92
|
+
};
|
|
87
93
|
|
|
88
|
-
export { urlDelParams, urlParse, urlSetParams, urlStringify };
|
|
94
|
+
export { url as default, urlDelParams, urlParse, urlSetParams, urlStringify };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -126,6 +126,24 @@ const DIGIT_RE = /^\d+$/;
|
|
|
126
126
|
* @returns {boolean}
|
|
127
127
|
*/
|
|
128
128
|
const isDigit = value => DIGIT_RE.test(value);
|
|
129
|
+
var validator = {
|
|
130
|
+
EMAIL_REGEX,
|
|
131
|
+
HTTP_URL_REGEX,
|
|
132
|
+
IPV4_REGEX,
|
|
133
|
+
IPV6_REGEX,
|
|
134
|
+
PHONE_REGEX,
|
|
135
|
+
URL_REGEX,
|
|
136
|
+
isDigit,
|
|
137
|
+
isEmail,
|
|
138
|
+
isFloat,
|
|
139
|
+
isIdNo,
|
|
140
|
+
isInteger,
|
|
141
|
+
isIpV4,
|
|
142
|
+
isIpV6,
|
|
143
|
+
isNumerical,
|
|
144
|
+
isPhone,
|
|
145
|
+
isUrl
|
|
146
|
+
};
|
|
129
147
|
|
|
130
148
|
export {
|
|
131
149
|
EMAIL_REGEX,
|
|
@@ -134,6 +152,7 @@ export {
|
|
|
134
152
|
IPV6_REGEX,
|
|
135
153
|
PHONE_REGEX,
|
|
136
154
|
URL_REGEX,
|
|
155
|
+
validator as default,
|
|
137
156
|
isDigit,
|
|
138
157
|
isEmail,
|
|
139
158
|
isFloat,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { objectHas, isNullOrUnDef } from './type.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 去除字符串中重复字符
|
|
@@ -115,5 +115,12 @@ function executeInScope(code, scope = {}) {
|
|
|
115
115
|
throw new Error(`代码执行失败: ${error.message}`);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
+
var variable = {
|
|
119
|
+
escapeRegExp,
|
|
120
|
+
executeInScope,
|
|
121
|
+
parseVarFromString,
|
|
122
|
+
replaceVarFromString,
|
|
123
|
+
uniqueSymbol
|
|
124
|
+
};
|
|
118
125
|
|
|
119
|
-
export { escapeRegExp, executeInScope, parseVarFromString, replaceVarFromString, uniqueSymbol };
|
|
126
|
+
export { variable as default, escapeRegExp, executeInScope, parseVarFromString, replaceVarFromString, uniqueSymbol };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.19.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { isNullOrUnDef, isString } from './type.
|
|
7
|
+
import { isNullOrUnDef, isString } from './type.mjs';
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* @created: Saturday, 2020-04-18 14:38:23
|
|
@@ -98,5 +98,8 @@ function genCanvasWM(content = '请勿外传', canvasWM) {
|
|
|
98
98
|
mo.observe(container, { attributes: true, subtree: true, childList: true });
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
var watermark = {
|
|
102
|
+
genCanvasWM
|
|
103
|
+
};
|
|
101
104
|
|
|
102
|
-
export { genCanvasWM };
|
|
105
|
+
export { watermark as default, genCanvasWM };
|
package/dist/types/array.d.ts
CHANGED
|
@@ -98,3 +98,11 @@ export type GetKey<T> = (item: T) => string | number | symbol;
|
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
100
|
export declare function diffArray<T>(source: readonly T[], target: readonly T[], getKey?: GetKey<T>): DiffResult<T>;
|
|
101
|
+
declare const _default: {
|
|
102
|
+
arrayEach: typeof arrayEach;
|
|
103
|
+
arrayEachAsync: typeof arrayEachAsync;
|
|
104
|
+
arrayInsertBefore: typeof arrayInsertBefore;
|
|
105
|
+
arrayRemove: typeof arrayRemove;
|
|
106
|
+
diffArray: typeof diffArray;
|
|
107
|
+
};
|
|
108
|
+
export default _default;
|
package/dist/types/async.d.ts
CHANGED
|
@@ -34,3 +34,9 @@ export declare function asyncMap<T, R>(list: Array<T>, mapper: (val: T, idx: num
|
|
|
34
34
|
}
|
|
35
35
|
*/
|
|
36
36
|
export declare function safeAwait<T, U = Error>(promise: Promise<T>, errorExt?: object): Promise<[U, undefined] | [null, T]>;
|
|
37
|
+
declare const _default: {
|
|
38
|
+
wait: typeof wait;
|
|
39
|
+
asyncMap: typeof asyncMap;
|
|
40
|
+
safeAwait: typeof safeAwait;
|
|
41
|
+
};
|
|
42
|
+
export default _default;
|
package/dist/types/base64.d.ts
CHANGED
|
@@ -22,3 +22,10 @@ export declare function b64decode(base64: string): string;
|
|
|
22
22
|
* @returns base64编码的字符串
|
|
23
23
|
*/
|
|
24
24
|
export declare function b64encode(rawStr: string): string;
|
|
25
|
+
declare const _default: {
|
|
26
|
+
weBtoa: typeof weBtoa;
|
|
27
|
+
weAtob: typeof weAtob;
|
|
28
|
+
b64decode: typeof b64decode;
|
|
29
|
+
b64encode: typeof b64encode;
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -16,4 +16,8 @@ export declare function copyText(text: string, options?: CopyTextOptions): void;
|
|
|
16
16
|
* @param options
|
|
17
17
|
*/
|
|
18
18
|
export declare function fallbackCopyText(text: string, options?: CopyTextOptions): void;
|
|
19
|
-
|
|
19
|
+
declare const _default: {
|
|
20
|
+
copyText: typeof copyText;
|
|
21
|
+
fallbackCopyText: typeof fallbackCopyText;
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
package/dist/types/cookie.d.ts
CHANGED
|
@@ -16,3 +16,9 @@ export declare function cookieSet(name: string, value: string, maxAge?: number |
|
|
|
16
16
|
* @param name cookie 名称
|
|
17
17
|
*/
|
|
18
18
|
export declare const cookieDel: (name: string) => void;
|
|
19
|
+
declare const _default: {
|
|
20
|
+
cookieSet: typeof cookieSet;
|
|
21
|
+
cookieGet: typeof cookieGet;
|
|
22
|
+
cookieDel: (name: string) => void;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
package/dist/types/date.d.ts
CHANGED
|
@@ -71,3 +71,13 @@ export declare function calculateDate(originDate: DateValue, n: number, sep?: st
|
|
|
71
71
|
* @returns {string} 转换后的目标日期时间
|
|
72
72
|
*/
|
|
73
73
|
export declare function calculateDateTime(originDateTime: DateValue, n: number, dateSep?: string, timeSep?: string): string;
|
|
74
|
+
declare const _default: {
|
|
75
|
+
isValidDate: (any: unknown) => any is Date;
|
|
76
|
+
dateParse: typeof dateParse;
|
|
77
|
+
dateToStart: typeof dateToStart;
|
|
78
|
+
dateToEnd: typeof dateToEnd;
|
|
79
|
+
formatDate: typeof formatDate;
|
|
80
|
+
calculateDate: typeof calculateDate;
|
|
81
|
+
calculateDateTime: typeof calculateDateTime;
|
|
82
|
+
};
|
|
83
|
+
export default _default;
|
package/dist/types/dom.d.ts
CHANGED
|
@@ -61,3 +61,14 @@ export declare function getStrWidthPx(str: string, fontSize?: number, isRemove?:
|
|
|
61
61
|
* @returns
|
|
62
62
|
*/
|
|
63
63
|
export declare function select(element: HTMLElement): any;
|
|
64
|
+
declare const _default: {
|
|
65
|
+
hasClass: typeof hasClass;
|
|
66
|
+
addClass: typeof addClass;
|
|
67
|
+
removeClass: typeof removeClass;
|
|
68
|
+
setStyle: SetStyle;
|
|
69
|
+
getStyle: typeof getStyle;
|
|
70
|
+
getComputedCssVal: typeof getComputedCssVal;
|
|
71
|
+
getStrWidthPx: typeof getStrWidthPx;
|
|
72
|
+
select: typeof select;
|
|
73
|
+
};
|
|
74
|
+
export default _default;
|
package/dist/types/download.d.ts
CHANGED
|
@@ -43,4 +43,11 @@ export type FileType = 'json' | 'csv' | 'xls' | 'xlsx';
|
|
|
43
43
|
* @param {string[]} [headers]
|
|
44
44
|
*/
|
|
45
45
|
export declare function downloadData(data: AnyObject | AnyObject[], fileType: FileType, filename: string, headers?: string[]): void;
|
|
46
|
-
|
|
46
|
+
declare const _default: {
|
|
47
|
+
downloadURL: typeof downloadURL;
|
|
48
|
+
downloadHref: typeof downloadHref;
|
|
49
|
+
downloadBlob: typeof downloadBlob;
|
|
50
|
+
crossOriginDownload: typeof crossOriginDownload;
|
|
51
|
+
downloadData: typeof downloadData;
|
|
52
|
+
};
|
|
53
|
+
export default _default;
|
package/dist/types/file.d.ts
CHANGED
|
@@ -40,4 +40,9 @@ export interface ICompressImgResult {
|
|
|
40
40
|
* @returns {Promise<ICompressImgResult | ICompressImgResult[] | null>}
|
|
41
41
|
*/
|
|
42
42
|
export declare function compressImg(file: File | FileList, options?: ICompressOptions): Promise<ICompressImgResult | ICompressImgResult[] | null>;
|
|
43
|
-
|
|
43
|
+
declare const _default: {
|
|
44
|
+
supportCanvas: typeof supportCanvas;
|
|
45
|
+
chooseLocalFile: typeof chooseLocalFile;
|
|
46
|
+
compressImg: typeof compressImg;
|
|
47
|
+
};
|
|
48
|
+
export default _default;
|
package/dist/types/func.d.ts
CHANGED
|
@@ -47,3 +47,11 @@ export declare function setGlobal(key: string | number | symbol, val?: any): voi
|
|
|
47
47
|
* @param val
|
|
48
48
|
*/
|
|
49
49
|
export declare function getGlobal<T>(key: string | number | symbol): T | void;
|
|
50
|
+
declare const _default: {
|
|
51
|
+
debounce: <F extends AnyFunc>(func: F, wait?: number) => DebounceFunc<F>;
|
|
52
|
+
throttle: <F_1 extends AnyFunc>(func: F_1, wait: number, immediate?: boolean) => ThrottleFunc<F_1>;
|
|
53
|
+
once: <F_2 extends AnyFunc = AnyFunc>(func: F_2) => OnceFunc<F_2>;
|
|
54
|
+
getGlobal: typeof getGlobal;
|
|
55
|
+
setGlobal: typeof setGlobal;
|
|
56
|
+
};
|
|
57
|
+
export default _default;
|
package/dist/types/isEqual.d.ts
CHANGED
package/dist/types/math.d.ts
CHANGED
|
@@ -32,4 +32,11 @@ type NumberType = number | string;
|
|
|
32
32
|
* @example strip(0.09999999999999998) === 0.1 // true
|
|
33
33
|
*/
|
|
34
34
|
export declare function strip(num: NumberType, precision?: number): number;
|
|
35
|
-
|
|
35
|
+
declare const _default: {
|
|
36
|
+
add: (arg1: number, arg2: number) => number;
|
|
37
|
+
subtract: (arg1: number, arg2: number) => number;
|
|
38
|
+
multiply: (arg1: number, arg2: number) => number;
|
|
39
|
+
divide: (arg1: number, arg2: number) => number;
|
|
40
|
+
strip: typeof strip;
|
|
41
|
+
};
|
|
42
|
+
export default _default;
|
package/dist/types/number.d.ts
CHANGED
|
@@ -31,9 +31,9 @@ interface IHumanFileSizeOptions {
|
|
|
31
31
|
* reference: https://zh.wikipedia.org/wiki/%E5%8D%83%E5%AD%97%E8%8A%82
|
|
32
32
|
* @param {number | string} num bytes Number in Bytes
|
|
33
33
|
* @param {IHumanFileSizeOptions} options default: { decimals = 0, si = false, separator = ' ' }
|
|
34
|
-
* si: True to use metric (SI) units, aka powers of 1000,
|
|
34
|
+
* si: True to use metric (SI) units, aka powers of 1000, units is
|
|
35
35
|
* ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'].
|
|
36
|
-
* False to use binary (IEC), aka powers of 1024,
|
|
36
|
+
* False to use binary (IEC), aka powers of 1024, units is
|
|
37
37
|
* ['Byte', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
|
38
38
|
* @returns
|
|
39
39
|
*/
|
|
@@ -46,3 +46,12 @@ export declare function humanFileSize(num: number | string, options?: IHumanFile
|
|
|
46
46
|
*/
|
|
47
47
|
export declare function formatNumber(num: number | string, decimals?: number): string;
|
|
48
48
|
export { formatNumber as formatMoney };
|
|
49
|
+
declare const _default: {
|
|
50
|
+
HEX_POOL: string;
|
|
51
|
+
numberToHex: typeof numberToHex;
|
|
52
|
+
numberAbbr: (num: string | number, units: string[], options?: INumberAbbr) => string;
|
|
53
|
+
humanFileSize: typeof humanFileSize;
|
|
54
|
+
formatNumber: typeof formatNumber;
|
|
55
|
+
formatMoney: typeof formatNumber;
|
|
56
|
+
};
|
|
57
|
+
export default _default;
|
package/dist/types/object.d.ts
CHANGED
|
@@ -67,3 +67,16 @@ export declare function objectGet(obj: AnyObject | AnyArray | undefined, path: s
|
|
|
67
67
|
k: string | undefined;
|
|
68
68
|
v: any | undefined;
|
|
69
69
|
};
|
|
70
|
+
declare const _default: {
|
|
71
|
+
isPlainObject: (obj: unknown) => boolean;
|
|
72
|
+
objectEach: typeof objectEach;
|
|
73
|
+
objectEachAsync: typeof objectEachAsync;
|
|
74
|
+
objectMap: typeof objectMap;
|
|
75
|
+
objectPick: typeof objectPick;
|
|
76
|
+
objectOmit: typeof objectOmit;
|
|
77
|
+
objectAssign: typeof objectAssign;
|
|
78
|
+
objectMerge: typeof objectAssign;
|
|
79
|
+
objectFill: typeof objectFill;
|
|
80
|
+
objectGet: typeof objectGet;
|
|
81
|
+
};
|
|
82
|
+
export default _default;
|
package/dist/types/path.d.ts
CHANGED
|
@@ -11,3 +11,8 @@ export declare const pathNormalize: (path: string) => string;
|
|
|
11
11
|
* @returns {string}
|
|
12
12
|
*/
|
|
13
13
|
export declare const pathJoin: (from: string, ...to: string[]) => string;
|
|
14
|
+
declare const _default: {
|
|
15
|
+
pathJoin: (from: string, ...to: string[]) => string;
|
|
16
|
+
pathNormalize: (path: string) => string;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
package/dist/types/qs.d.ts
CHANGED
|
@@ -19,3 +19,8 @@ export type Replacer = (value: LooseParamValue) => string | null;
|
|
|
19
19
|
* @returns {string}
|
|
20
20
|
*/
|
|
21
21
|
export declare function qsStringify(query: LooseParams, replacer?: Replacer): string;
|
|
22
|
+
declare const _default: {
|
|
23
|
+
qsParse: typeof qsParse;
|
|
24
|
+
qsStringify: typeof qsStringify;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
package/dist/types/random.d.ts
CHANGED
|
@@ -24,3 +24,10 @@ export declare const randomString: RandomString;
|
|
|
24
24
|
* @returns {string}
|
|
25
25
|
*/
|
|
26
26
|
export declare function randomUuid(): string;
|
|
27
|
+
declare const _default: {
|
|
28
|
+
STRING_POOL: string;
|
|
29
|
+
randomNumber: (min: number, max: number) => number;
|
|
30
|
+
randomString: RandomString;
|
|
31
|
+
randomUuid: typeof randomUuid;
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
package/dist/types/string.d.ts
CHANGED
|
@@ -64,3 +64,16 @@ export declare const stringFill: (length: number, value?: string) => string;
|
|
|
64
64
|
* @returns {Record<string, string | string[]>}
|
|
65
65
|
*/
|
|
66
66
|
export declare function parseQueryParams(searchStr?: string): Record<string, string | string[]>;
|
|
67
|
+
declare const _default: {
|
|
68
|
+
stringCamelCase: typeof stringCamelCase;
|
|
69
|
+
stringKebabCase: typeof stringKebabCase;
|
|
70
|
+
STRING_ARABIC_NUMERALS: string;
|
|
71
|
+
STRING_LOWERCASE_ALPHA: string;
|
|
72
|
+
STRING_UPPERCASE_ALPHA: string;
|
|
73
|
+
stringFormat: typeof stringFormat;
|
|
74
|
+
stringAssign: (template: string, data: AnyObject) => string;
|
|
75
|
+
stringEscapeHtml: (html: string) => string;
|
|
76
|
+
stringFill: (length: number, value?: string) => string;
|
|
77
|
+
parseQueryParams: typeof parseQueryParams;
|
|
78
|
+
};
|
|
79
|
+
export default _default;
|
package/dist/types/tooltip.d.ts
CHANGED
|
@@ -33,3 +33,10 @@ declare const tooltipEvent: {
|
|
|
33
33
|
handleMouseLeave: typeof handleMouseLeave;
|
|
34
34
|
};
|
|
35
35
|
export { tooltipEvent };
|
|
36
|
+
declare const _default: {
|
|
37
|
+
tooltipEvent: {
|
|
38
|
+
handleMouseEnter: typeof handleMouseEnter;
|
|
39
|
+
handleMouseLeave: typeof handleMouseLeave;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default _default;
|
package/dist/types/tree.d.ts
CHANGED
|
@@ -133,3 +133,14 @@ export declare function flatTree(treeList: any[], options?: IFieldOptions): any[
|
|
|
133
133
|
* @returns {V[]}
|
|
134
134
|
*/
|
|
135
135
|
export declare function fuzzySearchTree<V>(nodes: V[], filterCondition: IFilterCondition<V>, options?: ISearchTreeOpts): V[];
|
|
136
|
+
declare const _default: {
|
|
137
|
+
forEachDeep: typeof forEachDeep;
|
|
138
|
+
findDeep: typeof findDeep;
|
|
139
|
+
filterDeep: typeof filterDeep;
|
|
140
|
+
mapDeep: typeof mapDeep;
|
|
141
|
+
searchTreeById: typeof searchTreeById;
|
|
142
|
+
formatTree: typeof formatTree;
|
|
143
|
+
flatTree: typeof flatTree;
|
|
144
|
+
fuzzySearchTree: typeof fuzzySearchTree;
|
|
145
|
+
};
|
|
146
|
+
export default _default;
|
package/dist/types/type.d.ts
CHANGED
|
@@ -20,19 +20,19 @@ export interface PromiseFn<T = any, R = T> {
|
|
|
20
20
|
/**
|
|
21
21
|
* 将除指定属性外的所有属性变为必填
|
|
22
22
|
*
|
|
23
|
-
* Change all properties except
|
|
23
|
+
* Change all properties except specified properties to required
|
|
24
24
|
*/
|
|
25
25
|
export type ChangeRequiredExcept<T, K extends keyof T> = Required<Omit<T, K>> & Partial<Pick<T, K>>;
|
|
26
26
|
/**
|
|
27
27
|
* 将指定属性变为可选
|
|
28
28
|
*
|
|
29
|
-
* Change
|
|
29
|
+
* Change specified properties to optional
|
|
30
30
|
*/
|
|
31
31
|
export type ChangeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
32
32
|
/**
|
|
33
33
|
* 将指定属性变为必填
|
|
34
34
|
*
|
|
35
|
-
* Change
|
|
35
|
+
* Change specified properties to required
|
|
36
36
|
*/
|
|
37
37
|
export type ChangeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
38
38
|
export type PartialDeep<T> = {
|
|
@@ -124,4 +124,29 @@ export declare function isEmpty(value: any): boolean;
|
|
|
124
124
|
* Checks if `value` is an NodeList object
|
|
125
125
|
*/
|
|
126
126
|
export declare function isNodeList(value: any): boolean;
|
|
127
|
-
|
|
127
|
+
declare const _default: {
|
|
128
|
+
typeIs: typeof typeIs;
|
|
129
|
+
objectHas: typeof objectHas;
|
|
130
|
+
arrayLike: typeof arrayLike;
|
|
131
|
+
isString: (any: unknown) => any is string;
|
|
132
|
+
isBoolean: (any: unknown) => any is boolean;
|
|
133
|
+
isSymbol: (any: unknown) => any is symbol;
|
|
134
|
+
isBigInt: (any: unknown) => any is bigint;
|
|
135
|
+
isNumber: (any: unknown) => any is number;
|
|
136
|
+
isUndefined: (any: unknown) => any is undefined;
|
|
137
|
+
isNull: (any: unknown) => any is null;
|
|
138
|
+
isPrimitive: (any: unknown) => boolean;
|
|
139
|
+
isNullOrUnDef: typeof isNullOrUnDef;
|
|
140
|
+
isNullish: typeof isNullOrUnDef;
|
|
141
|
+
isObject: (any: unknown) => any is Record<string, unknown>;
|
|
142
|
+
isArray: (any: unknown) => any is unknown[];
|
|
143
|
+
isFunction: (any: unknown) => any is Function;
|
|
144
|
+
isNaN: (any: unknown) => any is number;
|
|
145
|
+
isDate: (any: unknown) => any is Date;
|
|
146
|
+
isError: (any: unknown) => any is Error;
|
|
147
|
+
isRegExp: (any: unknown) => any is RegExp;
|
|
148
|
+
isJsonString: typeof isJsonString;
|
|
149
|
+
isEmpty: typeof isEmpty;
|
|
150
|
+
isNodeList: typeof isNodeList;
|
|
151
|
+
};
|
|
152
|
+
export default _default;
|
package/dist/types/unique.d.ts
CHANGED
|
@@ -18,3 +18,9 @@ export interface UniqueString {
|
|
|
18
18
|
* @returns {string}
|
|
19
19
|
*/
|
|
20
20
|
export declare const uniqueString: UniqueString;
|
|
21
|
+
declare const _default: {
|
|
22
|
+
UNIQUE_NUMBER_SAFE_LENGTH: number;
|
|
23
|
+
uniqueNumber: (length?: number) => string;
|
|
24
|
+
uniqueString: UniqueString;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
package/dist/types/url.d.ts
CHANGED
|
@@ -43,3 +43,10 @@ export declare const urlSetParams: (url: string, setter: AnyObject) => string;
|
|
|
43
43
|
* @returns {string}
|
|
44
44
|
*/
|
|
45
45
|
export declare const urlDelParams: (url: string, removeKeys: string[]) => string;
|
|
46
|
+
declare const _default: {
|
|
47
|
+
urlParse: (url: string, isModernApi?: boolean) => Url;
|
|
48
|
+
urlStringify: (url: Url) => string;
|
|
49
|
+
urlSetParams: (url: string, setter: AnyObject) => string;
|
|
50
|
+
urlDelParams: (url: string, removeKeys: string[]) => string;
|
|
51
|
+
};
|
|
52
|
+
export default _default;
|
|
@@ -64,3 +64,22 @@ export declare const isNumerical: (value: string) => boolean;
|
|
|
64
64
|
* @returns {boolean}
|
|
65
65
|
*/
|
|
66
66
|
export declare const isDigit: (value: string) => boolean;
|
|
67
|
+
declare const _default: {
|
|
68
|
+
EMAIL_REGEX: RegExp;
|
|
69
|
+
HTTP_URL_REGEX: RegExp;
|
|
70
|
+
IPV4_REGEX: RegExp;
|
|
71
|
+
IPV6_REGEX: RegExp;
|
|
72
|
+
PHONE_REGEX: RegExp;
|
|
73
|
+
URL_REGEX: RegExp;
|
|
74
|
+
isDigit: (value: string) => boolean;
|
|
75
|
+
isEmail: (value: string) => boolean;
|
|
76
|
+
isFloat: (value: string) => boolean;
|
|
77
|
+
isIdNo: (value: string) => boolean;
|
|
78
|
+
isInteger: (value: string) => boolean;
|
|
79
|
+
isIpV4: (value: string) => boolean;
|
|
80
|
+
isIpV6: (value: string) => boolean;
|
|
81
|
+
isNumerical: (value: string) => boolean;
|
|
82
|
+
isPhone: (value: string) => boolean;
|
|
83
|
+
isUrl: (url: string, includeFtp?: boolean) => boolean;
|
|
84
|
+
};
|
|
85
|
+
export default _default;
|
package/dist/types/variable.d.ts
CHANGED
|
@@ -68,3 +68,11 @@ export declare function replaceVarFromString(sourceStr: string, targetObj: Recor
|
|
|
68
68
|
* executeInScope("return $.fun.time.now()", scope)
|
|
69
69
|
*/
|
|
70
70
|
export declare function executeInScope(code: string, scope?: Record<string, any>): any;
|
|
71
|
+
declare const _default: {
|
|
72
|
+
escapeRegExp: typeof escapeRegExp;
|
|
73
|
+
executeInScope: typeof executeInScope;
|
|
74
|
+
parseVarFromString: typeof parseVarFromString;
|
|
75
|
+
replaceVarFromString: typeof replaceVarFromString;
|
|
76
|
+
uniqueSymbol: typeof uniqueSymbol;
|
|
77
|
+
};
|
|
78
|
+
export default _default;
|
|
@@ -16,3 +16,7 @@ export interface ICanvasWM {
|
|
|
16
16
|
* @example genCanvasWM({ content: 'QQMusicFE' })
|
|
17
17
|
*/
|
|
18
18
|
export declare function genCanvasWM(content?: string, canvasWM?: ICanvasWM): void;
|
|
19
|
+
declare const _default: {
|
|
20
|
+
genCanvasWM: typeof genCanvasWM;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|