@lntvow/utils 2.1.7 → 2.1.9

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 S(t){const n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let e="";for(let r=0;r<t;r++){const i=Math.floor(Math.random()*n.length);e+=n.charAt(i)}return e}const p=Object.prototype.toString,u=t=>p.call(t);let f=null;function w(t){d(t)&&(f=t)}const A=(t,...n)=>{const e=n.length===0?"":n.length===1?n[0]:n;console.log(`%c ${t} `,"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",e),f&&f(t,e)},C=(...t)=>console.warn(...t),E=(...t)=>console.error(...t),j=t=>u(t)==="[object Map]",$=t=>u(t)==="[object Set]",g=t=>u(t)==="[object Date]",h=t=>u(t)==="[object RegExp]",d=t=>typeof t=="function",M=t=>typeof t=="number",v=t=>typeof t=="string",N=t=>typeof t=="symbol",a=t=>t!==null&&typeof t=="object",U=t=>a(t)&&d(t.then)&&d(t.catch),s=t=>t==null,P=t=>t===void 0,R=t=>t===null,D=t=>t!=null,x=t=>typeof t=="boolean",l=Array.isArray,b=(t,n)=>Object.hasOwn(t,n),L=(t,n)=>t!==n;function m(t){const n=new WeakMap;function e(r){if(g(r))return new Date(r);if(h(r))return new RegExp(r);if(a(r)){if(n.has(r))return n.get(r);let i={};if(l(r)){i=[],n.set(r,i);for(let o=0;o<r.length;o++)i[o]=e(r[o]);return i}n.set(r,i);for(const o in r)b(r,o)&&(i[o]=e(r[o]));return i}else return r}return e(t)}function O(t,n,e){return l(t)?Z(t,n,e):T(t,n,e)}function T(t,n,e){const r=c(n,e);return Object.keys(t).forEach(o=>{s(n[o])?r[o]=c(t[o],e):r[o]=a(t[o])&&a(n[o])?O(t[o],n[o],e):c(n[o],e)}),r}function Z(t,n,e){if(l(n)){const r=c(n,e);return r.push(...c(t,e)),r}else return c(t,e)}function c(t,n){const{isDeepClone:e=!0}=n||{};return e?m(t):t}function F(t,n=500){let e=null;return function(...r){e&&clearTimeout(e),e=setTimeout(()=>{t.apply(this,r)},n)}}function I(t,n=500){let e=null;return function(...r){if(s(e))return e=Date.now(),t.apply(this,r);{const i=Date.now();if(i-e>=n)return e=i,t.apply(this,r)}}}function z(...t){return t.reduce((n,e)=>function(...r){return e(n(...r))})}function B(...t){return t.reduce((n,e)=>function(...r){return n(e(...r))})}function K(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 W(t){return/^[A-Z]+$/.test(t)}function q(t){return!s(t)&&/^[a-z]+$/.test(t)}function G(t){return/^\d+$/.test(t)}function H(t){return/^-?\d{1,3}\.\d{6}$/.test(t)}function J(t){return t===""}function Q(t){return!s(t)&&/^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t)}function V(t){return!s(t)&&/^[A-Za-z\u4E00-\u9FA5]+$/.test(t)}function X(t){return!s(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Y(t){return/^[\dA-Z_]+$/.test(t)}function k(t){return/^[1-9]\d*$/.test(t)}function tt(t){return/^\d+$/.test(t)}function nt(t){return/^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t)}function et(t){return Array.isArray(t)?t:[t]}exports.castArray=et;exports.compose=z;exports.composeRight=B;exports.debounce=F;exports.deepClone=m;exports.deepMerge=O;exports.error=E;exports.getRandomColor=y;exports.getRandomString=S;exports.hasChanged=L;exports.hasOwn=b;exports.initLog=w;exports.isArray=l;exports.isBoolean=x;exports.isDate=g;exports.isDef=D;exports.isEmptyString=J;exports.isFunction=d;exports.isMap=j;exports.isNull=R;exports.isNumber=M;exports.isObject=a;exports.isPromise=U;exports.isRegExp=h;exports.isSet=$;exports.isString=v;exports.isSymbol=N;exports.isUndef=s;exports.isUndefined=P;exports.log=A;exports.objectToString=p;exports.throttle=I;exports.toTypeString=u;exports.validatorChineseOrEnglish=V;exports.validatorChineseOrEnglishOrNumber=Q;exports.validatorEmail=_;exports.validatorLatitudeOrLongitude=H;exports.validatorLowerCase=q;exports.validatorMobilePhone=K;exports.validatorNumber=G;exports.validatorPositiveFloat=nt;exports.validatorPositiveInt=k;exports.validatorPositiveIntAndZero=tt;exports.validatorUpperCase=W;exports.validatorUppercaseOrNumbersOrSpecial=X;exports.validatorUppercaseOrNumbersOrUnderline=Y;exports.warn=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function v(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function $(t){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let n="";for(let r=0;r<t;r++){const o=Math.floor(Math.random()*e.length);n+=e.charAt(o)}return n}const g=Object.prototype.toString,u=t=>g.call(t);let f=null;function y(t){d(t)&&(f=t)}const S=(t,...e)=>{const n=e.length===0?"":e.length===1?e[0]:e;console.log(`%c ${t} `,"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",n),f&&f(t,n)},N=(...t)=>console.warn(...t),P=(...t)=>console.error(...t),w=t=>u(t)==="[object Map]",A=t=>u(t)==="[object Set]",p=t=>u(t)==="[object Date]",h=t=>u(t)==="[object RegExp]",d=t=>typeof t=="function",C=t=>typeof t=="number",E=t=>typeof t=="string",F=t=>typeof t=="symbol",a=t=>t!==null&&typeof t=="object",I=t=>a(t)&&d(t.then)&&d(t.catch),s=t=>t==null,Z=t=>t===void 0,j=t=>t===null,M=t=>t!=null,U=t=>typeof t=="boolean",l=Array.isArray,b=(t,e)=>Object.hasOwn(t,e),R=(t,e)=>t!==e;function O(t){const e=new WeakMap;function n(r){if(p(r))return new Date(r);if(h(r))return new RegExp(r);if(a(r)){if(e.has(r))return e.get(r);let o={};if(l(r)){o=[],e.set(r,o);for(let i=0;i<r.length;i++)o[i]=n(r[i]);return o}e.set(r,o);for(const i in r)b(r,i)&&(o[i]=n(r[i]));return o}else return r}return n(t)}function m(t,e,n){return l(t)?x(t,e,n):D(t,e,n)}function D(t,e,n){const r=c(e,n);return Object.keys(t).forEach(i=>{s(e[i])?r[i]=c(t[i],n):r[i]=a(t[i])&&a(e[i])?m(t[i],e[i],n):c(e[i],n)}),r}function x(t,e,n){if(l(e)){const r=c(e,n);return r.push(...c(t,n)),r}else return c(t,n)}function c(t,e){const{isDeepClone:n=!0}=e||{};return n?O(t):t}function L(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}}function T(t,e=500){let n=null;return function(...r){if(s(n))return n=Date.now(),t.apply(this,r);{const o=Date.now();if(o-n>=e)return n=o,t.apply(this,r)}}}function z(...t){return t.reduce((e,n)=>function(...r){return n(e(...r))})}function B(...t){return t.reduce((e,n)=>function(...r){return e(n(...r))})}function K(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 W(t){return/^[A-Z]+$/.test(t)}function q(t){return!s(t)&&/^[a-z]+$/.test(t)}function G(t){return/^\d+$/.test(t)}function H(t){return/^-?\d{1,3}\.\d{6}$/.test(t)}function J(t){return t===""}function Q(t){return!s(t)&&/^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t)}function V(t){return!s(t)&&/^[A-Za-z\u4E00-\u9FA5]+$/.test(t)}function X(t){return!s(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Y(t){return/^[\dA-Z_]+$/.test(t)}function k(t){return/^[1-9]\d*$/.test(t)}function tt(t){return/^\d+$/.test(t)}function et(t){return/^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t)}function nt(t){return Array.isArray(t)?t:[t]}function rt(t){return/^-?\d+$/.test(t)}function it(t){return/^[1-9]\d*$/.test(t)}function ot(t){return/^-\d+$/.test(t)}function st(t){return/^(0|[1-9]\d*)$/.test(t)}function ct(t){return/^(-[1-9]\d*|0)$/.test(t)}function at(t){return/^-?\d+(\.\d+)?$/.test(t)}function ut(t){return/^(0\.\d+|[1-9]\d*(\.\d+)?)$/.test(t)}function dt(t){return/^-\d+(\.\d+)?$/.test(t)}function lt(t){return/^\d+(\.\d+)?$/.test(t)}function ft(t){return/^(-\d+(\.\d+)?$)|(0(\.0+)?)$/.test(t)}exports.castArray=nt;exports.compose=z;exports.composeRight=B;exports.debounce=L;exports.deepClone=O;exports.deepMerge=m;exports.error=P;exports.getRandomColor=v;exports.getRandomString=$;exports.hasChanged=R;exports.hasOwn=b;exports.initLog=y;exports.isArray=l;exports.isBoolean=U;exports.isDate=p;exports.isDef=M;exports.isEmptyString=J;exports.isFloat=at;exports.isFunction=d;exports.isInteger=rt;exports.isMap=w;exports.isNegativeFloat=dt;exports.isNegativeFloatOrZero=ft;exports.isNegativeInteger=ot;exports.isNegativeIntegerOrZero=ct;exports.isNull=j;exports.isNumber=C;exports.isObject=a;exports.isPositiveFloat=ut;exports.isPositiveFloatOrZero=lt;exports.isPositiveInteger=it;exports.isPositiveIntegerOrZero=st;exports.isPromise=I;exports.isRegExp=h;exports.isSet=A;exports.isString=E;exports.isSymbol=F;exports.isUndef=s;exports.isUndefined=Z;exports.log=S;exports.objectToString=g;exports.throttle=T;exports.toTypeString=u;exports.validatorChineseOrEnglish=V;exports.validatorChineseOrEnglishOrNumber=Q;exports.validatorEmail=_;exports.validatorLatitudeOrLongitude=H;exports.validatorLowerCase=q;exports.validatorMobilePhone=K;exports.validatorNumber=G;exports.validatorPositiveFloat=et;exports.validatorPositiveInt=k;exports.validatorPositiveIntAndZero=tt;exports.validatorUpperCase=W;exports.validatorUppercaseOrNumbersOrSpecial=X;exports.validatorUppercaseOrNumbersOrUnderline=Y;exports.warn=N;
package/dist/index.d.ts CHANGED
@@ -78,16 +78,73 @@ export declare const isDef: <T>(val: T) => val is NonNullable<T>;
78
78
  */
79
79
  export declare function isEmptyString(value: string): boolean;
80
80
 
81
+ /**
82
+ * @description 校验是否为浮点数
83
+ * @returns 如果是浮点数包括整数返回 true,否则返回 false
84
+ */
85
+ export declare function isFloat(val: string): boolean;
86
+
81
87
  export declare const isFunction: (val: unknown) => val is Function;
82
88
 
89
+ /**
90
+ * @description 校验是否为整数
91
+ * @returns 如果是整数返回 true,否则返回 false
92
+ */
93
+ export declare function isInteger(val: string): boolean;
94
+
83
95
  export declare const isMap: (val: unknown) => val is Map<any, any>;
84
96
 
97
+ /**
98
+ * @description 校验是否为小于零的浮点数
99
+ */
100
+ export declare function isNegativeFloat(val: string): boolean;
101
+
102
+ /**
103
+ * @description 校验是否为小于等于零的浮点数
104
+ */
105
+ export declare function isNegativeFloatOrZero(val: string): boolean;
106
+
107
+ /**
108
+ * @description 校验是否为负整数
109
+ * @returns 如果是负整数返回 true,否则返回 false
110
+ */
111
+ export declare function isNegativeInteger(val: string): boolean;
112
+
113
+ /**
114
+ * @description 校验是否为小于等于零的整数
115
+ * @returns 如果是小于等于零的整数返回 true,否则返回 false
116
+ */
117
+ export declare function isNegativeIntegerOrZero(val: string): boolean;
118
+
85
119
  export declare const isNull: (val: unknown) => val is null;
86
120
 
87
121
  export declare const isNumber: (val: unknown) => val is number;
88
122
 
89
123
  export declare const isObject: (val: unknown) => val is Record<any, any>;
90
124
 
125
+ /**
126
+ * @description 校验是否为大于零的浮点数
127
+ * @returns 如果是大于零的浮点数返回 true,否则返回 false
128
+ */
129
+ export declare function isPositiveFloat(val: string): boolean;
130
+
131
+ /**
132
+ * @description 校验是否为大于等于零的浮点数
133
+ */
134
+ export declare function isPositiveFloatOrZero(val: string): boolean;
135
+
136
+ /**
137
+ * @description 校验否为正整数
138
+ * @returns 如果是正整数返回 true,否则返回 false
139
+ */
140
+ export declare function isPositiveInteger(val: string): boolean;
141
+
142
+ /**
143
+ * @description 校验是否为大于等于零的整数
144
+ * @returns 如果是大于等于零的整数返回 true,否则返回 false
145
+ */
146
+ export declare function isPositiveIntegerOrZero(val: string): boolean;
147
+
91
148
  export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
92
149
 
93
150
  export declare const isRegExp: (val: unknown) => val is RegExp;
package/dist/index.mjs CHANGED
@@ -1,140 +1,140 @@
1
- function O() {
1
+ function w() {
2
2
  return `#${Math.random().toString(16).slice(2, 8).padEnd(6, "0")}`;
3
3
  }
4
- function $(t) {
4
+ function A(t) {
5
5
  const n = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
6
- let r = "";
7
- for (let e = 0; e < t; e++) {
6
+ let e = "";
7
+ for (let r = 0; r < t; r++) {
8
8
  const i = Math.floor(Math.random() * n.length);
9
- r += n.charAt(i);
9
+ e += n.charAt(i);
10
10
  }
11
- return r;
11
+ return e;
12
12
  }
13
- const p = Object.prototype.toString, f = (t) => p.call(t);
14
- let d = null;
13
+ const g = Object.prototype.toString, d = (t) => g.call(t);
14
+ let f = null;
15
15
  function j(t) {
16
- a(t) && (d = t);
16
+ a(t) && (f = t);
17
17
  }
18
18
  const E = (t, ...n) => {
19
- const r = n.length === 0 ? "" : n.length === 1 ? n[0] : n;
19
+ const e = n.length === 0 ? "" : n.length === 1 ? n[0] : n;
20
20
  console.log(
21
21
  `%c ${t} `,
22
22
  "padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",
23
- r
24
- ), d && d(t, r);
25
- }, S = (...t) => console.warn(...t), C = (...t) => console.error(...t), M = (t) => f(t) === "[object Map]", x = (t) => f(t) === "[object Set]", h = (t) => f(t) === "[object Date]", g = (t) => f(t) === "[object RegExp]", a = (t) => typeof t == "function", D = (t) => typeof t == "number", N = (t) => typeof t == "string", R = (t) => typeof t == "symbol", u = (t) => t !== null && typeof t == "object", U = (t) => u(t) && a(t.then) && a(t.catch), c = (t) => t == null, Z = (t) => t === void 0, P = (t) => t === null, F = (t) => t != null, L = (t) => typeof t == "boolean", l = Array.isArray, b = (t, n) => Object.hasOwn(t, n), T = (t, n) => t !== n;
26
- function m(t) {
23
+ e
24
+ ), f && f(t, e);
25
+ }, S = (...t) => console.warn(...t), C = (...t) => console.error(...t), N = (t) => d(t) === "[object Map]", Z = (t) => d(t) === "[object Set]", p = (t) => d(t) === "[object Date]", h = (t) => d(t) === "[object RegExp]", a = (t) => typeof t == "function", F = (t) => typeof t == "number", M = (t) => typeof t == "string", P = (t) => typeof t == "symbol", u = (t) => t !== null && typeof t == "object", x = (t) => u(t) && a(t.then) && a(t.catch), c = (t) => t == null, I = (t) => t === void 0, D = (t) => t === null, R = (t) => t != null, U = (t) => typeof t == "boolean", l = Array.isArray, b = (t, n) => Object.hasOwn(t, n), L = (t, n) => t !== n;
26
+ function $(t) {
27
27
  const n = /* @__PURE__ */ new WeakMap();
28
- function r(e) {
29
- if (h(e))
30
- return new Date(e);
31
- if (g(e))
32
- return new RegExp(e);
33
- if (u(e)) {
34
- if (n.has(e))
35
- return n.get(e);
28
+ function e(r) {
29
+ if (p(r))
30
+ return new Date(r);
31
+ if (h(r))
32
+ return new RegExp(r);
33
+ if (u(r)) {
34
+ if (n.has(r))
35
+ return n.get(r);
36
36
  let i = {};
37
- if (l(e)) {
38
- i = [], n.set(e, i);
39
- for (let o = 0; o < e.length; o++)
40
- i[o] = r(e[o]);
37
+ if (l(r)) {
38
+ i = [], n.set(r, i);
39
+ for (let o = 0; o < r.length; o++)
40
+ i[o] = e(r[o]);
41
41
  return i;
42
42
  }
43
- n.set(e, i);
44
- for (const o in e)
45
- b(e, o) && (i[o] = r(e[o]));
43
+ n.set(r, i);
44
+ for (const o in r)
45
+ b(r, o) && (i[o] = e(r[o]));
46
46
  return i;
47
47
  } else
48
- return e;
48
+ return r;
49
49
  }
50
- return r(t);
50
+ return e(t);
51
51
  }
52
- function y(t, n, r) {
53
- return l(t) ? A(t, n, r) : w(t, n, r);
52
+ function m(t, n, e) {
53
+ return l(t) ? y(t, n, e) : O(t, n, e);
54
54
  }
55
- function w(t, n, r) {
56
- const e = s(n, r);
55
+ function O(t, n, e) {
56
+ const r = s(n, e);
57
57
  return Object.keys(t).forEach((o) => {
58
- c(n[o]) ? e[o] = s(t[o], r) : e[o] = u(t[o]) && u(n[o]) ? y(t[o], n[o], r) : s(n[o], r);
59
- }), e;
58
+ c(n[o]) ? r[o] = s(t[o], e) : r[o] = u(t[o]) && u(n[o]) ? m(t[o], n[o], e) : s(n[o], e);
59
+ }), r;
60
60
  }
61
- function A(t, n, r) {
61
+ function y(t, n, e) {
62
62
  if (l(n)) {
63
- const e = s(n, r);
64
- return e.push(...s(t, r)), e;
63
+ const r = s(n, e);
64
+ return r.push(...s(t, e)), r;
65
65
  } else
66
- return s(t, r);
66
+ return s(t, e);
67
67
  }
68
68
  function s(t, n) {
69
- const { isDeepClone: r = !0 } = n || {};
70
- return r ? m(t) : t;
71
- }
72
- function z(t, n = 500) {
73
- let r = null;
74
- return function(...e) {
75
- r && clearTimeout(r), r = setTimeout(() => {
76
- t.apply(this, e);
69
+ const { isDeepClone: e = !0 } = n || {};
70
+ return e ? $(t) : t;
71
+ }
72
+ function T(t, n = 500) {
73
+ let e = null;
74
+ return function(...r) {
75
+ e && clearTimeout(e), e = setTimeout(() => {
76
+ t.apply(this, r);
77
77
  }, n);
78
78
  };
79
79
  }
80
- function I(t, n = 500) {
81
- let r = null;
82
- return function(...e) {
83
- if (c(r))
84
- return r = Date.now(), t.apply(this, e);
80
+ function v(t, n = 500) {
81
+ let e = null;
82
+ return function(...r) {
83
+ if (c(e))
84
+ return e = Date.now(), t.apply(this, r);
85
85
  {
86
86
  const i = Date.now();
87
- if (i - r >= n)
88
- return r = i, t.apply(this, e);
87
+ if (i - e >= n)
88
+ return e = i, t.apply(this, r);
89
89
  }
90
90
  };
91
91
  }
92
- function K(...t) {
93
- return t.reduce((n, r) => function(...e) {
94
- return r(n(...e));
92
+ function z(...t) {
93
+ return t.reduce((n, e) => function(...r) {
94
+ return e(n(...r));
95
95
  });
96
96
  }
97
- function _(...t) {
98
- return t.reduce((n, r) => function(...e) {
99
- return n(r(...e));
97
+ function K(...t) {
98
+ return t.reduce((n, e) => function(...r) {
99
+ return n(e(...r));
100
100
  });
101
101
  }
102
- function B(t) {
102
+ function _(t) {
103
103
  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(
104
104
  t
105
105
  );
106
106
  }
107
- function W(t) {
107
+ function B(t) {
108
108
  return /^([\w-])+@([\w-])+(\.[\w-])+/.test(t);
109
109
  }
110
- function q(t) {
110
+ function W(t) {
111
111
  return /^[A-Z]+$/.test(t);
112
112
  }
113
- function G(t) {
113
+ function q(t) {
114
114
  return !c(t) && /^[a-z]+$/.test(t);
115
115
  }
116
- function H(t) {
116
+ function G(t) {
117
117
  return /^\d+$/.test(t);
118
118
  }
119
- function J(t) {
119
+ function H(t) {
120
120
  return /^-?\d{1,3}\.\d{6}$/.test(t);
121
121
  }
122
- function Q(t) {
122
+ function J(t) {
123
123
  return t === "";
124
124
  }
125
- function V(t) {
125
+ function Q(t) {
126
126
  return !c(t) && /^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t);
127
127
  }
128
- function X(t) {
128
+ function V(t) {
129
129
  return !c(t) && /^[A-Za-z\u4E00-\u9FA5]+$/.test(t);
130
130
  }
131
- function Y(t) {
131
+ function X(t) {
132
132
  return !c(t) && /^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t);
133
133
  }
134
- function k(t) {
134
+ function Y(t) {
135
135
  return /^[\dA-Z_]+$/.test(t);
136
136
  }
137
- function v(t) {
137
+ function k(t) {
138
138
  return /^[1-9]\d*$/.test(t);
139
139
  }
140
140
  function tt(t) {
@@ -143,55 +143,95 @@ function tt(t) {
143
143
  function nt(t) {
144
144
  return /^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t);
145
145
  }
146
- function rt(t) {
146
+ function et(t) {
147
147
  return Array.isArray(t) ? t : [t];
148
148
  }
149
+ function rt(t) {
150
+ return /^-?\d+$/.test(t);
151
+ }
152
+ function ot(t) {
153
+ return /^[1-9]\d*$/.test(t);
154
+ }
155
+ function it(t) {
156
+ return /^-\d+$/.test(t);
157
+ }
158
+ function st(t) {
159
+ return /^(0|[1-9]\d*)$/.test(t);
160
+ }
161
+ function ct(t) {
162
+ return /^(-[1-9]\d*|0)$/.test(t);
163
+ }
164
+ function ut(t) {
165
+ return /^-?\d+(\.\d+)?$/.test(t);
166
+ }
167
+ function dt(t) {
168
+ return /^(0\.\d+|[1-9]\d*(\.\d+)?)$/.test(t);
169
+ }
170
+ function ft(t) {
171
+ return /^-\d+(\.\d+)?$/.test(t);
172
+ }
173
+ function at(t) {
174
+ return /^\d+(\.\d+)?$/.test(t);
175
+ }
176
+ function lt(t) {
177
+ return /^(-\d+(\.\d+)?$)|(0(\.0+)?)$/.test(t);
178
+ }
149
179
  export {
150
- rt as castArray,
151
- K as compose,
152
- _ as composeRight,
153
- z as debounce,
154
- m as deepClone,
155
- y as deepMerge,
180
+ et as castArray,
181
+ z as compose,
182
+ K as composeRight,
183
+ T as debounce,
184
+ $ as deepClone,
185
+ m as deepMerge,
156
186
  C as error,
157
- O as getRandomColor,
158
- $ as getRandomString,
159
- T as hasChanged,
187
+ w as getRandomColor,
188
+ A as getRandomString,
189
+ L as hasChanged,
160
190
  b as hasOwn,
161
191
  j as initLog,
162
192
  l as isArray,
163
- L as isBoolean,
164
- h as isDate,
165
- F as isDef,
166
- Q as isEmptyString,
193
+ U as isBoolean,
194
+ p as isDate,
195
+ R as isDef,
196
+ J as isEmptyString,
197
+ ut as isFloat,
167
198
  a as isFunction,
168
- M as isMap,
169
- P as isNull,
170
- D as isNumber,
199
+ rt as isInteger,
200
+ N as isMap,
201
+ ft as isNegativeFloat,
202
+ lt as isNegativeFloatOrZero,
203
+ it as isNegativeInteger,
204
+ ct as isNegativeIntegerOrZero,
205
+ D as isNull,
206
+ F as isNumber,
171
207
  u as isObject,
172
- U as isPromise,
173
- g as isRegExp,
174
- x as isSet,
175
- N as isString,
176
- R as isSymbol,
208
+ dt as isPositiveFloat,
209
+ at as isPositiveFloatOrZero,
210
+ ot as isPositiveInteger,
211
+ st as isPositiveIntegerOrZero,
212
+ x as isPromise,
213
+ h as isRegExp,
214
+ Z as isSet,
215
+ M as isString,
216
+ P as isSymbol,
177
217
  c as isUndef,
178
- Z as isUndefined,
218
+ I as isUndefined,
179
219
  E as log,
180
- p as objectToString,
181
- I as throttle,
182
- f as toTypeString,
183
- X as validatorChineseOrEnglish,
184
- V as validatorChineseOrEnglishOrNumber,
185
- W as validatorEmail,
186
- J as validatorLatitudeOrLongitude,
187
- G as validatorLowerCase,
188
- B as validatorMobilePhone,
189
- H as validatorNumber,
220
+ g as objectToString,
221
+ v as throttle,
222
+ d as toTypeString,
223
+ V as validatorChineseOrEnglish,
224
+ Q as validatorChineseOrEnglishOrNumber,
225
+ B as validatorEmail,
226
+ H as validatorLatitudeOrLongitude,
227
+ q as validatorLowerCase,
228
+ _ as validatorMobilePhone,
229
+ G as validatorNumber,
190
230
  nt as validatorPositiveFloat,
191
- v as validatorPositiveInt,
231
+ k as validatorPositiveInt,
192
232
  tt as validatorPositiveIntAndZero,
193
- q as validatorUpperCase,
194
- Y as validatorUppercaseOrNumbersOrSpecial,
195
- k as validatorUppercaseOrNumbersOrUnderline,
233
+ W as validatorUpperCase,
234
+ X as validatorUppercaseOrNumbersOrSpecial,
235
+ Y as validatorUppercaseOrNumbersOrUnderline,
196
236
  S as warn
197
237
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/utils",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "description": "工具库",
5
5
  "type": "module",
6
6
  "license": "MIT",