@lntvow/utils 2.0.9 → 2.0.11
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.mjs +1 -1
- package/package.json +1 -1
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 p=Object.prototype.toString,d=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=>d(t)==="[object Map]",C=t=>d(t)==="[object Set]",g=t=>d(t)==="[object Date]",b=t=>d(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,P=t=>t!=null,R=t=>typeof t=="boolean",u=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(u(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 u(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(u(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-])+(
|
|
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,d=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=>d(t)==="[object Map]",C=t=>d(t)==="[object Set]",g=t=>d(t)==="[object Date]",b=t=>d(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,P=t=>t!=null,R=t=>typeof t=="boolean",u=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(u(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 u(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(u(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=u;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=d;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.mjs
CHANGED