@gsc-basic/utils 1.3.5 → 1.3.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.d.ts +5 -20
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { titleCase } from "title-case";
|
|
|
3
3
|
import { compile as regexpToPath, pathToRegexp } from "path-to-regexp";
|
|
4
4
|
import ResizeObserver from "resize-observer-polyfill";
|
|
5
5
|
import { mode, pad } from "crypto-js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/string.d.ts
|
|
8
7
|
declare function pascalCase(value: string): string;
|
|
9
8
|
/**
|
|
@@ -85,10 +84,7 @@ interface EncryptionParams {
|
|
|
85
84
|
declare class AesEncryption implements Encryption {
|
|
86
85
|
private readonly key;
|
|
87
86
|
private readonly iv;
|
|
88
|
-
constructor({
|
|
89
|
-
key,
|
|
90
|
-
iv
|
|
91
|
-
}: EncryptionParams);
|
|
87
|
+
constructor({ key, iv }: EncryptionParams);
|
|
92
88
|
get getOptions(): {
|
|
93
89
|
mode: typeof mode.CTR;
|
|
94
90
|
padding: typeof pad.Pkcs7;
|
|
@@ -201,11 +197,7 @@ declare function downloadByData(data: BlobPart, filename: string, mime?: string,
|
|
|
201
197
|
* Download file according to file address
|
|
202
198
|
* @param {*} sUrl
|
|
203
199
|
*/
|
|
204
|
-
declare function downloadByUrl({
|
|
205
|
-
url,
|
|
206
|
-
target,
|
|
207
|
-
fileName
|
|
208
|
-
}: {
|
|
200
|
+
declare function downloadByUrl({ url, target, fileName }: {
|
|
209
201
|
url: string;
|
|
210
202
|
target?: TargetContext;
|
|
211
203
|
fileName?: string;
|
|
@@ -246,9 +238,7 @@ declare function getSlot(slots: Readonly<InternalSlots>, slot?: string, data?: a
|
|
|
246
238
|
declare function extendSlots(slots: Readonly<InternalSlots>, excludeKeys?: string[]): any;
|
|
247
239
|
//#endregion
|
|
248
240
|
//#region src/core/loadScript.d.ts
|
|
249
|
-
declare function loadScript(src: string, {
|
|
250
|
-
type
|
|
251
|
-
}?: {
|
|
241
|
+
declare function loadScript(src: string, { type }?: {
|
|
252
242
|
type?: string | undefined;
|
|
253
243
|
}): Promise<unknown>;
|
|
254
244
|
declare function unloadScript(src: string): Promise<void>;
|
|
@@ -340,18 +330,13 @@ declare function treeMap<T = any>(treeData: T[], opt: {
|
|
|
340
330
|
children?: string;
|
|
341
331
|
conversion: Fn;
|
|
342
332
|
}): T[];
|
|
343
|
-
declare function treeMapEach(data: any, {
|
|
344
|
-
children,
|
|
345
|
-
conversion
|
|
346
|
-
}: {
|
|
333
|
+
declare function treeMapEach(data: any, { children, conversion }: {
|
|
347
334
|
children?: string;
|
|
348
335
|
conversion: Fn;
|
|
349
336
|
}): any;
|
|
350
337
|
//#endregion
|
|
351
338
|
//#region src/core/uuid.d.ts
|
|
352
|
-
declare function buildUUID({
|
|
353
|
-
native
|
|
354
|
-
}?: {
|
|
339
|
+
declare function buildUUID({ native }?: {
|
|
355
340
|
native?: boolean | undefined;
|
|
356
341
|
}): string;
|
|
357
342
|
declare function buildShortUUID(prefix?: string): string;
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ You shall not disclose such Confidential Information and shall use it only in
|
|
|
7
7
|
accordance with the terms of the license agreement.
|
|
8
8
|
|
|
9
9
|
--- Build Info ---
|
|
10
|
-
Version: 1.3.
|
|
11
|
-
Build Time: 2026/
|
|
12
|
-
Build Commit:
|
|
10
|
+
Version: 1.3.5
|
|
11
|
+
Build Time: 2026/7/24 13:48:42
|
|
12
|
+
Build Commit: bf5044df25fefa2b374b5dfa6cd533cebaf4f662
|
|
13
13
|
*/
|
|
14
14
|
import{titleCase as e}from"title-case";import{camelCase as t,intersectionWith as n,isArray as r,isEqual as i,isFunction as a,isNil as o,isPlainObject as s,kebabCase as c,mergeWith as l,round as u,unionWith as d,upperFirst as f}from"lodash-es";import{compile as p,pathToRegexp as m}from"path-to-regexp";import h from"crypto-js/aes.js";import g from"crypto-js/enc-utf8.js";import _ from"crypto-js/pad-pkcs7.js";import v from"crypto-js/mode-ctr.js";import y from"crypto-js/md5.js";import b from"crypto-js/enc-base64.js";import x from"resize-observer-polyfill";import{v4 as S}from"uuid";function ee(e){return f(t(e))}function te(e){if(!e)return``;let t=c(e),n=e.replace(/[^A-Z0-9]/gi,``);if(n.length===t.replace(/-/g,``).length){let e=0,r=``;for(let i=0;i<t.length;i+=1){let a=t[i];if(a===`-`){let o=t[i-1],s=t[i+1],c=n[e],l=c&&c.toUpperCase()===c&&c.toLowerCase()!==c,u=i+1===t.length-1;if(o&&s&&/[a-z0-9]/.test(o)&&/[a-z0-9]/.test(s)&&(!/\d/.test(o)&&/\d/.test(s)||/\d/.test(o)&&!/\d/.test(s)&&!l||/\d/.test(o)&&!/\d/.test(s)&&l&&u))continue;r+=a}else r+=a,e+=1}t=r}return t}const C={mobile:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,tel:/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,numAndLetter:/^[A-Z0-9]+$/i,password:/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,email:/^[A-Z0-9._%+-\u4E00-\u9FA5]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,postalCode:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,identityCard:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,ip:/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,url:/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,httpsUrl:/^https:\/\//,domain:/^([0-9a-z-]+\.)+([a-z]{2,})$/i,plateNumber:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,md5:/^[a-f0-9]{32}$/i,base64:/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,uuid:/^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,version:/^\d+(?:\.\d+){2}$/,videoUrl:/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,imageUrl:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,chinese:/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,itcode:/^[a-z]+\d*$/i,numeric:/^\d+$/},ne=Object.prototype.toString;function w(e,t){return ne.call(e)===`[object ${t}]`}function T(e){return e!==null&&w(e,`Object`)}function re(e){return C.url.test(e)}function E(e){return Array.isArray(e)&&e.length>0}function ie(e){return Number.isInteger(e)&&e>=0}function ae(e){return C.numeric.test(e)}const D=typeof window>`u`,O=!D,k=O&&window.navigator.userAgent.toLowerCase().includes(`chrome`),A=O&&window.navigator.userAgent.toLowerCase().includes(`safari`),j=typeof window<`u`&&typeof document<`u`,oe=j&&`webkitLineClamp`in document.body.style,se=j&&typeof ResizeObserver<`u`,ce=e=>C.chinese.test(e),le=()=>`startViewTransition`in document&&window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches;function ue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function de(e,t){if(e==null)return{};var n,r,i=ue(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function M(e){"@babel/helpers - typeof";return M=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},M(e)}function fe(e,t){if(M(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(M(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pe(e){var t=fe(e,`string`);return M(t)==`symbol`?t:t+``}function N(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?P(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const me=[`matched`],he=(e,t)=>{let n=e;return n.install=r=>{r.component(n.name||n.displayName,e),t&&(r.config.globalProperties[t]=e)},e};function ge(e){if(!e)return e;let{matched:t}=e;return F(F({},de(e,me)),{},{matched:t?t.map(e=>({meta:e.meta,name:e.name,path:e.path})):void 0})}function I(e,t={}){let{target:n=`__blank`,noopener:r=!0,noreferrer:i=!0}=t||{},a=[];r&&a.push(`noopener=yes`),i&&a.push(`noreferrer=yes`),window.open(e,n,a.join(`,`))}function L(e,t,a=`replace`){return t?e?l(e,t,(e,t)=>{if(r(t)&&r(e))switch(a){case`union`:return d(e,t,i);case`intersection`:return n(e,t,i);case`concat`:return e.concat(t);case`replace`:return t;default:throw Error(`Unknown merge array strategy: ${a}`)}if(T(t)&&T(e))return L(e,t,a)}):t:e}function _e(e,t){if(!E(Object.keys(t)))return e;let n=``;for(let e in t){let r=t[e];Array.isArray(r)?n+=`${e}=${encodeURIComponent(r.join(`,`))}&`:n+=`${e}=${encodeURIComponent(r)}&`}return n=n.replace(/&$/,``),/\?$/.test(e)?e+n:e.replace(/\/?$/,`?`)+n}function ve(e){s(e)&&Object.keys(e).forEach(t=>{Reflect.deleteProperty(e,t)})}function ye(e){return[`$`,`(`,`)`,`*`,`+`,`.`,`[`,`]`,`?`,`\\`,`^`,`{`,`}`,`|`].includes(e)?`\\${e}`:e}function be(e){let t=[``,...[...e].map(e=>ye(e)),``].join(`.*`);return new RegExp(t,`i`)}function xe(e=``,t={}){let{size:n=14,family:r=getComputedStyle(document.documentElement).getPropertyValue(`--vxe-font-family`)||`sans-serif`}=t,i=document.createElement(`canvas`).getContext(`2d`);i.font=`${n}px ${r}`;let a=i.measureText(e),o=Math.abs(a.actualBoundingBoxLeft)+Math.abs(a.actualBoundingBoxRight);return Math.ceil(Math.max(a.width,o))}function R(e,t){return t?typeof t==`string`?` ${e}--${t}`:Array.isArray(t)?t.reduce((t,n)=>t+R(e,n),``):Object.keys(t).reduce((n,r)=>n+(t[r]?R(e,r):``),``):``}function z(e){return(t,n)=>(t&&typeof t!=`string`&&(n=t,t=``),t=t?`${e}__${t}`:e,`${t}${R(t,n)}`)}function Se(e,t=``){return[z(`${t}-${e}`)]}function Ce(e,t=``){let n=`${t}-${e}`;return[n,z(n)]}var we=class{constructor({key:e,iv:t}){N(this,`key`,void 0),N(this,`iv`,void 0),this.key=g.parse(e),this.iv=g.parse(t)}get getOptions(){return{mode:v,padding:_,iv:this.iv}}encryptByAES(e){return h.encrypt(e,this.key,this.getOptions).toString()}decryptByAES(e){return h.decrypt(e,this.key,this.getOptions).toString(g)}};function Te(e){return g.parse(e).toString(b)}function Ee(e){return b.parse(e).toString(g)}function De(e){return y(e).toString()}const Oe=()=>document.documentElement;function B(e){return!e||!e.getBoundingClientRect?0:e.getBoundingClientRect()}function ke(e){return(e||``).replace(/^\s+|\s+$/g,``)}function V(e,t){if(!e||!t)return!1;if(t.includes(` `))throw Error(`className should not contain space.`);return e.classList?e.classList.contains(t):` ${e.className} `.includes(` ${t} `)}function Ae(e,t,n){return n||(n=Oe()),n.style.setProperty(e,t),{prop:t}}function je(e,t){if(!e)return;let n=e.className,r=(t||``).split(` `);for(let t=0,i=r.length;t<i;t++){let i=r[t];i&&(e.classList?e.classList.add(i):V(e,i)||(n+=` ${i}`))}e.classList||(e.className=n)}function Me(e,t){if(!e||!t)return;let n=t.split(` `),r=` ${e.className} `;for(let t=0,i=n.length;t<i;t++){let i=n[t];i&&(e.classList?e.classList.remove(i):V(e,i)&&(r=r.replace(` ${i} `,` `)))}e.classList||(e.className=ke(r))}function Ne(e){let t=document.documentElement,n=t.scrollLeft,r=t.scrollTop,i=t.clientLeft,a=t.clientTop,o=window.scrollX,s=window.scrollY,c=B(e);if(!c)return{};let{left:l,top:u,width:d,height:f}=c,p=(o||n)-(i||0),m=(s||r)-(a||0),h=l+o,g=u+s,_=h-p,v=g-m,y=window.document.documentElement.clientWidth,b=window.document.documentElement.clientHeight;return{left:_,top:v,right:y-d-_,bottom:b-f-v,rightIncludeBody:y-_,bottomIncludeBody:b-v}}function Pe(e,t){let n=[`webkit`,`Moz`,`ms`,`OT`],r={};return n.forEach(n=>{r[`${n}${f(e)}`]=t}),F(F({},r),{},{[e]:t})}function Fe(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}function Ie(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}function Le(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}function Re(e){for(let t of e){let e=t.target.__resizeListeners__||[];e.length&&e.forEach(e=>{e()})}}function ze(e,t){D||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new x(Re),e.__ro__.observe(e)),e.__resizeListeners__.push(t))}function Be(e,t){!e||!e.__resizeListeners__||(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.__ro__.disconnect(),e.__ro__=null,e.__resizeListeners__=null))}function Ve(){let e=new Event(`resize`,{bubbles:!0,cancelable:!0});window.dispatchEvent(e)}function He(e,t={}){function n(e){let t=window.history[e];return function(...n){let r=new Event(e);return r.arguments=n,window.dispatchEvent(r),t.apply(this,n)}}return window.history.pushState=n(`pushState`),window.history.replaceState=n(`replaceState`),window.addEventListener(`popstate`,e,t),window.addEventListener(`hashchange`,e,t),window.addEventListener(`replaceState`,e,t),window.addEventListener(`pushState`,e,t),{removeListener:()=>{window.removeEventListener(`popstate`,e,t),window.removeEventListener(`hashchange`,e,t),window.removeEventListener(`replaceState`,e,t),window.removeEventListener(`pushState`,e,t)}}}function H(e){let t=e.split(`,`),n=t[0].match(/:(.*?);/)[1],r=window.atob(t[1]),i=r.length,a=new Uint8Array(i);for(;i--;)a[i]=r.charCodeAt(i);return new Blob([a],{type:n})}function U(e,t){return new Promise((n,r)=>{let i=document.createElement(`CANVAS`),a=i==null?void 0:i.getContext(`2d`),o=new Image;o.crossOrigin=``,o.onload=function(){if(!i||!a)return r();i.height=o.height,i.width=o.width,a.drawImage(o,0,0);let e=i.toDataURL(t||`image/png`);i=null,n(e)},o.src=e})}function Ue(e){let{loaded:t,total:n}=e;if(n<=0||o(n))return 0;let r=t/n;return u((r>1?1:r)*100)}function We(e,t,n,r){U(e).then(e=>{W(e,t,n,r)})}function W(e,t,n,r){G(H(e),t,n,r)}function G(e,t,n,r){let i=new Blob(r===void 0?[e]:[r,e],{type:n||`application/octet-stream`}),a=window.URL.createObjectURL(i),o=document.createElement(`a`);o.style.display=`none`,o.href=a,o.setAttribute(`download`,t),o.download===void 0&&o.setAttribute(`target`,`_blank`),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)}function Ge({url:e,target:t=`_blank`,fileName:n}){if(/iP/.test(window.navigator.userAgent))return!1;if(k||A){let t=document.createElement(`a`);return t.href=e,t.download=n||e.substring(e.lastIndexOf(`/`)+1,e.length),t.style.display=`none`,document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}return e.includes(`?`)||(e+=`?download`),I(e,{target:t}),!0}function K(e,t=`default`,n){if(!e||!Reflect.has(e,t)||!a(e[t]))return null;let r=e[t];return r?r(n):null}function Ke(e,t=[]){let n=Object.keys(e),r={};return n.forEach(n=>{if(t.includes(n))return null;r[n]=t=>K(e,n,t)}),r}function qe(e,{type:t=`text/javascript`}={}){return new Promise((n,r)=>{let i=!1,a=document.querySelector(`script[src="${e}"]`);if(!a)a=document.createElement(`script`),a.type=t,a.async=!0,a.src=e,i=!0;else if(a.hasAttribute(`data-loaded`)){n({el:a});return}a.addEventListener(`error`,r),a.addEventListener(`abort`,r),a.addEventListener(`load`,()=>{a.setAttribute(`data-loaded`,`true`),n({el:a})}),i&&document.head.appendChild(a)})}function Je(e){return new Promise((t,n)=>{let r=document.querySelector(`script[src="${e}"]`);if(!r){n();return}document.head.removeChild(r),t()})}function Ye(e,t,n){return X(e,t,n,!1)}function Xe(e,t,n){return X(e,t,n,!0).length>0}function q(e){return typeof e==`string`?e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`):e}const J=new Map;function Y(e,t){if(!Array.isArray(e))switch(typeof e){case`string`:e=[e];break;case`undefined`:e=[];break;default:throw TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(e=>{if(typeof e!=`string`){if(e===void 0)return!1;throw TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0})}function Ze(e,t){t=F({caseSensitive:!1},t);let n=e+JSON.stringify(t);if(J.has(n))return J.get(n);let r=e[0]===`!`;r&&(e=e.slice(1)),e=q(e).replace(/\\\*/g,`[\\s\\S]*`);let i=RegExp(`^${e}$`,t.caseSensitive?``:`i`);return i.negated=r,J.set(n,i),i}function X(e,t,n,r){if(e=Y(e,`inputs`),t=Y(t,`patterns`),t.length===0)return[];let i=t.map(e=>Ze(e,n)),{allPatterns:a}=n||{},o=[];for(let t of e){let e,n=i.map(()=>!1);for(let[r,a]of i.entries())if(a.test(t)&&(n[r]=!0,e=!a.negated,!e))break;if(!(e===!1||e===void 0&&i.some(e=>!e.negated)||a&&n.some((e,t)=>!e&&!i[t].negated))&&(o.push(t),r))break}return o}const Qe={id:`id`,children:`children`,pid:`pid`},Z=e=>Object.assign({},Qe,e);function $e(e,t,n={}){n=Z(n);let{children:r}=n,i=[...e];for(let e of i){if(t(e))return e;e[r]&&i.push(...e[r])}return null}function et(e,t,n={}){n=Z(n);let{children:r}=n,i=[...e],a=[];for(let e of i)t(e)&&a.push(e),e[r]&&i.push(...e[r]);return a}function tt(e,t,n={}){n=Z(n);let r=[],i=[...e],a=new Set,{children:o}=n;for(;i.length;){let e=i[0];if(a.has(e))r.pop(),i.shift();else if(a.add(e),e[o]&&i.unshift(...e[o]),r.push(e),t(e))return r}return null}function nt(e,t,n={}){n=Z(n);let r=[],i=[...e],a=[],o=new Set,{children:s}=n;for(;i.length;){let e=i[0];o.has(e)?(r.pop(),i.shift()):(o.add(e),e[s]&&i.unshift(...e[s]),r.push(e),t(e)&&a.push([...r]))}return a}function rt(e,t,n={}){n=Z(n);let r=n.children;function i(e){return e.map(e=>F({},e)).filter(e=>(e[r]=e[r]&&i(e[r]),t(e)||e[r]&&e[r].length))}return i(e)}function it(e,t,n={}){n=Z(n);let r=[...e],{children:i}=n;for(let e=0;e<r.length;e++){if(t(r[e]))return;i&&r[e][i]&&r.splice(e+1,0,...r[e][i])}}function at(e,t){return e.map(e=>Q(e,t))}function Q(e,{children:t=`children`,conversion:n}){let r=Array.isArray(e[t])&&e[t].length>0,i=n(e)||{};return r?F(F({},i),{},{[t]:e[t].map(e=>Q(e,{children:t,conversion:n}))}):F({},i)}function ot({native:e=!0}={}){var t,n,r;return e?(t=(n=window.crypto)==null||(r=n.randomUUID)==null?void 0:r.call(n))==null?S():t:S()}let $=0;function st(e=``){let t=Date.now(),n=Math.floor(Math.random()*1e9);return $++,`${e}_${n}${$}${String(t)}`}export{we as AesEncryption,x as ResizeObserver,je as addClass,He as addLocationListener,ze as addResizeListener,z as buildBEM,st as buildShortUUID,ot as buildUUID,Se as createBEM,Ce as createNamespace,be as createSearchReg,H as dataURLtoBlob,Ee as decodeByBase64,L as deepMerge,Ie as domOffEvent,Fe as domOnEvent,W as downloadByBase64,G as downloadByData,We as downloadByOnlineUrl,Ge as downloadByUrl,Ue as downloadPercent,le as enableTransitions,Te as encryptByBase64,De as encryptByMd5,q as escapeStringRegexp,Ke as extendSlots,rt as filterTree,$e as findNode,et as findNodeAll,tt as findPath,nt as findPathAll,it as forEachTree,xe as getActualWidthOfChars,B as getBoundingClientRect,ge as getRawRoute,K as getSlot,Ne as getViewportOffset,Pe as hackCss,V as hasClass,w as is,j as isBrowser,ce as isChineseText,k as isChrome,O as isClient,E as isIterableArray,Xe as isMatch,ae as isNumeric,T as isObject,ie as isPositiveInteger,A as isSafari,D as isServer,oe as isSupportNativeEllipsis,se as isSupportResizeObserver,re as isUrl,qe as loadScript,Ye as matcher,I as openWindow,ee as pascalCase,m as pathToRegexp,C as regexpMap,p as regexpToPath,Me as removeClass,Be as removeResizeListener,te as safeKebabCase,Ae as setCssVar,_e as setObjToUrlParams,e as titleCase,at as treeMap,Q as treeMapEach,Ve as triggerWindowResize,Je as unloadScript,ve as unsetAllProperty,U as urlToBase64,Le as useRafThrottle,he as withInstall};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gsc-basic/utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.6",
|
|
5
5
|
"description": "Web Dev Utils for GSC Basic Team",
|
|
6
6
|
"author": "Lenovo SSG BASD <-GSC_Scaffolding_Support@lenovo.com>",
|
|
7
7
|
"license": "LicenseRef-Proprietary",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"path-to-regexp": "^8.4.2",
|
|
38
38
|
"resize-observer-polyfill": "^1.5.1",
|
|
39
39
|
"title-case": "^4.3.2",
|
|
40
|
-
"uuid": "^14.0.
|
|
40
|
+
"uuid": "^14.0.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/crypto-js": "^4.2.2",
|