@xn-lib/base 0.0.18 → 0.0.20
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.cjs +1 -1
- package/dist/index.d.ts +785 -6
- package/dist/index.iife.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
- package/dist/types/base.utils.d.ts +0 -261
- package/dist/types/data.utils.d.ts +0 -194
- package/dist/types/date.utils.d.ts +0 -157
- package/dist/types/index.d.ts +0 -6
- package/dist/types/md5.utils.d.ts +0 -2
- package/dist/types/tree.utils.d.ts +0 -66
- package/dist/types/validate.utils.d.ts +0 -94
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 各类数据及类型的校验
|
|
3
|
-
* */
|
|
4
|
-
/**
|
|
5
|
-
* 校验是否为有效的url
|
|
6
|
-
* 仅格式校验,不做严各的真实性校验
|
|
7
|
-
* @param {string} content url内容
|
|
8
|
-
* @return {boolean}
|
|
9
|
-
* */
|
|
10
|
-
export declare function isURL(content: string): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 是否为数字
|
|
13
|
-
* 范围:正负数、浮点数
|
|
14
|
-
* @param value 数值
|
|
15
|
-
* @param floatLength 小数位数,默认不限
|
|
16
|
-
* */
|
|
17
|
-
export declare function isNumber(value: any, floatLength?: number): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* 是否为整数
|
|
20
|
-
* 范围:正负数
|
|
21
|
-
* @param {any} value 数值
|
|
22
|
-
* @return {boolean}
|
|
23
|
-
*/
|
|
24
|
-
export declare function isInteger(value: any): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 是否为非0的有效数字
|
|
27
|
-
* @param value 数值
|
|
28
|
-
*/
|
|
29
|
-
export declare function isNumberNot0(value: number | string): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* 是否为浮点数字
|
|
32
|
-
* @description 范围:正整数、浮点正数(无符号)
|
|
33
|
-
* @param value 必选,被校验的值 (.11 这样的数字在校验时会自动转为0.11)
|
|
34
|
-
* @param length 可选,浮点位数,默认 2
|
|
35
|
-
* */
|
|
36
|
-
export declare function isFloat(value: string, length?: number): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* 是否为正整数
|
|
39
|
-
* @description 范围:正整数
|
|
40
|
-
* @param value 必选,被校验的值
|
|
41
|
-
* */
|
|
42
|
-
export declare function isPositiveFloat(value: string): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* 是否为空
|
|
45
|
-
* @param target 目标对象
|
|
46
|
-
* @return {boolean}
|
|
47
|
-
*/
|
|
48
|
-
export declare function isEmpty(target: any): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* 是否为Object对象
|
|
51
|
-
* @param {any} target 需要校验的目标
|
|
52
|
-
* @param {Boolean} [isEmpty] 是否允许为空对象
|
|
53
|
-
* @return {boolean}
|
|
54
|
-
* */
|
|
55
|
-
export declare function isObject(target: any, isEmpty?: boolean): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* 是否为空Object对象
|
|
58
|
-
* @param {any} target 需要校验的目标
|
|
59
|
-
* @return {boolean}
|
|
60
|
-
* */
|
|
61
|
-
export declare function isEmptyObject(target: any): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* 判断空值,'undefined'、null、''
|
|
64
|
-
* @param {any} value 任意形式的值
|
|
65
|
-
* */
|
|
66
|
-
export declare function isEmptyValue(value: any): boolean;
|
|
67
|
-
export declare function isFunc(func: any): boolean;
|
|
68
|
-
export declare function isUndefined(value: any): value is undefined;
|
|
69
|
-
export declare function isString(value: any): value is string;
|
|
70
|
-
export declare function isMobilePhone(value: any): boolean;
|
|
71
|
-
export declare function isEmail(value: any): boolean;
|
|
72
|
-
export declare function isChinese(string: any): RegExpExecArray | null;
|
|
73
|
-
export declare function isPromise(target: any): boolean;
|
|
74
|
-
export declare function isBlob(value: any): boolean;
|
|
75
|
-
export declare function isColor(value: string): boolean;
|
|
76
|
-
export declare const compareNumberAb: (a?: string, b?: string, label?: string, isAmount?: boolean) => string;
|
|
77
|
-
export declare const replaceSpaceAndChineseComma: (value: string) => string;
|
|
78
|
-
export declare const Regs: {
|
|
79
|
-
ios: RegExp;
|
|
80
|
-
android: RegExp;
|
|
81
|
-
harmony: RegExp;
|
|
82
|
-
wechat: RegExp;
|
|
83
|
-
alipay: RegExp;
|
|
84
|
-
chrome: RegExp;
|
|
85
|
-
phone: RegExp;
|
|
86
|
-
};
|
|
87
|
-
export declare function getDeviceInfo(): {
|
|
88
|
-
os: Record<any, any>;
|
|
89
|
-
browser: Record<any, any>;
|
|
90
|
-
};
|
|
91
|
-
export declare function detect(ua: string): {
|
|
92
|
-
os: Record<any, any>;
|
|
93
|
-
browser: Record<any, any>;
|
|
94
|
-
};
|