@lntvow/utils 2.0.0 → 2.0.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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +66 -64
- package/dist/index.mjs +128 -127
- package/package.json +2 -4
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function y(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function l(t){return t>10?l(10)+l(t-10):Math.random().toString(36).padEnd(12,"0").slice(2,t+2)}const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function y(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function l(t){return t>10?l(10)+l(t-10):Math.random().toString(36).padEnd(12,"0").slice(2,t+2)}const p=Object.prototype.toString,u=t=>p.call(t),S=(...t)=>console.log(`%c ${t[0]} `,"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",t.slice(1).length>0?t.slice(1):""),w=(...t)=>console.warn(...t),A=(...t)=>console.error(...t),E=t=>u(t)==="[object Map]",C=t=>u(t)==="[object Set]",g=t=>u(t)==="[object Date]",b=t=>u(t)==="[object RegExp]",f=t=>typeof t=="function",$=t=>typeof t=="number",j=t=>typeof t=="string",v=t=>typeof t=="symbol",a=t=>t!==null&&typeof t=="object",M=t=>a(t)&&f(t.then)&&f(t.catch),s=t=>t==null,N=t=>t===void 0,U=t=>t===null;function P(t){return t!=null}function R(t){return typeof t=="boolean"}const d=Array.isArray,h=(t,e)=>Object.hasOwn(t,e),D=(t,e)=>t!==e;function m(t){const e=new WeakMap;function r(n){if(g(n))return new Date(n);if(b(n))return new RegExp(n);if(a(n)){if(e.has(n))return e.get(n);let i={};if(d(n)){i=[],e.set(n,i);for(let o=0;o<n.length;o++)i[o]=r(n[o]);return i}e.set(n,i);for(const o in n)h(n,o)&&(i[o]=r(n[o]));return i}else return n}return r(t)}function O(t,e,r){return d(t)?Z(t,e,r):T(t,e,r)}function T(t,e,r){const n=c(e,r);return Object.keys(t).forEach(o=>{s(e[o])?n[o]=c(t[o],r):n[o]=a(t[o])&&a(e[o])?O(t[o],e[o],r):c(e[o],r)}),n}function Z(t,e,r){if(d(e)){const n=c(e,r);return n.push(...c(t,r)),n}else return c(t,r)}function c(t,e){const{isDeepClone:r=!0}=e||{};return r?m(t):t}function x(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}function F(t,e=500){let r=null;return function(...n){if(s(r))return r=Date.now(),t.apply(this,n);{const i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}}function L(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function I(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function z(t){return/^(?:(?:\+|00)86)?1(?:(?:3\d)|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8\d)|(?:9[1589]))\d{8}$/.test(t)}function _(t){return/^([\w-])+@([\w-])+(.[\w-])+/.test(t)}function B(t){return/^[A-Z]+$/.test(t)}function K(t){return!s(t)&&/^[a-z]+$/.test(t)}function W(t){return/^\d+$/.test(t)}function q(t){return/^-?\d{1,3}\.\d{6}$/.test(t)}function G(t){return t===""}function H(t){return!s(t)&&/^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t)}function J(t){return!s(t)&&/^[A-Za-z\u4E00-\u9FA5]+$/.test(t)}function Q(t){return!s(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function V(t){return/^[\dA-Z_]+$/.test(t)}function X(t){return/^[1-9]\d*$/.test(t)}function Y(t){return/^\d+$/.test(t)}function k(t){return/^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t)}function tt(t){return Array.isArray(t)?t:[t]}exports.castArray=tt;exports.compose=L;exports.composeRight=I;exports.debounce=x;exports.deepClone=m;exports.deepMerge=O;exports.error=A;exports.getRandomColor=y;exports.getRandomString=l;exports.hasChanged=D;exports.hasOwn=h;exports.isArray=d;exports.isBoolean=R;exports.isDate=g;exports.isDef=P;exports.isEmptyString=G;exports.isFunction=f;exports.isMap=E;exports.isNull=U;exports.isNumber=$;exports.isObject=a;exports.isPromise=M;exports.isRegExp=b;exports.isSet=C;exports.isString=j;exports.isSymbol=v;exports.isUndef=s;exports.isUndefined=N;exports.log=S;exports.objectToString=p;exports.throttle=F;exports.toTypeString=u;exports.validatorChineseOrEnglish=J;exports.validatorChineseOrEnglishOrNumber=H;exports.validatorEmail=_;exports.validatorLatitudeOrLongitude=q;exports.validatorLowerCase=K;exports.validatorMobilePhone=z;exports.validatorNumber=W;exports.validatorPositiveFloat=k;exports.validatorPositiveInt=X;exports.validatorPositiveIntAndZero=Y;exports.validatorUpperCase=B;exports.validatorUppercaseOrNumbersOrSpecial=Q;exports.validatorUppercaseOrNumbersOrUnderline=V;exports.warn=w;
|
package/dist/index.d.ts
CHANGED
|
@@ -67,25 +67,10 @@ export declare const isArray: (arg: any) => arg is any[];
|
|
|
67
67
|
|
|
68
68
|
export declare function isBoolean(val: unknown): val is boolean;
|
|
69
69
|
|
|
70
|
-
/**
|
|
71
|
-
* @description 校验中英文
|
|
72
|
-
*/
|
|
73
|
-
export declare function isChineseOrEnglish(value: string): boolean;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @description 校验中文、字母、数字
|
|
77
|
-
*/
|
|
78
|
-
export declare function isChineseOrEnglishOrNumber(value: string): boolean;
|
|
79
|
-
|
|
80
70
|
export declare const isDate: (val: unknown) => val is Date;
|
|
81
71
|
|
|
82
72
|
export declare function isDef<T>(val: T): val is NonNullable<T>;
|
|
83
73
|
|
|
84
|
-
/**
|
|
85
|
-
* @description 校验邮箱
|
|
86
|
-
*/
|
|
87
|
-
export declare function isEmail(value: string): boolean;
|
|
88
|
-
|
|
89
74
|
/**
|
|
90
75
|
* @description 校验空字符串
|
|
91
76
|
*/
|
|
@@ -93,47 +78,14 @@ export declare function isEmptyString(value: string): boolean;
|
|
|
93
78
|
|
|
94
79
|
export declare const isFunction: (val: unknown) => val is Function;
|
|
95
80
|
|
|
96
|
-
/**
|
|
97
|
-
* @description 校验经纬度
|
|
98
|
-
*/
|
|
99
|
-
export declare function isLatitudeOrLongitude(value: string): boolean;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @description 校验小写字母
|
|
103
|
-
*/
|
|
104
|
-
export declare function isLowerCase(value: string): boolean;
|
|
105
|
-
|
|
106
81
|
export declare const isMap: (val: unknown) => val is Map<any, any>;
|
|
107
82
|
|
|
108
|
-
/**
|
|
109
|
-
* @description 校验手机号
|
|
110
|
-
*/
|
|
111
|
-
export declare function isMobilePhone(value: string): boolean;
|
|
112
|
-
|
|
113
83
|
export declare const isNull: (val: unknown) => val is null;
|
|
114
84
|
|
|
115
|
-
|
|
116
|
-
* @description 校验校验数字
|
|
117
|
-
*/
|
|
118
|
-
export declare function isNumber(value: string): boolean;
|
|
85
|
+
export declare const isNumber: (val: unknown) => val is number;
|
|
119
86
|
|
|
120
87
|
export declare const isObject: (val: unknown) => val is Record<any, any>;
|
|
121
88
|
|
|
122
|
-
/**
|
|
123
|
-
* @description 校验正浮点数
|
|
124
|
-
*/
|
|
125
|
-
export declare function isPositiveFloat(value: string): boolean;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* @description 校验正整数
|
|
129
|
-
*/
|
|
130
|
-
export declare function isPositiveInt(value: string): boolean;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @description 校验大于0的整数
|
|
134
|
-
*/
|
|
135
|
-
export declare function isPositiveIntAndZero(value: string): boolean;
|
|
136
|
-
|
|
137
89
|
export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
|
138
90
|
|
|
139
91
|
export declare const isRegExp: (val: unknown) => val is RegExp;
|
|
@@ -148,21 +100,6 @@ export declare const isUndef: (val: unknown) => val is null | undefined;
|
|
|
148
100
|
|
|
149
101
|
export declare const isUndefined: (val: unknown) => val is undefined;
|
|
150
102
|
|
|
151
|
-
/**
|
|
152
|
-
* @description 校验大写字母
|
|
153
|
-
*/
|
|
154
|
-
export declare function isUpperCase(value: string): boolean;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @description 校验大写字母、数字、特殊字符 特殊字符包括 !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
|
158
|
-
*/
|
|
159
|
-
export declare function isUppercaseOrNumbersOrSpecial(value: string): boolean;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* @description 校验大写字母、数字、_
|
|
163
|
-
*/
|
|
164
|
-
export declare function isUppercaseOrNumbersOrUnderline(value: string): boolean;
|
|
165
|
-
|
|
166
103
|
export declare const log: (...arg: unknown[]) => void;
|
|
167
104
|
|
|
168
105
|
export declare const objectToString: () => string;
|
|
@@ -185,6 +122,71 @@ export declare function throttle(target: Function, wait?: number): (...args: any
|
|
|
185
122
|
|
|
186
123
|
export declare const toTypeString: (value: unknown) => string;
|
|
187
124
|
|
|
125
|
+
/**
|
|
126
|
+
* @description 校验中英文
|
|
127
|
+
*/
|
|
128
|
+
export declare function validatorChineseOrEnglish(value: string): boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @description 校验中文、字母、数字
|
|
132
|
+
*/
|
|
133
|
+
export declare function validatorChineseOrEnglishOrNumber(value: string): boolean;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @description 校验邮箱
|
|
137
|
+
*/
|
|
138
|
+
export declare function validatorEmail(value: string): boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @description 校验经纬度
|
|
142
|
+
*/
|
|
143
|
+
export declare function validatorLatitudeOrLongitude(value: string): boolean;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @description 校验小写字母
|
|
147
|
+
*/
|
|
148
|
+
export declare function validatorLowerCase(value: string): boolean;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @description 校验手机号
|
|
152
|
+
*/
|
|
153
|
+
export declare function validatorMobilePhone(value: string): boolean;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @description 校验校验数字
|
|
157
|
+
*/
|
|
158
|
+
export declare function validatorNumber(value: string): boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @description 校验正浮点数
|
|
162
|
+
*/
|
|
163
|
+
export declare function validatorPositiveFloat(value: string): boolean;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @description 校验正整数
|
|
167
|
+
*/
|
|
168
|
+
export declare function validatorPositiveInt(value: string): boolean;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @description 校验大于0的整数
|
|
172
|
+
*/
|
|
173
|
+
export declare function validatorPositiveIntAndZero(value: string): boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @description 校验大写字母
|
|
177
|
+
*/
|
|
178
|
+
export declare function validatorUpperCase(value: string): boolean;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @description 校验大写字母、数字、特殊字符 特殊字符包括 !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
|
182
|
+
*/
|
|
183
|
+
export declare function validatorUppercaseOrNumbersOrSpecial(value: string): boolean;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @description 校验大写字母、数字、_
|
|
187
|
+
*/
|
|
188
|
+
export declare function validatorUppercaseOrNumbersOrUnderline(value: string): boolean;
|
|
189
|
+
|
|
188
190
|
export declare const warn: (...arg: unknown[]) => void;
|
|
189
191
|
|
|
190
192
|
export { }
|
package/dist/index.mjs
CHANGED
|
@@ -1,188 +1,189 @@
|
|
|
1
1
|
function $() {
|
|
2
2
|
return `#${Math.random().toString(16).slice(2, 8).padEnd(6, "0")}`;
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function a(t) {
|
|
5
|
+
return t > 10 ? a(10) + a(t - 10) : Math.random().toString(36).padEnd(12, "0").slice(2, t + 2);
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
`%c ${
|
|
7
|
+
const p = Object.prototype.toString, f = (t) => p.call(t), A = (...t) => console.log(
|
|
8
|
+
`%c ${t[0]} `,
|
|
9
9
|
"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",
|
|
10
|
-
|
|
11
|
-
), E = (...
|
|
12
|
-
function Z(
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
function
|
|
16
|
-
return typeof
|
|
17
|
-
}
|
|
18
|
-
const d = Array.isArray, b = (
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
23
|
-
return new Date(
|
|
24
|
-
if (h(
|
|
25
|
-
return new RegExp(
|
|
26
|
-
if (u(
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
10
|
+
t.slice(1).length > 0 ? t.slice(1) : ""
|
|
11
|
+
), E = (...t) => console.warn(...t), S = (...t) => console.error(...t), j = (t) => f(t) === "[object Map]", C = (t) => f(t) === "[object Set]", g = (t) => f(t) === "[object Date]", h = (t) => f(t) === "[object RegExp]", l = (t) => typeof t == "function", M = (t) => typeof t == "number", D = (t) => typeof t == "string", x = (t) => typeof t == "symbol", u = (t) => t !== null && typeof t == "object", N = (t) => u(t) && l(t.then) && l(t.catch), c = (t) => t == null, R = (t) => t === void 0, U = (t) => t === null;
|
|
12
|
+
function Z(t) {
|
|
13
|
+
return t != null;
|
|
14
|
+
}
|
|
15
|
+
function P(t) {
|
|
16
|
+
return typeof t == "boolean";
|
|
17
|
+
}
|
|
18
|
+
const d = Array.isArray, b = (t, r) => Object.hasOwn(t, r), F = (t, r) => t !== r;
|
|
19
|
+
function m(t) {
|
|
20
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
21
|
+
function e(n) {
|
|
22
|
+
if (g(n))
|
|
23
|
+
return new Date(n);
|
|
24
|
+
if (h(n))
|
|
25
|
+
return new RegExp(n);
|
|
26
|
+
if (u(n)) {
|
|
27
|
+
if (r.has(n))
|
|
28
|
+
return r.get(n);
|
|
29
29
|
let i = {};
|
|
30
|
-
if (d(
|
|
31
|
-
i = [],
|
|
32
|
-
for (let o = 0; o <
|
|
33
|
-
i[o] =
|
|
30
|
+
if (d(n)) {
|
|
31
|
+
i = [], r.set(n, i);
|
|
32
|
+
for (let o = 0; o < n.length; o++)
|
|
33
|
+
i[o] = e(n[o]);
|
|
34
34
|
return i;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
for (const o in
|
|
38
|
-
b(
|
|
36
|
+
r.set(n, i);
|
|
37
|
+
for (const o in n)
|
|
38
|
+
b(n, o) && (i[o] = e(n[o]));
|
|
39
39
|
return i;
|
|
40
40
|
} else
|
|
41
|
-
return
|
|
41
|
+
return n;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return e(t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return d(
|
|
45
|
+
function y(t, r, e) {
|
|
46
|
+
return d(t) ? O(t, r, e) : w(t, r, e);
|
|
47
47
|
}
|
|
48
|
-
function w(
|
|
49
|
-
const
|
|
50
|
-
return Object.keys(
|
|
51
|
-
c(
|
|
52
|
-
}),
|
|
48
|
+
function w(t, r, e) {
|
|
49
|
+
const n = s(r, e);
|
|
50
|
+
return Object.keys(t).forEach((o) => {
|
|
51
|
+
c(r[o]) ? n[o] = s(t[o], e) : n[o] = u(t[o]) && u(r[o]) ? y(t[o], r[o], e) : s(r[o], e);
|
|
52
|
+
}), n;
|
|
53
53
|
}
|
|
54
|
-
function O(
|
|
55
|
-
if (d(
|
|
56
|
-
const
|
|
57
|
-
return
|
|
54
|
+
function O(t, r, e) {
|
|
55
|
+
if (d(r)) {
|
|
56
|
+
const n = s(r, e);
|
|
57
|
+
return n.push(...s(t, e)), n;
|
|
58
58
|
} else
|
|
59
|
-
return s(
|
|
60
|
-
}
|
|
61
|
-
function s(
|
|
62
|
-
const { isDeepClone:
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
function
|
|
66
|
-
let
|
|
67
|
-
return function(...
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
59
|
+
return s(t, e);
|
|
60
|
+
}
|
|
61
|
+
function s(t, r) {
|
|
62
|
+
const { isDeepClone: e = !0 } = r || {};
|
|
63
|
+
return e ? m(t) : t;
|
|
64
|
+
}
|
|
65
|
+
function T(t, r = 500) {
|
|
66
|
+
let e = null;
|
|
67
|
+
return function(...n) {
|
|
68
|
+
e && clearTimeout(e), e = setTimeout(() => {
|
|
69
|
+
t.apply(this, n);
|
|
70
|
+
}, r);
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
let
|
|
75
|
-
return function(...
|
|
76
|
-
if (c(
|
|
77
|
-
return
|
|
73
|
+
function z(t, r = 500) {
|
|
74
|
+
let e = null;
|
|
75
|
+
return function(...n) {
|
|
76
|
+
if (c(e))
|
|
77
|
+
return e = Date.now(), t.apply(this, n);
|
|
78
78
|
{
|
|
79
79
|
const i = Date.now();
|
|
80
|
-
if (i -
|
|
81
|
-
return
|
|
80
|
+
if (i - e >= r)
|
|
81
|
+
return e = i, t.apply(this, n);
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
87
|
-
return r(
|
|
85
|
+
function L(...t) {
|
|
86
|
+
return t.reduce((r, e) => function(...n) {
|
|
87
|
+
return e(r(...n));
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
92
|
-
return e(
|
|
90
|
+
function _(...t) {
|
|
91
|
+
return t.reduce((r, e) => function(...n) {
|
|
92
|
+
return r(e(...n));
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function I(t) {
|
|
96
96
|
return /^(?:(?:\+|00)86)?1(?:(?:3\d)|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8\d)|(?:9[1589]))\d{8}$/.test(
|
|
97
|
-
|
|
97
|
+
t
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return /^([\w-])+@([\w-])+(.[\w-])+/.test(
|
|
100
|
+
function K(t) {
|
|
101
|
+
return /^([\w-])+@([\w-])+(.[\w-])+/.test(t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return /^[A-Z]+$/.test(
|
|
103
|
+
function B(t) {
|
|
104
|
+
return /^[A-Z]+$/.test(t);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return !c(
|
|
106
|
+
function W(t) {
|
|
107
|
+
return !c(t) && /^[a-z]+$/.test(t);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return /^\d+$/.test(
|
|
109
|
+
function q(t) {
|
|
110
|
+
return /^\d+$/.test(t);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
return /^-?\d{1,3}\.\d{6}$/.test(
|
|
112
|
+
function G(t) {
|
|
113
|
+
return /^-?\d{1,3}\.\d{6}$/.test(t);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function H(t) {
|
|
116
|
+
return t === "";
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
return !c(
|
|
118
|
+
function J(t) {
|
|
119
|
+
return !c(t) && /^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return !c(
|
|
121
|
+
function Q(t) {
|
|
122
|
+
return !c(t) && /^[A-Za-z\u4E00-\u9FA5]+$/.test(t);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
return !c(
|
|
124
|
+
function V(t) {
|
|
125
|
+
return !c(t) && /^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
return /^[\dA-Z_]+$/.test(
|
|
127
|
+
function X(t) {
|
|
128
|
+
return /^[\dA-Z_]+$/.test(t);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
return /^[1-9]\d*$/.test(
|
|
130
|
+
function Y(t) {
|
|
131
|
+
return /^[1-9]\d*$/.test(t);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return /^\d+$/.test(
|
|
133
|
+
function k(t) {
|
|
134
|
+
return /^\d+$/.test(t);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return /^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(
|
|
136
|
+
function v(t) {
|
|
137
|
+
return /^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return Array.isArray(
|
|
139
|
+
function tt(t) {
|
|
140
|
+
return Array.isArray(t) ? t : [t];
|
|
141
141
|
}
|
|
142
142
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
tt as castArray,
|
|
144
|
+
L as compose,
|
|
145
|
+
_ as composeRight,
|
|
146
|
+
T as debounce,
|
|
147
|
+
m as deepClone,
|
|
148
|
+
y as deepMerge,
|
|
149
149
|
S as error,
|
|
150
150
|
$ as getRandomColor,
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
a as getRandomString,
|
|
152
|
+
F as hasChanged,
|
|
153
153
|
b as hasOwn,
|
|
154
154
|
d as isArray,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
H as isChineseOrEnglishOrNumber,
|
|
158
|
-
a as isDate,
|
|
155
|
+
P as isBoolean,
|
|
156
|
+
g as isDate,
|
|
159
157
|
Z as isDef,
|
|
160
|
-
|
|
161
|
-
G as isEmptyString,
|
|
158
|
+
H as isEmptyString,
|
|
162
159
|
l as isFunction,
|
|
163
|
-
q as isLatitudeOrLongitude,
|
|
164
|
-
B as isLowerCase,
|
|
165
160
|
j as isMap,
|
|
166
|
-
_ as isMobilePhone,
|
|
167
161
|
U as isNull,
|
|
168
|
-
|
|
162
|
+
M as isNumber,
|
|
169
163
|
u as isObject,
|
|
170
|
-
|
|
171
|
-
X as isPositiveInt,
|
|
172
|
-
Y as isPositiveIntAndZero,
|
|
173
|
-
x as isPromise,
|
|
164
|
+
N as isPromise,
|
|
174
165
|
h as isRegExp,
|
|
175
166
|
C as isSet,
|
|
176
|
-
|
|
177
|
-
|
|
167
|
+
D as isString,
|
|
168
|
+
x as isSymbol,
|
|
178
169
|
c as isUndef,
|
|
179
170
|
R as isUndefined,
|
|
180
|
-
K as isUpperCase,
|
|
181
|
-
Q as isUppercaseOrNumbersOrSpecial,
|
|
182
|
-
V as isUppercaseOrNumbersOrUnderline,
|
|
183
171
|
A as log,
|
|
184
|
-
|
|
185
|
-
|
|
172
|
+
p as objectToString,
|
|
173
|
+
z as throttle,
|
|
186
174
|
f as toTypeString,
|
|
175
|
+
Q as validatorChineseOrEnglish,
|
|
176
|
+
J as validatorChineseOrEnglishOrNumber,
|
|
177
|
+
K as validatorEmail,
|
|
178
|
+
G as validatorLatitudeOrLongitude,
|
|
179
|
+
W as validatorLowerCase,
|
|
180
|
+
I as validatorMobilePhone,
|
|
181
|
+
q as validatorNumber,
|
|
182
|
+
v as validatorPositiveFloat,
|
|
183
|
+
Y as validatorPositiveInt,
|
|
184
|
+
k as validatorPositiveIntAndZero,
|
|
185
|
+
B as validatorUpperCase,
|
|
186
|
+
V as validatorUppercaseOrNumbersOrSpecial,
|
|
187
|
+
X as validatorUppercaseOrNumbersOrUnderline,
|
|
187
188
|
E as warn
|
|
188
189
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "工具库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,9 +23,7 @@
|
|
|
23
23
|
"vite-plugin-dts": "3.3.1",
|
|
24
24
|
"vitest": "^0.33.0"
|
|
25
25
|
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"vconsole": "^3.15.1"
|
|
28
|
-
},
|
|
26
|
+
"dependencies": {},
|
|
29
27
|
"scripts": {
|
|
30
28
|
"dev": "vite",
|
|
31
29
|
"test": "vitest",
|