@lntvow/utils 1.8.5 → 1.8.6
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 +2 -0
- package/dist/index.mjs +34 -33
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function w(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function d(t){return t>10?d(10)+d(t-10):Math.random().toString(36).padEnd(12,"0").slice(2,t+2)}const p=Object.prototype.toString,u=t=>p.call(t),y=(...t)=>console.log(`%c ${t[0]}: `,"padding: 2px 1px; border-radius: 3px 3px 3px 3px; color: #fff; background: #000; font-weight: bold;",t.slice(1)),C=(...t)=>console.warn(...t),E=(...t)=>console.error(...t),A=t=>u(t)==="[object Map]",$=t=>u(t)==="[object Set]",a=t=>u(t)==="[object Date]",g=t=>u(t)==="[object RegExp]",l=t=>typeof t=="function",j=t=>typeof t=="string",x=t=>typeof t=="symbol",c=t=>t!==null&&typeof t=="object",M=t=>c(t)&&l(t.then)&&l(t.catch),h=t=>t==null,b=t=>t===null;function N(t){return t!=null}function R(t){return typeof t=="boolean"}const f=Array.isArray,m=(t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function w(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function d(t){return t>10?d(10)+d(t-10):Math.random().toString(36).padEnd(12,"0").slice(2,t+2)}const p=Object.prototype.toString,u=t=>p.call(t),y=(...t)=>console.log(`%c ${t[0]}: `,"padding: 2px 1px; border-radius: 3px 3px 3px 3px; color: #fff; background: #000; font-weight: bold;",t.slice(1)),C=(...t)=>console.warn(...t),E=(...t)=>console.error(...t),A=t=>u(t)==="[object Map]",$=t=>u(t)==="[object Set]",a=t=>u(t)==="[object Date]",g=t=>u(t)==="[object RegExp]",l=t=>typeof t=="function",j=t=>typeof t=="string",x=t=>typeof t=="symbol",c=t=>t!==null&&typeof t=="object",M=t=>c(t)&&l(t.then)&&l(t.catch),h=t=>t==null,U=t=>t===void 0,b=t=>t===null;function N(t){return t!=null}function R(t){return typeof t=="boolean"}const f=Array.isArray,m=(t,e)=>Object.hasOwn(t,e),D=(t,e)=>t!==e;function O(t){const e=new WeakMap;function r(n){if(a(n))return new Date(n);if(g(n))return new RegExp(n);if(c(n)){if(e.has(n))return e.get(n);let o={};if(f(n)){o=[],e.set(n,o);for(let i=0;i<n.length;i++)o[i]=r(n[i]);return o}e.set(n,o);for(const i in n)m(n,i)&&(o[i]=r(n[i]));return o}else return n}return r(t)}function S(t,e,r){return f(t)?T(t,e,r):P(t,e,r)}function P(t,e,r){const n=s(e,r);return Object.keys(t).forEach(i=>{h(e[i])?n[i]=s(t[i],r):n[i]=c(t[i])&&c(e[i])?S(t[i],e[i],r):s(e[i],r)}),n}function T(t,e,r){if(f(e)){const n=s(e,r);return n.push(...s(t,r)),n}else return s(t,r)}function s(t,e){const{isDeepClone:r=!0}=e||{};return r?O(t):t}function F(t,e=1e3){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,...n)},e)}}function L(t,e=1e3){let r=null;return function(...n){if(b(r))return r=Date.now(),t.apply(this,...n);{const o=Date.now();if(o-r>=e)return r=o,t.apply(this,...n)}}}function Z(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function z(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function B(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 I(t){return/^([\w-])+@([\w-])+(.[\w-])+/.test(t)}function K(t){return/^[A-Z]+$/.test(t)}function _(t){return/^[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/^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t)}function H(t){return/^[A-Za-z\u4E00-\u9FA5]+$/.test(t)}function J(t){return/^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t)}function Q(t){return/^[\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/^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t)}exports.compose=Z;exports.composeRight=z;exports.debounce=F;exports.deepClone=O;exports.deepMerge=S;exports.error=E;exports.getRandomColor=w;exports.getRandomString=d;exports.hasChanged=D;exports.hasOwn=m;exports.isAlphanumericText=G;exports.isArray=f;exports.isBoolean=R;exports.isChineseOrEnglish=H;exports.isChineseOrEnglishOrNumber=J;exports.isDate=a;exports.isDef=N;exports.isEmail=I;exports.isFunction=l;exports.isLatitudeOrLongitude=q;exports.isLowerCase=_;exports.isMap=A;exports.isMobilePhone=B;exports.isNull=b;exports.isNumber=W;exports.isObject=c;exports.isPositiveFloat=Y;exports.isPositiveInt=X;exports.isPromise=M;exports.isRegExp=g;exports.isSet=$;exports.isString=j;exports.isSymbol=x;exports.isUndef=h;exports.isUndefined=U;exports.isUpperCase=K;exports.isUppercaseOrNumbersOrSpecial=Q;exports.isUppercaseOrNumbersOrUnderline=V;exports.log=y;exports.objectToString=p;exports.throttle=L;exports.toTypeString=u;exports.warn=C;
|
package/dist/index.d.ts
CHANGED
|
@@ -139,6 +139,8 @@ export declare const isSymbol: (val: unknown) => val is symbol;
|
|
|
139
139
|
|
|
140
140
|
export declare const isUndef: (val: unknown) => val is null | undefined;
|
|
141
141
|
|
|
142
|
+
export declare const isUndefined: (val: unknown) => val is undefined;
|
|
143
|
+
|
|
142
144
|
/**
|
|
143
145
|
* @description 校验大写字母
|
|
144
146
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ const l = Object.prototype.toString, u = (t) => l.call(t), E = (...t) => console
|
|
|
8
8
|
`%c ${t[0]}: `,
|
|
9
9
|
"padding: 2px 1px; border-radius: 3px 3px 3px 3px; color: #fff; background: #000; font-weight: bold;",
|
|
10
10
|
t.slice(1)
|
|
11
|
-
), j = (...t) => console.warn(...t), x = (...t) => console.error(...t), S = (t) => u(t) === "[object Map]", C = (t) => u(t) === "[object Set]", a = (t) => u(t) === "[object Date]", g = (t) => u(t) === "[object RegExp]", p = (t) => typeof t == "function", M = (t) => typeof t == "string", D = (t) => typeof t == "symbol", c = (t) => t !== null && typeof t == "object", R = (t) => c(t) && p(t.then) && p(t.catch), h = (t) => t == null, b = (t) => t === null;
|
|
11
|
+
), j = (...t) => console.warn(...t), x = (...t) => console.error(...t), S = (t) => u(t) === "[object Map]", C = (t) => u(t) === "[object Set]", a = (t) => u(t) === "[object Date]", g = (t) => u(t) === "[object RegExp]", p = (t) => typeof t == "function", M = (t) => typeof t == "string", D = (t) => typeof t == "symbol", c = (t) => t !== null && typeof t == "object", R = (t) => c(t) && p(t.then) && p(t.catch), h = (t) => t == null, U = (t) => t === void 0, b = (t) => t === null;
|
|
12
12
|
function Z(t) {
|
|
13
13
|
return t != null;
|
|
14
14
|
}
|
|
@@ -70,7 +70,7 @@ function T(t, e = 1e3) {
|
|
|
70
70
|
}, e);
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function z(t, e = 1e3) {
|
|
74
74
|
let r = null;
|
|
75
75
|
return function(...n) {
|
|
76
76
|
if (b(r))
|
|
@@ -82,60 +82,60 @@ function U(t, e = 1e3) {
|
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function P(...t) {
|
|
86
86
|
return t.reduce((e, r) => function(...n) {
|
|
87
87
|
return r(e(...n));
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function L(...t) {
|
|
91
91
|
return t.reduce((e, r) => function(...n) {
|
|
92
92
|
return e(r(...n));
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function K(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
|
|
100
|
+
function _(t) {
|
|
101
101
|
return /^([\w-])+@([\w-])+(.[\w-])+/.test(t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function B(t) {
|
|
104
104
|
return /^[A-Z]+$/.test(t);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function I(t) {
|
|
107
107
|
return /^[a-z]+$/.test(t);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function W(t) {
|
|
110
110
|
return /^\d+$/.test(t);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function q(t) {
|
|
113
113
|
return /^-?\d{1,3}\.\d{6}$/.test(t);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function G(t) {
|
|
116
116
|
return /^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function H(t) {
|
|
119
119
|
return /^[A-Za-z\u4E00-\u9FA5]+$/.test(t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function J(t) {
|
|
122
122
|
return /^[\dA-Za-z\u4E00-\u9FA5]+$/.test(t);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Q(t) {
|
|
125
125
|
return /^[\d!#$%&*@A-Z^]+$/.test(t);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function V(t) {
|
|
128
128
|
return /^[\dA-Z_]+$/.test(t);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function X(t) {
|
|
131
131
|
return /^[1-9]\d*$/.test(t);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Y(t) {
|
|
134
134
|
return /^(0*[1-9]+\d*\.?\d*|0+\.\d*[1-9]+\d*)$/.test(t);
|
|
135
135
|
}
|
|
136
136
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
P as compose,
|
|
138
|
+
L as composeRight,
|
|
139
139
|
T as debounce,
|
|
140
140
|
w as deepClone,
|
|
141
141
|
O as deepMerge,
|
|
@@ -144,36 +144,37 @@ export {
|
|
|
144
144
|
d as getRandomString,
|
|
145
145
|
N as hasChanged,
|
|
146
146
|
m as hasOwn,
|
|
147
|
-
|
|
147
|
+
G as isAlphanumericText,
|
|
148
148
|
f as isArray,
|
|
149
149
|
F as isBoolean,
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
H as isChineseOrEnglish,
|
|
151
|
+
J as isChineseOrEnglishOrNumber,
|
|
152
152
|
a as isDate,
|
|
153
153
|
Z as isDef,
|
|
154
|
-
|
|
154
|
+
_ as isEmail,
|
|
155
155
|
p as isFunction,
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
q as isLatitudeOrLongitude,
|
|
157
|
+
I as isLowerCase,
|
|
158
158
|
S as isMap,
|
|
159
|
-
|
|
159
|
+
K as isMobilePhone,
|
|
160
160
|
b as isNull,
|
|
161
|
-
|
|
161
|
+
W as isNumber,
|
|
162
162
|
c as isObject,
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
Y as isPositiveFloat,
|
|
164
|
+
X as isPositiveInt,
|
|
165
165
|
R as isPromise,
|
|
166
166
|
g as isRegExp,
|
|
167
167
|
C as isSet,
|
|
168
168
|
M as isString,
|
|
169
169
|
D as isSymbol,
|
|
170
170
|
h as isUndef,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Q as
|
|
171
|
+
U as isUndefined,
|
|
172
|
+
B as isUpperCase,
|
|
173
|
+
Q as isUppercaseOrNumbersOrSpecial,
|
|
174
|
+
V as isUppercaseOrNumbersOrUnderline,
|
|
174
175
|
E as log,
|
|
175
176
|
l as objectToString,
|
|
176
|
-
|
|
177
|
+
z as throttle,
|
|
177
178
|
u as toTypeString,
|
|
178
179
|
j as warn
|
|
179
180
|
};
|