@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 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 a=Object.prototype.toString,f=t=>a.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=>f(t)==="[object Map]",C=t=>f(t)==="[object Set]",g=t=>f(t)==="[object Date]",h=t=>f(t)==="[object RegExp]",p=t=>typeof t=="function",$=t=>typeof t=="string",j=t=>typeof t=="symbol",u=t=>t!==null&&typeof t=="object",M=t=>u(t)&&p(t.then)&&p(t.catch),o=t=>t==null,U=t=>t===void 0,P=t=>t===null;function N(t){return t!=null}function R(t){return typeof t=="boolean"}const d=Array.isArray,b=(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(h(n))return new RegExp(n);if(u(n)){if(e.has(n))return e.get(n);let s={};if(d(n)){s=[],e.set(n,s);for(let i=0;i<n.length;i++)s[i]=r(n[i]);return s}e.set(n,s);for(const i in n)b(n,i)&&(s[i]=r(n[i]));return s}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(i=>{o(e[i])?n[i]=c(t[i],r):n[i]=u(t[i])&&u(e[i])?O(t[i],e[i],r):c(e[i],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(o(r))return r=Date.now(),t.apply(this,n);{const s=Date.now();if(s-r>=e)return r=s,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!o(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!o(t)&&/^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t)}function J(t){return!o(t)&&/^[A-Za-z\u4E00-\u9FA5]+$/.test(t)}function Q(t){return!o(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 v(t){return Array.isArray(t)?t:[t]}exports.castArray=v;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=b;exports.isArray=d;exports.isBoolean=R;exports.isChineseOrEnglish=J;exports.isChineseOrEnglishOrNumber=H;exports.isDate=g;exports.isDef=N;exports.isEmail=_;exports.isEmptyString=G;exports.isFunction=p;exports.isLatitudeOrLongitude=q;exports.isLowerCase=K;exports.isMap=E;exports.isMobilePhone=z;exports.isNull=P;exports.isNumber=W;exports.isObject=u;exports.isPositiveFloat=k;exports.isPositiveInt=X;exports.isPositiveIntAndZero=Y;exports.isPromise=M;exports.isRegExp=h;exports.isSet=C;exports.isString=$;exports.isSymbol=j;exports.isUndef=o;exports.isUndefined=U;exports.isUpperCase=B;exports.isUppercaseOrNumbersOrSpecial=Q;exports.isUppercaseOrNumbersOrUnderline=V;exports.log=S;exports.objectToString=a;exports.throttle=F;exports.toTypeString=f;exports.warn=w;
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 p(n) {
5
- return n > 10 ? p(10) + p(n - 10) : Math.random().toString(36).padEnd(12, "0").slice(2, n + 2);
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 g = Object.prototype.toString, f = (n) => g.call(n), A = (...n) => console.log(
8
- `%c ${n[0]} `,
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
- n.slice(1).length > 0 ? n.slice(1) : ""
11
- ), E = (...n) => console.warn(...n), S = (...n) => console.error(...n), j = (n) => f(n) === "[object Map]", C = (n) => f(n) === "[object Set]", a = (n) => f(n) === "[object Date]", h = (n) => f(n) === "[object RegExp]", l = (n) => typeof n == "function", M = (n) => typeof n == "string", D = (n) => typeof n == "symbol", u = (n) => n !== null && typeof n == "object", x = (n) => u(n) && l(n.then) && l(n.catch), c = (n) => n == null, R = (n) => n === void 0, U = (n) => n === null;
12
- function Z(n) {
13
- return n != null;
14
- }
15
- function N(n) {
16
- return typeof n == "boolean";
17
- }
18
- const d = Array.isArray, b = (n, e) => Object.hasOwn(n, e), P = (n, e) => n !== e;
19
- function y(n) {
20
- const e = /* @__PURE__ */ new WeakMap();
21
- function r(t) {
22
- if (a(t))
23
- return new Date(t);
24
- if (h(t))
25
- return new RegExp(t);
26
- if (u(t)) {
27
- if (e.has(t))
28
- return e.get(t);
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(t)) {
31
- i = [], e.set(t, i);
32
- for (let o = 0; o < t.length; o++)
33
- i[o] = r(t[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
- e.set(t, i);
37
- for (const o in t)
38
- b(t, o) && (i[o] = r(t[o]));
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 t;
41
+ return n;
42
42
  }
43
- return r(n);
43
+ return e(t);
44
44
  }
45
- function m(n, e, r) {
46
- return d(n) ? O(n, e, r) : w(n, e, r);
45
+ function y(t, r, e) {
46
+ return d(t) ? O(t, r, e) : w(t, r, e);
47
47
  }
48
- function w(n, e, r) {
49
- const t = s(e, r);
50
- return Object.keys(n).forEach((o) => {
51
- c(e[o]) ? t[o] = s(n[o], r) : t[o] = u(n[o]) && u(e[o]) ? m(n[o], e[o], r) : s(e[o], r);
52
- }), t;
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(n, e, r) {
55
- if (d(e)) {
56
- const t = s(e, r);
57
- return t.push(...s(n, r)), t;
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(n, r);
60
- }
61
- function s(n, e) {
62
- const { isDeepClone: r = !0 } = e || {};
63
- return r ? y(n) : n;
64
- }
65
- function F(n, e = 500) {
66
- let r = null;
67
- return function(...t) {
68
- r && clearTimeout(r), r = setTimeout(() => {
69
- n.apply(this, t);
70
- }, e);
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 T(n, e = 500) {
74
- let r = null;
75
- return function(...t) {
76
- if (c(r))
77
- return r = Date.now(), n.apply(this, t);
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 - r >= e)
81
- return r = i, n.apply(this, t);
80
+ if (i - e >= r)
81
+ return e = i, t.apply(this, n);
82
82
  }
83
83
  };
84
84
  }
85
- function z(...n) {
86
- return n.reduce((e, r) => function(...t) {
87
- return r(e(...t));
85
+ function L(...t) {
86
+ return t.reduce((r, e) => function(...n) {
87
+ return e(r(...n));
88
88
  });
89
89
  }
90
- function L(...n) {
91
- return n.reduce((e, r) => function(...t) {
92
- return e(r(...t));
90
+ function _(...t) {
91
+ return t.reduce((r, e) => function(...n) {
92
+ return r(e(...n));
93
93
  });
94
94
  }
95
- function _(n) {
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
- n
97
+ t
98
98
  );
99
99
  }
100
- function I(n) {
101
- return /^([\w-])+@([\w-])+(.[\w-])+/.test(n);
100
+ function K(t) {
101
+ return /^([\w-])+@([\w-])+(.[\w-])+/.test(t);
102
102
  }
103
- function K(n) {
104
- return /^[A-Z]+$/.test(n);
103
+ function B(t) {
104
+ return /^[A-Z]+$/.test(t);
105
105
  }
106
- function B(n) {
107
- return !c(n) && /^[a-z]+$/.test(n);
106
+ function W(t) {
107
+ return !c(t) && /^[a-z]+$/.test(t);
108
108
  }
109
- function W(n) {
110
- return /^\d+$/.test(n);
109
+ function q(t) {
110
+ return /^\d+$/.test(t);
111
111
  }
112
- function q(n) {
113
- return /^-?\d{1,3}\.\d{6}$/.test(n);
112
+ function G(t) {
113
+ return /^-?\d{1,3}\.\d{6}$/.test(t);
114
114
  }
115
- function G(n) {
116
- return n === "";
115
+ function H(t) {
116
+ return t === "";
117
117
  }
118
- function H(n) {
119
- return !c(n) && /^[\dA-Za-z\u4E00-\u9FA5]+$/.test(n);
118
+ function J(t) {
119
+ return !c(t) && /^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t);
120
120
  }
121
- function J(n) {
122
- return !c(n) && /^[A-Za-z\u4E00-\u9FA5]+$/.test(n);
121
+ function Q(t) {
122
+ return !c(t) && /^[A-Za-z\u4E00-\u9FA5]+$/.test(t);
123
123
  }
124
- function Q(n) {
125
- return !c(n) && /^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(n);
124
+ function V(t) {
125
+ return !c(t) && /^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t);
126
126
  }
127
- function V(n) {
128
- return /^[\dA-Z_]+$/.test(n);
127
+ function X(t) {
128
+ return /^[\dA-Z_]+$/.test(t);
129
129
  }
130
- function X(n) {
131
- return /^[1-9]\d*$/.test(n);
130
+ function Y(t) {
131
+ return /^[1-9]\d*$/.test(t);
132
132
  }
133
- function Y(n) {
134
- return /^\d+$/.test(n);
133
+ function k(t) {
134
+ return /^\d+$/.test(t);
135
135
  }
136
- function k(n) {
137
- return /^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(n);
136
+ function v(t) {
137
+ return /^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t);
138
138
  }
139
- function v(n) {
140
- return Array.isArray(n) ? n : [n];
139
+ function tt(t) {
140
+ return Array.isArray(t) ? t : [t];
141
141
  }
142
142
  export {
143
- v as castArray,
144
- z as compose,
145
- L as composeRight,
146
- F as debounce,
147
- y as deepClone,
148
- m as deepMerge,
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
- p as getRandomString,
152
- P as hasChanged,
151
+ a as getRandomString,
152
+ F as hasChanged,
153
153
  b as hasOwn,
154
154
  d as isArray,
155
- N as isBoolean,
156
- J as isChineseOrEnglish,
157
- H as isChineseOrEnglishOrNumber,
158
- a as isDate,
155
+ P as isBoolean,
156
+ g as isDate,
159
157
  Z as isDef,
160
- I as isEmail,
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
- W as isNumber,
162
+ M as isNumber,
169
163
  u as isObject,
170
- k as isPositiveFloat,
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
- M as isString,
177
- D as isSymbol,
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
- g as objectToString,
185
- T as throttle,
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.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",