@lntvow/utils 2.2.7 → 2.2.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 +1 -1
- package/dist/index.d.ts +15 -19
- package/dist/index.mjs +65 -60
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function M(...e){return e.reduce((t,n)=>function(...r){return n(t(...r))})}function F(...e){return e.reduce((t,n)=>function(...r){return t(n(...r))})}function R(e,t=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}}const O=Object.prototype.toString,f=e=>O.call(e);let m=null;function P(e){p(e)&&(m=e)}const U=(e,...t)=>{const n=t.length===0?"":t.length===1?t[0]:t;console.log(`%c ${e} `,"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",n),m&&m(e,n)},I=(...e)=>console.warn(...e),Z=(...e)=>console.error(...e),x=e=>f(e)==="[object Map]",j=e=>f(e)==="[object Set]",C=e=>f(e)==="[object Date]",A=e=>f(e)==="[object RegExp]",p=e=>typeof e=="function",L=e=>typeof e=="number",N=e=>typeof e=="string",D=e=>typeof e=="symbol",a=e=>e!==null&&typeof e=="object",T=e=>a(e)&&p(e.then)&&p(e.catch),c=e=>e==null,v=e=>e===void 0,z=e=>e===null,W=e=>e!=null,_=e=>typeof e=="boolean",l=Array.isArray,h=(e,t)=>Object.hasOwn(e,t),q=(e,t)=>e!==t;function b(e){const t=new WeakMap;function n(r){if(C(r))return new Date(r);if(A(r))return new RegExp(r);if(a(r)){if(t.has(r))return t.get(r);let o={};if(l(r)){o=[],t.set(r,o);for(let i=0;i<r.length;i++)o[i]=n(r[i]);return o}t.set(r,o);for(const i in r)h(r,i)&&(o[i]=n(r[i]));return o}else return r}return n(e)}function s(e,t,n){return l(e)?K(e,t,n):B(e,t,n)}function B(e,t,n){const r=u(t,n);return Object.keys(e).forEach(i=>{c(t[i])?r[i]=u(e[i],n):r[i]=a(e[i])&&a(t[i])?s(e[i],t[i],n):u(t[i],n)}),r}function K(e,t,n){if(l(t)){const r=u(t,n);return r.push(...u(e,n)),r}else return u(e,n)}function u(e,t){const{clone:n=!0}=t||{};return n?b(e):e}class w extends Error{constructor(t){super(t),this.name="LntvowError"}}function E(e,t){throw new w(`[${e}] ${t}`)}function G(e,t){if(process.env.NODE_ENV!=="production"){const n=N(e)?new w(`[${e}] ${t}`):e;console.warn(n)}}function Q(e,t){const{decode:n}=s({decode:!0},t||{}),r={};e.startsWith("?")&&(e=e.slice(1)),e.includes("?")&&(e=e.slice(e.indexOf("?")+1));const o=e.split("&").filter(Boolean);for(const i of o){const[g,d]=i.split("=");r[g]=n?decodeURIComponent(d):d}return r}function S(e,t){const{encode:n}=s({encode:!0},t||{}),r=[];for(const o in e){const i=e[o];r.push(`${o}=${n?encodeURIComponent(i):i}`)}return r.join("&")}function V(e,t,n){const r=s({encode:!0},n||{}),o=S(t,r);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${o}`:`${e}&${o}`:`${e}?${o}`}const X={parse:Q,stringify:S,appendQueryString:V};function H(e,t=500){let n=null;return function(...r){if(c(n))return n=Date.now(),e.apply(this,r);{const o=Date.now();if(o-n>=t)return n=o,e.apply(this,r)}}}function J(e){return/^-?\d{1,3}\.\d{6}$/.test(e)}function Y(e){return!c(e)&&/^[\dA-Za-z\u4E00-\u9FA5]+$/.test(e)}function k(e){return!c(e)&&/^[A-Za-z\u4E00-\u9FA5]+$/.test(e)}function ee(e){return!c(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function te(e){return/^[\dA-Z_]+$/.test(e)}function $(e){return l(e)?e:[e]}function ne(e,t){const n=b(e);return $(t).forEach(o=>{h(n,o)&&delete n[o]}),n}function re(e,t){const n={};return $(t).forEach(o=>{h(e,o)&&(n[o]=e[o])}),n}function oe(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function ie(e=0,t=1e9){return Math.random()*(t-e)+e}function se(e=0,t=Number.MAX_SAFE_INTEGER){return Math.floor(Math.random()*(t-e+1))+Math.floor(e)}function ue(){let e=["130","131","132","133","134","135","136","137","138","139"];return e=[...e,"145","146","147","149"],e=[...e,"150","151","152","153","155","156","157","158","159"],e=[...e,"166","167"],e=[...e,"170","171","172","173","174","175","176","177","178"],e=[...e,"180","181","182","183","184","185","186","187","188","189"],e=[...e,"190","191","192","195","196","197","198","199"],e[Math.floor(Math.random()*e.length)]+Math.floor(Math.random()*1e8).toString().padStart(8,"0")}function ce(e,t={}){const{lowerCase:n,upperCase:r,number:o}=s({lowerCase:!0,upperCase:!0,number:!0},t);n||r||o||E("getRandomString","lowerCase upperCase number 至少需要一个参数为true");let i="";n&&(i+="abcdefghijklmnopqrstuvwxyz"),r&&(i+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),o&&(i+="0123456789");let g="";for(let d=0;d<e;d++){const y=Math.floor(Math.random()*i.length);g+=i.charAt(y)}return g}function de(e){return/^\d+$/.test(e)}function ae(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function fe(e){return/^[A-Za-z]+$/.test(e)}function le(e){return/^[A-Z]+$/.test(e)}function ge(e){return/^[\dA-Z]+$/.test(e)}function pe(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function he(e){return/^[a-z]+$/.test(e)}function me(e){return/^[\da-z]+$/.test(e)}function be(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function $e(e,t={}){const{integer:n}=s({integer:!0},t);return n?/^-?(0|[1-9]\d*)(\.\d+)?$/.test(e):/^-?(0|[1-9]\d*)\.\d+$/.test(e)}function Oe(e,t={}){const{integer:n}=s({integer:!0},t);return n?/^[1-9]\d*\.?\d*|^0\.\d*[1-9]\d*$/.test(e):/^[1-9]\d*\.\d*|^0\.\d*[1-9]\d*$/.test(e)}function Ce(e,t={}){const{integer:n}=s({integer:!0},t);return n?/^-[1-9]\d*\.?\d*|^-0\.\d*[1-9]\d*$/.test(e):/^-[1-9]\d*\.\d*|^-0\.\d*[1-9]\d*$/.test(e)}function Ae(e,t={}){const{integer:n}=s({integer:!0},t);return n?/^(0|[1-9]\d*)(\.\d+)?$/.test(e):/^(0|[1-9]\d*)\.\d+$/.test(e)}function Ne(e,t={}){const{integer:n}=s({integer:!0},t);return n?/^(-?0(\.0+)?|-(0|[1-9]\d*)(\.\d+)?)$/.test(e):/^(-?0\.0+|-(0|[1-9]\d*)\.\d+)$/.test(e)}function we(e){return/^-?(0|[1-9]\d*)$/.test(e)}function Ee(e){return/^[1-9]\d*$/.test(e)}function Se(e){return/^(0|[1-9]\d*)$/.test(e)}function ye(e){return/^-([1-9]\d*)$/.test(e)}function Me(e){return/^(0|-(0|[1-9]\d*))$/.test(e)}function Fe(e){return/^(?:(?:\+|00)86)?1(?:(?:3\d)|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8\d)|(?:9[0-25-9]))\d{8}$/.test(e)}function Re(e){return/^([\w-])+@([\w-])+(\.[\w-])+/.test(e)}function Pe(e){return e===""}exports.castArray=$;exports.compose=M;exports.composeRight=F;exports.debounce=R;exports.debugWarn=G;exports.deepClone=b;exports.deepMerge=s;exports.error=Z;exports.excludeProperties=ne;exports.extractProperties=re;exports.getRandomColor=oe;exports.getRandomFloat=ie;exports.getRandomInteger=se;exports.getRandomPhoneNumber=ue;exports.getRandomString=ce;exports.hasChanged=q;exports.hasOwn=h;exports.initLog=P;exports.isArray=l;exports.isBoolean=_;exports.isChinese=ae;exports.isDate=C;exports.isDef=W;exports.isEmail=Re;exports.isEmptyString=Pe;exports.isEnglishAphabet=fe;exports.isFloat=$e;exports.isFunction=p;exports.isInteger=we;exports.isLowerCase=he;exports.isLowerCaseAndNumber=me;exports.isLowerCaseAndNumberAndChinese=be;exports.isMap=x;exports.isMobilePhone=Fe;exports.isNegativeFloat=Ce;exports.isNegativeFloatOrZero=Ne;exports.isNegativeInteger=ye;exports.isNegativeIntegerOrZero=Me;exports.isNull=z;exports.isNumber=L;exports.isNumberOrNumberString=de;exports.isObject=a;exports.isPositiveFloat=Oe;exports.isPositiveFloatOrZero=Ae;exports.isPositiveInteger=Ee;exports.isPositiveIntegerOrZero=Se;exports.isPromise=T;exports.isRegExp=A;exports.isSet=j;exports.isString=N;exports.isSymbol=D;exports.isUndef=c;exports.isUndefined=v;exports.isUpperCase=le;exports.isUpperCaseAndNumber=ge;exports.isUpperCaseAndNumberAndChinese=pe;exports.log=U;exports.objectToString=O;exports.qs=X;exports.throttle=H;exports.throwError=E;exports.toTypeString=f;exports.validatorChineseOrEnglish=k;exports.validatorChineseOrEnglishOrNumber=Y;exports.validatorLatitudeOrLongitude=J;exports.validatorUppercaseOrNumbersOrSpecial=ee;exports.validatorUppercaseOrNumbersOrUnderline=te;exports.warn=I;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare type Arrayable<T> = T | T[];
|
|
|
16
16
|
/**
|
|
17
17
|
* @description 将非数组转换为数组 如果是目标本就是数组则直接返回
|
|
18
18
|
* @param target 目标
|
|
19
|
-
* @
|
|
19
|
+
* @example castArray(1) => [1]
|
|
20
20
|
*/
|
|
21
21
|
export declare function castArray<T>(target: T | T[]): T[];
|
|
22
22
|
|
|
@@ -66,21 +66,19 @@ export declare const error: (...arg: unknown[]) => void;
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* @description 排除对象中的某些属性
|
|
69
|
-
* @param
|
|
69
|
+
* @param target 目标对象
|
|
70
70
|
* @param properties 要排除的属性
|
|
71
|
-
* @return 排除后的对象
|
|
72
71
|
* @example excludeProperties({ a: 1, b: 2, c: 3 }, ['a', 'b']) => { c: 3 }
|
|
73
72
|
*/
|
|
74
|
-
export declare function excludeProperties<T extends AnyObj, K extends keyof T>(
|
|
73
|
+
export declare function excludeProperties<T extends AnyObj, K extends keyof T>(target: T, properties: Arrayable<K>): Omit<T, K>;
|
|
75
74
|
|
|
76
75
|
/**
|
|
77
76
|
* @description 提取对象中的某些属性
|
|
78
|
-
* @param
|
|
77
|
+
* @param target 目标对象
|
|
79
78
|
* @param properties 要提取的属性
|
|
80
|
-
* @return 提取后的对象
|
|
81
79
|
* @example extractProperties({ a: 1, b: 2, c: 3 }, ['a', 'b']) => { a: 1, b: 2 }
|
|
82
80
|
*/
|
|
83
|
-
export declare function extractProperties<T extends AnyObj, K extends keyof T>(
|
|
81
|
+
export declare function extractProperties<T extends AnyObj, K extends keyof T>(target: T, properties: Arrayable<K>): Pick<T, K>;
|
|
84
82
|
|
|
85
83
|
export declare interface FloatOptions {
|
|
86
84
|
/**
|
|
@@ -91,38 +89,36 @@ export declare interface FloatOptions {
|
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
/**
|
|
94
|
-
* @description
|
|
95
|
-
* @return 随机颜色
|
|
96
|
-
*
|
|
92
|
+
* @description 生成随机颜色
|
|
97
93
|
* @example getRandomColor() => '#f36a38'
|
|
98
94
|
* */
|
|
99
95
|
export declare function getRandomColor(): string;
|
|
100
96
|
|
|
101
97
|
/**
|
|
102
|
-
* @description
|
|
98
|
+
* @description 生成范围内的随机浮点数
|
|
103
99
|
* @param min 最小值 默认值为 0
|
|
104
100
|
* @param max 最大值 默认值为 1_000_000_000
|
|
105
|
-
* @return 随机整数
|
|
106
|
-
*
|
|
107
101
|
* @example getRandomFloat() => 390083.99373681104
|
|
108
102
|
* */
|
|
109
103
|
export declare function getRandomFloat(min?: number, max?: number): number;
|
|
110
104
|
|
|
111
105
|
/**
|
|
112
|
-
* @description
|
|
106
|
+
* @description 生成范围内的随机整数
|
|
113
107
|
* @param min 最小值 默认值为 0
|
|
114
108
|
* @param max 最大值 默认值为 Number.MAX_SAFE_INTEGER
|
|
115
|
-
* @return 随机整数
|
|
116
|
-
*
|
|
117
109
|
* @example getRandomInteger() => 217342
|
|
118
110
|
* */
|
|
119
111
|
export declare function getRandomInteger(min?: number, max?: number): number;
|
|
120
112
|
|
|
121
113
|
/**
|
|
122
|
-
* @description
|
|
114
|
+
* @description 生成随机手机号码
|
|
115
|
+
* @example getRandomPhoneNumber() => 13012345678
|
|
116
|
+
*/
|
|
117
|
+
export declare function getRandomPhoneNumber(): string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @description 生成随机字符串 大小写字母和数字
|
|
123
121
|
* @param length 返回字符串的长度
|
|
124
|
-
* @return 随机字符串
|
|
125
|
-
*
|
|
126
122
|
* @example getRandomString(20) => 'lZtJqMl0dyTO3WDGzFDO'
|
|
127
123
|
* */
|
|
128
124
|
export declare function getRandomString(length: number, options?: GetRandomStringOptions): string;
|
package/dist/index.mjs
CHANGED
|
@@ -21,15 +21,15 @@ let p = null;
|
|
|
21
21
|
function U(t) {
|
|
22
22
|
h(t) && (p = t);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const P = (t, ...n) => {
|
|
25
25
|
const e = n.length === 0 ? "" : n.length === 1 ? n[0] : n;
|
|
26
26
|
console.log(
|
|
27
27
|
`%c ${t} `,
|
|
28
28
|
"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",
|
|
29
29
|
e
|
|
30
30
|
), p && p(t, e);
|
|
31
|
-
},
|
|
32
|
-
function
|
|
31
|
+
}, L = (...t) => console.warn(...t), D = (...t) => console.error(...t), z = (t) => l(t) === "[object Map]", T = (t) => l(t) === "[object Set]", O = (t) => l(t) === "[object Date]", N = (t) => l(t) === "[object RegExp]", h = (t) => typeof t == "function", W = (t) => typeof t == "number", y = (t) => typeof t == "string", _ = (t) => typeof t == "symbol", a = (t) => t !== null && typeof t == "object", q = (t) => a(t) && h(t.then) && h(t.catch), d = (t) => t == null, B = (t) => t === void 0, K = (t) => t === null, G = (t) => t != null, Q = (t) => typeof t == "boolean", g = Array.isArray, $ = (t, n) => Object.hasOwn(t, n), V = (t, n) => t !== n;
|
|
32
|
+
function m(t) {
|
|
33
33
|
const n = /* @__PURE__ */ new WeakMap();
|
|
34
34
|
function e(r) {
|
|
35
35
|
if (O(r))
|
|
@@ -56,15 +56,15 @@ function b(t) {
|
|
|
56
56
|
return e(t);
|
|
57
57
|
}
|
|
58
58
|
function s(t, n, e) {
|
|
59
|
-
return g(t) ?
|
|
59
|
+
return g(t) ? S(t, n, e) : M(t, n, e);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function M(t, n, e) {
|
|
62
62
|
const r = u(n, e);
|
|
63
63
|
return Object.keys(t).forEach((i) => {
|
|
64
64
|
d(n[i]) ? r[i] = u(t[i], e) : r[i] = a(t[i]) && a(n[i]) ? s(t[i], n[i], e) : u(n[i], e);
|
|
65
65
|
}), r;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function S(t, n, e) {
|
|
68
68
|
if (g(n)) {
|
|
69
69
|
const r = u(n, e);
|
|
70
70
|
return r.push(...u(t, e)), r;
|
|
@@ -73,23 +73,23 @@ function M(t, n, e) {
|
|
|
73
73
|
}
|
|
74
74
|
function u(t, n) {
|
|
75
75
|
const { clone: e = !0 } = n || {};
|
|
76
|
-
return e ?
|
|
76
|
+
return e ? m(t) : t;
|
|
77
77
|
}
|
|
78
|
-
class
|
|
78
|
+
class b extends Error {
|
|
79
79
|
constructor(n) {
|
|
80
80
|
super(n), this.name = "LntvowError";
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
throw new
|
|
83
|
+
function x(t, n) {
|
|
84
|
+
throw new b(`[${t}] ${n}`);
|
|
85
85
|
}
|
|
86
86
|
function X(t, n) {
|
|
87
87
|
if (process.env.NODE_ENV !== "production") {
|
|
88
|
-
const e = y(t) ? new
|
|
88
|
+
const e = y(t) ? new b(`[${t}] ${n}`) : t;
|
|
89
89
|
console.warn(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function F(t, n) {
|
|
93
93
|
const { decode: e } = s({ decode: !0 }, n || {}), r = {};
|
|
94
94
|
t.startsWith("?") && (t = t.slice(1)), t.includes("?") && (t = t.slice(t.indexOf("?") + 1));
|
|
95
95
|
const o = t.split("&").filter(Boolean);
|
|
@@ -112,7 +112,7 @@ function R(t, n, e) {
|
|
|
112
112
|
return t.includes("?") ? t.endsWith("?") || t.endsWith("&") ? `${t}${o}` : `${t}&${o}` : `${t}?${o}`;
|
|
113
113
|
}
|
|
114
114
|
const H = {
|
|
115
|
-
parse:
|
|
115
|
+
parse: F,
|
|
116
116
|
stringify: w,
|
|
117
117
|
appendQueryString: R
|
|
118
118
|
};
|
|
@@ -147,7 +147,7 @@ function A(t) {
|
|
|
147
147
|
return g(t) ? t : [t];
|
|
148
148
|
}
|
|
149
149
|
function et(t, n) {
|
|
150
|
-
const e =
|
|
150
|
+
const e = m(t);
|
|
151
151
|
return A(n).forEach((o) => {
|
|
152
152
|
$(e, o) && delete e[o];
|
|
153
153
|
}), e;
|
|
@@ -167,9 +167,13 @@ function it(t = 0, n = 1e9) {
|
|
|
167
167
|
function st(t = 0, n = Number.MAX_SAFE_INTEGER) {
|
|
168
168
|
return Math.floor(Math.random() * (n - t + 1)) + Math.floor(t);
|
|
169
169
|
}
|
|
170
|
-
function ut(
|
|
170
|
+
function ut() {
|
|
171
|
+
let t = ["130", "131", "132", "133", "134", "135", "136", "137", "138", "139"];
|
|
172
|
+
return t = [...t, "145", "146", "147", "149"], t = [...t, "150", "151", "152", "153", "155", "156", "157", "158", "159"], t = [...t, "166", "167"], t = [...t, "170", "171", "172", "173", "174", "175", "176", "177", "178"], t = [...t, "180", "181", "182", "183", "184", "185", "186", "187", "188", "189"], t = [...t, "190", "191", "192", "195", "196", "197", "198", "199"], t[Math.floor(Math.random() * t.length)] + Math.floor(Math.random() * 1e8).toString().padStart(8, "0");
|
|
173
|
+
}
|
|
174
|
+
function ct(t, n = {}) {
|
|
171
175
|
const { lowerCase: e, upperCase: r, number: o } = s({ lowerCase: !0, upperCase: !0, number: !0 }, n);
|
|
172
|
-
e || r || o ||
|
|
176
|
+
e || r || o || x("getRandomString", "lowerCase upperCase number 至少需要一个参数为true");
|
|
173
177
|
let i = "";
|
|
174
178
|
e && (i += "abcdefghijklmnopqrstuvwxyz"), r && (i += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), o && (i += "0123456789");
|
|
175
179
|
let f = "";
|
|
@@ -179,77 +183,77 @@ function ut(t, n = {}) {
|
|
|
179
183
|
}
|
|
180
184
|
return f;
|
|
181
185
|
}
|
|
182
|
-
function
|
|
186
|
+
function dt(t) {
|
|
183
187
|
return /^\d+$/.test(t);
|
|
184
188
|
}
|
|
185
|
-
function
|
|
189
|
+
function ft(t) {
|
|
186
190
|
return /^[\u4E00-\u9FA5]+$/.test(t);
|
|
187
191
|
}
|
|
188
|
-
function
|
|
192
|
+
function at(t) {
|
|
189
193
|
return /^[A-Za-z]+$/.test(t);
|
|
190
194
|
}
|
|
191
|
-
function
|
|
195
|
+
function lt(t) {
|
|
192
196
|
return /^[A-Z]+$/.test(t);
|
|
193
197
|
}
|
|
194
|
-
function
|
|
198
|
+
function gt(t) {
|
|
195
199
|
return /^[\dA-Z]+$/.test(t);
|
|
196
200
|
}
|
|
197
|
-
function
|
|
201
|
+
function pt(t) {
|
|
198
202
|
return /^[\dA-Z\u4E00-\u9FA5]+$/.test(t);
|
|
199
203
|
}
|
|
200
|
-
function
|
|
204
|
+
function ht(t) {
|
|
201
205
|
return /^[a-z]+$/.test(t);
|
|
202
206
|
}
|
|
203
|
-
function
|
|
207
|
+
function $t(t) {
|
|
204
208
|
return /^[\da-z]+$/.test(t);
|
|
205
209
|
}
|
|
206
|
-
function
|
|
210
|
+
function mt(t) {
|
|
207
211
|
return /^[\da-z\u4E00-\u9FA5]+$/.test(t);
|
|
208
212
|
}
|
|
209
213
|
function bt(t, n = {}) {
|
|
210
214
|
const { integer: e } = s({ integer: !0 }, n);
|
|
211
215
|
return e ? /^-?(0|[1-9]\d*)(\.\d+)?$/.test(t) : /^-?(0|[1-9]\d*)\.\d+$/.test(t);
|
|
212
216
|
}
|
|
213
|
-
function
|
|
217
|
+
function wt(t, n = {}) {
|
|
214
218
|
const { integer: e } = s({ integer: !0 }, n);
|
|
215
219
|
return e ? /^[1-9]\d*\.?\d*|^0\.\d*[1-9]\d*$/.test(t) : /^[1-9]\d*\.\d*|^0\.\d*[1-9]\d*$/.test(t);
|
|
216
220
|
}
|
|
217
|
-
function
|
|
221
|
+
function At(t, n = {}) {
|
|
218
222
|
const { integer: e } = s({ integer: !0 }, n);
|
|
219
223
|
return e ? /^-[1-9]\d*\.?\d*|^-0\.\d*[1-9]\d*$/.test(t) : /^-[1-9]\d*\.\d*|^-0\.\d*[1-9]\d*$/.test(t);
|
|
220
224
|
}
|
|
221
|
-
function
|
|
225
|
+
function Et(t, n = {}) {
|
|
222
226
|
const { integer: e } = s({ integer: !0 }, n);
|
|
223
227
|
return e ? /^(0|[1-9]\d*)(\.\d+)?$/.test(t) : /^(0|[1-9]\d*)\.\d+$/.test(t);
|
|
224
228
|
}
|
|
225
|
-
function
|
|
229
|
+
function Ct(t, n = {}) {
|
|
226
230
|
const { integer: e } = s({ integer: !0 }, n);
|
|
227
231
|
return e ? /^(-?0(\.0+)?|-(0|[1-9]\d*)(\.\d+)?)$/.test(t) : /^(-?0\.0+|-(0|[1-9]\d*)\.\d+)$/.test(t);
|
|
228
232
|
}
|
|
229
|
-
function
|
|
233
|
+
function Ot(t) {
|
|
230
234
|
return /^-?(0|[1-9]\d*)$/.test(t);
|
|
231
235
|
}
|
|
232
|
-
function
|
|
236
|
+
function Nt(t) {
|
|
233
237
|
return /^[1-9]\d*$/.test(t);
|
|
234
238
|
}
|
|
235
|
-
function
|
|
239
|
+
function yt(t) {
|
|
236
240
|
return /^(0|[1-9]\d*)$/.test(t);
|
|
237
241
|
}
|
|
238
|
-
function
|
|
242
|
+
function Mt(t) {
|
|
239
243
|
return /^-([1-9]\d*)$/.test(t);
|
|
240
244
|
}
|
|
241
245
|
function St(t) {
|
|
242
246
|
return /^(0|-(0|[1-9]\d*))$/.test(t);
|
|
243
247
|
}
|
|
244
|
-
function
|
|
245
|
-
return /^(?:(?:\+|00)86)?1(?:(?:3\d)|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8\d)|(?:9[
|
|
248
|
+
function xt(t) {
|
|
249
|
+
return /^(?:(?:\+|00)86)?1(?:(?:3\d)|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8\d)|(?:9[0-25-9]))\d{8}$/.test(
|
|
246
250
|
t
|
|
247
251
|
);
|
|
248
252
|
}
|
|
249
253
|
function Ft(t) {
|
|
250
254
|
return /^([\w-])+@([\w-])+(\.[\w-])+/.test(t);
|
|
251
255
|
}
|
|
252
|
-
function
|
|
256
|
+
function Rt(t) {
|
|
253
257
|
return t === "";
|
|
254
258
|
}
|
|
255
259
|
export {
|
|
@@ -258,7 +262,7 @@ export {
|
|
|
258
262
|
j as composeRight,
|
|
259
263
|
I as debounce,
|
|
260
264
|
X as debugWarn,
|
|
261
|
-
|
|
265
|
+
m as deepClone,
|
|
262
266
|
s as deepMerge,
|
|
263
267
|
D as error,
|
|
264
268
|
et as excludeProperties,
|
|
@@ -266,38 +270,39 @@ export {
|
|
|
266
270
|
ot as getRandomColor,
|
|
267
271
|
it as getRandomFloat,
|
|
268
272
|
st as getRandomInteger,
|
|
269
|
-
ut as
|
|
273
|
+
ut as getRandomPhoneNumber,
|
|
274
|
+
ct as getRandomString,
|
|
270
275
|
V as hasChanged,
|
|
271
276
|
$ as hasOwn,
|
|
272
277
|
U as initLog,
|
|
273
278
|
g as isArray,
|
|
274
279
|
Q as isBoolean,
|
|
275
|
-
|
|
280
|
+
ft as isChinese,
|
|
276
281
|
O as isDate,
|
|
277
282
|
G as isDef,
|
|
278
283
|
Ft as isEmail,
|
|
279
|
-
|
|
280
|
-
|
|
284
|
+
Rt as isEmptyString,
|
|
285
|
+
at as isEnglishAphabet,
|
|
281
286
|
bt as isFloat,
|
|
282
287
|
h as isFunction,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
Ot as isInteger,
|
|
289
|
+
ht as isLowerCase,
|
|
290
|
+
$t as isLowerCaseAndNumber,
|
|
291
|
+
mt as isLowerCaseAndNumberAndChinese,
|
|
287
292
|
z as isMap,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
293
|
+
xt as isMobilePhone,
|
|
294
|
+
At as isNegativeFloat,
|
|
295
|
+
Ct as isNegativeFloatOrZero,
|
|
296
|
+
Mt as isNegativeInteger,
|
|
292
297
|
St as isNegativeIntegerOrZero,
|
|
293
298
|
K as isNull,
|
|
294
299
|
W as isNumber,
|
|
295
|
-
|
|
300
|
+
dt as isNumberOrNumberString,
|
|
296
301
|
a as isObject,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
302
|
+
wt as isPositiveFloat,
|
|
303
|
+
Et as isPositiveFloatOrZero,
|
|
304
|
+
Nt as isPositiveInteger,
|
|
305
|
+
yt as isPositiveIntegerOrZero,
|
|
301
306
|
q as isPromise,
|
|
302
307
|
N as isRegExp,
|
|
303
308
|
T as isSet,
|
|
@@ -305,19 +310,19 @@ export {
|
|
|
305
310
|
_ as isSymbol,
|
|
306
311
|
d as isUndef,
|
|
307
312
|
B as isUndefined,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
313
|
+
lt as isUpperCase,
|
|
314
|
+
gt as isUpperCaseAndNumber,
|
|
315
|
+
pt as isUpperCaseAndNumberAndChinese,
|
|
316
|
+
P as log,
|
|
312
317
|
C as objectToString,
|
|
313
318
|
H as qs,
|
|
314
319
|
J as throttle,
|
|
315
|
-
|
|
320
|
+
x as throwError,
|
|
316
321
|
l as toTypeString,
|
|
317
322
|
v as validatorChineseOrEnglish,
|
|
318
323
|
k as validatorChineseOrEnglishOrNumber,
|
|
319
324
|
Y as validatorLatitudeOrLongitude,
|
|
320
325
|
tt as validatorUppercaseOrNumbersOrSpecial,
|
|
321
326
|
nt as validatorUppercaseOrNumbersOrUnderline,
|
|
322
|
-
|
|
327
|
+
L as warn
|
|
323
328
|
};
|