@lntvow/utils 1.8.14 → 1.8.16

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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function getRandomColor(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function getRandomString(f){return f>10?getRandomString(10)+getRandomString(f-10):Math.random().toString(36).padEnd(12,"0").slice(2,f+2)}const objectToString=Object.prototype.toString,toTypeString=f=>objectToString.call(f),log=(...f)=>console.log(`%c ${f[0]} `,"padding: 2px 2px; border-radius: 4px; color: #fff; background: #000; font-weight: bold;",f.slice(1).length>0?f.slice(1):""),warn=(...f)=>console.warn(...f),error=(...f)=>console.error(...f),isMap=f=>toTypeString(f)==="[object Map]",isSet=f=>toTypeString(f)==="[object Set]",isDate=f=>toTypeString(f)==="[object Date]",isRegExp=f=>toTypeString(f)==="[object RegExp]",isFunction=f=>typeof f=="function",isString=f=>typeof f=="string",isSymbol=f=>typeof f=="symbol",isObject=f=>f!==null&&typeof f=="object",isPromise=f=>isObject(f)&&isFunction(f.then)&&isFunction(f.catch),isUndef=f=>f==null,isUndefined=f=>f===void 0,isNull=f=>f===null;function isDef(f){return f!=null}function isBoolean(f){return typeof f=="boolean"}const isArray=Array.isArray,hasOwn=(f,p)=>Object.hasOwn(f,p),hasChanged=(f,p)=>f!==p;function deepClone(f){const p=new WeakMap;function c(d){if(isDate(d))return new Date(d);if(isRegExp(d))return new RegExp(d);if(isObject(d)){if(p.has(d))return p.get(d);let g={};if(isArray(d)){g=[],p.set(d,g);for(let h=0;h<d.length;h++)g[h]=c(d[h]);return g}p.set(d,g);for(const h in d)hasOwn(d,h)&&(g[h]=c(d[h]));return g}else return d}return c(f)}function deepMerge(f,p,c){return isArray(f)?arrayMerge(f,p,c):mergeObject(f,p,c)}function mergeObject(f,p,c){const d=process$1(p,c);return Object.keys(f).forEach(h=>{isUndef(p[h])?d[h]=process$1(f[h],c):d[h]=isObject(f[h])&&isObject(p[h])?deepMerge(f[h],p[h],c):process$1(p[h],c)}),d}function arrayMerge(f,p,c){if(isArray(p)){const d=process$1(p,c);return d.push(...process$1(f,c)),d}else return process$1(f,c)}function process$1(f,p){const{isDeepClone:c=!0}=p||{};return c?deepClone(f):f}function debounce(f,p=1e3){let c=null;return function(...d){c&&clearTimeout(c),c=setTimeout(()=>{f.apply(this,d)},p)}}function throttle(f,p=1e3){let c=null;return function(...d){if(isNull(c))return c=Date.now(),f.apply(this,d);{const g=Date.now();if(g-c>=p)return c=g,f.apply(this,d)}}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var vconsole_min={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function getRandomColor(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function getRandomString(f){return f>10?getRandomString(10)+getRandomString(f-10):Math.random().toString(36).padEnd(12,"0").slice(2,f+2)}const objectToString=Object.prototype.toString,toTypeString=f=>objectToString.call(f),log=(...f)=>console.log(`%c ${f[0]} `,"padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",f.slice(1).length>0?f.slice(1):""),warn=(...f)=>console.warn(...f),error=(...f)=>console.error(...f),isMap=f=>toTypeString(f)==="[object Map]",isSet=f=>toTypeString(f)==="[object Set]",isDate=f=>toTypeString(f)==="[object Date]",isRegExp=f=>toTypeString(f)==="[object RegExp]",isFunction=f=>typeof f=="function",isString=f=>typeof f=="string",isSymbol=f=>typeof f=="symbol",isObject=f=>f!==null&&typeof f=="object",isPromise=f=>isObject(f)&&isFunction(f.then)&&isFunction(f.catch),isUndef=f=>f==null,isUndefined=f=>f===void 0,isNull=f=>f===null;function isDef(f){return f!=null}function isBoolean(f){return typeof f=="boolean"}const isArray=Array.isArray,hasOwn=(f,p)=>Object.hasOwn(f,p),hasChanged=(f,p)=>f!==p;function deepClone(f){const p=new WeakMap;function c(d){if(isDate(d))return new Date(d);if(isRegExp(d))return new RegExp(d);if(isObject(d)){if(p.has(d))return p.get(d);let g={};if(isArray(d)){g=[],p.set(d,g);for(let h=0;h<d.length;h++)g[h]=c(d[h]);return g}p.set(d,g);for(const h in d)hasOwn(d,h)&&(g[h]=c(d[h]));return g}else return d}return c(f)}function deepMerge(f,p,c){return isArray(f)?arrayMerge(f,p,c):mergeObject(f,p,c)}function mergeObject(f,p,c){const d=process$1(p,c);return Object.keys(f).forEach(h=>{isUndef(p[h])?d[h]=process$1(f[h],c):d[h]=isObject(f[h])&&isObject(p[h])?deepMerge(f[h],p[h],c):process$1(p[h],c)}),d}function arrayMerge(f,p,c){if(isArray(p)){const d=process$1(p,c);return d.push(...process$1(f,c)),d}else return process$1(f,c)}function process$1(f,p){const{isDeepClone:c=!0}=p||{};return c?deepClone(f):f}function debounce(f,p=1e3){let c=null;return function(...d){c&&clearTimeout(c),c=setTimeout(()=>{f.apply(this,d)},p)}}function throttle(f,p=1e3){let c=null;return function(...d){if(isNull(c))return c=Date.now(),f.apply(this,d);{const g=Date.now();if(g-c>=p)return c=g,f.apply(this,d)}}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var vconsole_min={exports:{}};/*!
2
2
  * vConsole v3.15.1 (https://github.com/Tencent/vConsole)
3
3
  *
4
4
  * Tencent is pleased to support the open source community by making vConsole available.
package/dist/index.d.ts CHANGED
@@ -182,7 +182,7 @@ export declare function isUppercaseOrNumbersOrSpecial(value: string): boolean;
182
182
  */
183
183
  export declare function isUppercaseOrNumbersOrUnderline(value: string): boolean;
184
184
 
185
- export declare const log: (...arg: any[]) => void;
185
+ export declare const log: (...arg: unknown[]) => void;
186
186
 
187
187
  export declare const nConsole: {
188
188
  initConsole: typeof initConsole;
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ function getRandomString(f) {
6
6
  }
7
7
  const objectToString = Object.prototype.toString, toTypeString = (f) => objectToString.call(f), log = (...f) => console.log(
8
8
  `%c ${f[0]} `,
9
- "padding: 2px 2px; border-radius: 4px; color: #fff; background: #000; font-weight: bold;",
9
+ "padding: 2px; border-radius: 3px; color: #fff; background: #000; font-weight: bold;",
10
10
  f.slice(1).length > 0 ? f.slice(1) : ""
11
11
  ), warn = (...f) => console.warn(...f), error = (...f) => console.error(...f), isMap = (f) => toTypeString(f) === "[object Map]", isSet = (f) => toTypeString(f) === "[object Set]", isDate = (f) => toTypeString(f) === "[object Date]", isRegExp = (f) => toTypeString(f) === "[object RegExp]", isFunction = (f) => typeof f == "function", isString = (f) => typeof f == "string", isSymbol = (f) => typeof f == "symbol", isObject = (f) => f !== null && typeof f == "object", isPromise = (f) => isObject(f) && isFunction(f.then) && isFunction(f.catch), isUndef = (f) => f == null, isUndefined = (f) => f === void 0, isNull = (f) => f === null;
12
12
  function isDef(f) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lntvow/utils",
3
- "version": "1.8.14",
3
+ "version": "1.8.16",
4
4
  "description": "工具库",
5
5
  "type": "module",
6
6
  "license": "MIT",