qsu 1.4.0 → 1.4.1

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 CHANGED
@@ -64,14 +64,6 @@ export default class Qsu {
64
64
  static truncateExpect<N extends number>(str: string, expectLength: PositiveNumber<N>, endStringChar?: string): string;
65
65
  static split(str: string, ...splitter: any[]): string[];
66
66
  static split(str: string, ...splitter: Array<string>): string[];
67
- static encrypt(str: string, secret: string, algorithm?: string, ivSize?: number, toBase64?: boolean): string;
68
- static decrypt(str: string, secret: string, algorithm?: string, toBase64?: boolean): string;
69
- static md5(str: string): string;
70
- static sha1(str: string): string;
71
- static sha256(str: string): string;
72
- static encodeBase64(str: string): string;
73
- static decodeBase64(encodedStr: string): string;
74
- static strToNumberHash(str: string): number;
75
67
  static strToAscii(str: string): number[];
76
68
  static strUnique(str: string): string;
77
69
  static urlJoin(...args: any[]): string;
@@ -91,6 +83,16 @@ export default class Qsu {
91
83
  static fileSize<N extends number>(bytes: PositiveNumber<N>, decimals?: number): string;
92
84
  static fileExt(filePath: string): string;
93
85
  static duration(milliseconds: number, options?: DurationOptions): string;
86
+ static safeJSONParse(jsonString: any, fallback?: {}): AnyValueObject;
87
+ static safeParseInt(value: any, fallback?: number, radix?: number): number;
88
+ static encrypt(str: string, secret: string, algorithm?: string, ivSize?: number, toBase64?: boolean): string;
89
+ static decrypt(str: string, secret: string, algorithm?: string, toBase64?: boolean): string;
90
+ static md5(str: string): string;
91
+ static sha1(str: string): string;
92
+ static sha256(str: string): string;
93
+ static encodeBase64(str: string): string;
94
+ static decodeBase64(encodedStr: string): string;
95
+ static strToNumberHash(str: string): number;
94
96
  }
95
97
  export { Qsu };
96
- export declare const sleep: typeof Qsu.sleep, funcTimes: typeof Qsu.funcTimes, debounce: typeof Qsu.debounce, objectId: typeof Qsu.objectId, numRandom: typeof Qsu.numRandom, sum: typeof Qsu.sum, mul: typeof Qsu.mul, sub: typeof Qsu.sub, div: typeof Qsu.div, dayDiff: typeof Qsu.dayDiff, today: typeof Qsu.today, isValidDate: typeof Qsu.isValidDate, dateToYYYYMMDD: typeof Qsu.dateToYYYYMMDD, createDateListFromRange: typeof Qsu.createDateListFromRange, arrShuffle: typeof Qsu.arrShuffle, arrWithDefault: typeof Qsu.arrWithDefault, arrUnique: typeof Qsu.arrUnique, arrWithNumber: typeof Qsu.arrWithNumber, arrRepeat: typeof Qsu.arrRepeat, arrCount: typeof Qsu.arrCount, average: typeof Qsu.average, arrMove: typeof Qsu.arrMove, arrTo1dArray: typeof Qsu.arrTo1dArray, sortByObjectKey: typeof Qsu.sortByObjectKey, sortNumeric: typeof Qsu.sortNumeric, arrGroupByMaxCount: typeof Qsu.arrGroupByMaxCount, objToQueryString: typeof Qsu.objToQueryString, objToPrettyStr: typeof Qsu.objToPrettyStr, objFindItemRecursiveByKey: typeof Qsu.objFindItemRecursiveByKey, objToArray: typeof Qsu.objToArray, objectTo1d: typeof Qsu.objectTo1d, objDeleteKeyByValue: typeof Qsu.objDeleteKeyByValue, objUpdate: typeof Qsu.objUpdate, trim: typeof Qsu.trim, replaceBetween: typeof Qsu.replaceBetween, removeSpecialChar: typeof Qsu.removeSpecialChar, removeNewLine: typeof Qsu.removeNewLine, capitalizeFirst: typeof Qsu.capitalizeFirst, capitalizeEverySentence: typeof Qsu.capitalizeEverySentence, capitalizeEachWords: typeof Qsu.capitalizeEachWords, strCount: typeof Qsu.strCount, strShuffle: typeof Qsu.strShuffle, strRandom: typeof Qsu.strRandom, strBlindRandom: typeof Qsu.strBlindRandom, truncate: typeof Qsu.truncate, truncateExpect: typeof Qsu.truncateExpect, split: typeof Qsu.split, encrypt: typeof Qsu.encrypt, decrypt: typeof Qsu.decrypt, md5: typeof Qsu.md5, sha1: typeof Qsu.sha1, sha256: typeof Qsu.sha256, encodeBase64: typeof Qsu.encodeBase64, decodeBase64: typeof Qsu.decodeBase64, strToNumberHash: typeof Qsu.strToNumberHash, strUnique: typeof Qsu.strUnique, strToAscii: typeof Qsu.strToAscii, urlJoin: typeof Qsu.urlJoin, isObject: typeof Qsu.isObject, isEqual: typeof Qsu.isEqual, isEqualStrict: typeof Qsu.isEqualStrict, isEmpty: typeof Qsu.isEmpty, isUrl: typeof Qsu.isUrl, contains: typeof Qsu.contains, is2dArray: typeof Qsu.is2dArray, between: typeof Qsu.between, len: typeof Qsu.len, isEmail: typeof Qsu.isEmail, isTrueMinimumNumberOfTimes: typeof Qsu.isTrueMinimumNumberOfTimes, numberFormat: typeof Qsu.numberFormat, fileName: typeof Qsu.fileName, fileSize: typeof Qsu.fileSize, fileExt: typeof Qsu.fileExt, duration: typeof Qsu.duration;
98
+ export declare const sleep: typeof Qsu.sleep, funcTimes: typeof Qsu.funcTimes, debounce: typeof Qsu.debounce, objectId: typeof Qsu.objectId, numRandom: typeof Qsu.numRandom, sum: typeof Qsu.sum, mul: typeof Qsu.mul, sub: typeof Qsu.sub, div: typeof Qsu.div, dayDiff: typeof Qsu.dayDiff, today: typeof Qsu.today, isValidDate: typeof Qsu.isValidDate, dateToYYYYMMDD: typeof Qsu.dateToYYYYMMDD, createDateListFromRange: typeof Qsu.createDateListFromRange, arrShuffle: typeof Qsu.arrShuffle, arrWithDefault: typeof Qsu.arrWithDefault, arrUnique: typeof Qsu.arrUnique, arrWithNumber: typeof Qsu.arrWithNumber, arrRepeat: typeof Qsu.arrRepeat, arrCount: typeof Qsu.arrCount, average: typeof Qsu.average, arrMove: typeof Qsu.arrMove, arrTo1dArray: typeof Qsu.arrTo1dArray, sortByObjectKey: typeof Qsu.sortByObjectKey, sortNumeric: typeof Qsu.sortNumeric, arrGroupByMaxCount: typeof Qsu.arrGroupByMaxCount, objToQueryString: typeof Qsu.objToQueryString, objToPrettyStr: typeof Qsu.objToPrettyStr, objFindItemRecursiveByKey: typeof Qsu.objFindItemRecursiveByKey, objToArray: typeof Qsu.objToArray, objectTo1d: typeof Qsu.objectTo1d, objDeleteKeyByValue: typeof Qsu.objDeleteKeyByValue, objUpdate: typeof Qsu.objUpdate, trim: typeof Qsu.trim, replaceBetween: typeof Qsu.replaceBetween, removeSpecialChar: typeof Qsu.removeSpecialChar, removeNewLine: typeof Qsu.removeNewLine, capitalizeFirst: typeof Qsu.capitalizeFirst, capitalizeEverySentence: typeof Qsu.capitalizeEverySentence, capitalizeEachWords: typeof Qsu.capitalizeEachWords, strCount: typeof Qsu.strCount, strShuffle: typeof Qsu.strShuffle, strRandom: typeof Qsu.strRandom, strBlindRandom: typeof Qsu.strBlindRandom, truncate: typeof Qsu.truncate, truncateExpect: typeof Qsu.truncateExpect, split: typeof Qsu.split, encrypt: typeof Qsu.encrypt, decrypt: typeof Qsu.decrypt, md5: typeof Qsu.md5, sha1: typeof Qsu.sha1, sha256: typeof Qsu.sha256, encodeBase64: typeof Qsu.encodeBase64, decodeBase64: typeof Qsu.decodeBase64, strToNumberHash: typeof Qsu.strToNumberHash, strUnique: typeof Qsu.strUnique, strToAscii: typeof Qsu.strToAscii, urlJoin: typeof Qsu.urlJoin, isObject: typeof Qsu.isObject, isEqual: typeof Qsu.isEqual, isEqualStrict: typeof Qsu.isEqualStrict, isEmpty: typeof Qsu.isEmpty, isUrl: typeof Qsu.isUrl, contains: typeof Qsu.contains, is2dArray: typeof Qsu.is2dArray, between: typeof Qsu.between, len: typeof Qsu.len, isEmail: typeof Qsu.isEmail, isTrueMinimumNumberOfTimes: typeof Qsu.isTrueMinimumNumberOfTimes, numberFormat: typeof Qsu.numberFormat, fileName: typeof Qsu.fileName, fileSize: typeof Qsu.fileSize, fileExt: typeof Qsu.fileExt, safeJSONParse: typeof Qsu.safeJSONParse, safeParseInt: typeof Qsu.safeParseInt, duration: typeof Qsu.duration;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{basename as t,extname as e,win32 as r}from"path";import{randomBytes as n,createCipheriv as a,createDecipheriv as s,createHash as i}from"crypto";export default class o{static sleep(t){return new Promise((e=>{setTimeout(e,t)}))}static funcTimes(t,e){const r=[];for(let n=0;n<t;n+=1)r[n]="function"==typeof e?e.call():e;return r}static debounce(t,e){let r;return(...n)=>{clearTimeout(r),r=setTimeout((()=>{t.apply(this,n)}),e)}}static objectId(){return Math.floor(Date.now()/1e3).toString(16)+"x".repeat(16).replace(/x/g,(()=>Math.floor(16*Math.random()).toString(16)))}static numRandom(t,e){if(!t&&!e)return Math.random()>.5?1:0;const r=e||t,n=!e||t>=e?null:t;return Math.floor(Math.random()*(n?r-n+1:r+1))+(n||0)}static sum(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=0;for(let t=0,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r+=e[t]);return r}static mul(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=e[0];for(let t=1,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r*=e[t]);return r}static sub(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=e[0];for(let t=1,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r-=e[t]);return r}static div(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=e[0];for(let t=1,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r/=e[t]);return r}static dayDiff(t,e){const r=e||new Date;return Math.ceil(Math.abs(r.getTime()-t.getTime())/864e5)}static today(t="-",e=!0){const r=new Date,n=r.getMonth()+1,a=r.getDate(),s=[`${n<10?"0":""}${n}`,`${a<10?"0":""}${a}`];return e?s.unshift(r.getFullYear().toString()):s.push(r.getFullYear().toString()),s.join(t)}static isValidDate(t){if(!/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(t))throw new Error("The date format must be 'YYYY-MM-DD'");const e=t.split("-");return/^(?=\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(?:\x20|$))|(?:2[0-8]|1\d|0?[1-9]))([-./])(?:1[012]|0?[1-9])\1(?:1[6-9]|[2-9]\d)?\d\d(?:(?=\x20\d)\x20|$))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/.test(`${parseInt(e[2],10)}-${parseInt(e[1],10)}-${parseInt(e[0],10)}`)}static dateToYYYYMMDD(t,e="-"){const r=t.getMonth()+1,n=t.getDate();return`${t.getFullYear()}${e}${r<10?`0${r}`:r}${e}${n<10?`0${n}`:n}`}static createDateListFromRange(t,e){if(!o.isValidDate(o.dateToYYYYMMDD(t))||!o.isValidDate(o.dateToYYYYMMDD(e)))throw new Error("Either the start date or end date is an invalid date.");if(Math.floor((Date.parse(e.toString())-Date.parse(t.toString()))/864e5)<0)throw new Error("The start date is more recent than the end date.");const r=o.dateToYYYYMMDD(e),n=[];let a=t.getFullYear(),s=t.getMonth()+1,i=t.getDate(),c="";const l=(t,e,r)=>`${t}-${e<10?"0":""}${e}-${r<10?"0":""}${r}`;for(;r!==c;){/[0-9]{4}-12-31/g.test(c)&&(a+=1,s=1,i=1);const t=l(a,s,i);o.isValidDate(t)?(i+=1,n.push(t),c=t):(s+=1,i=1,c=l(a,s,i))}return n}static arrShuffle(t){if(1===t.length)return t[0];const e=t;for(let r=t.length-1;r>0;r-=1){const n=Math.floor(Math.random()*(r+1));[e[r],e[n]]=[t[n],t[r]]}return e}static arrWithDefault(t,e=0){return e<1?[]:Array(e).fill(t)}static arrUnique(t){return o.is2dArray(t)?Array.from(new Set(t.map((t=>JSON.stringify(t)))),(t=>JSON.parse(t))):[...new Set(t)]}static arrWithNumber(t,e){if(t>e)throw new Error("`end` is greater than `start`.");return Array.from({length:e-t+1},((e,r)=>r+t))}static average(t){return t.reduce(((t,e)=>t+e),0)/t.length}static arrMove(t,e,r){const n=t.length;if(n<=e||n<=r)throw new Error("Invalid move params");return t.splice(r,0,t.splice(e,1)[0]),t}static arrTo1dArray(t){const e=t=>{const r=[],n=t.length;for(let a=0;a<n;a+=1)"object"!=typeof t[a]?r.push(t[a]):o.is2dArray(t[a])?r.push(...e(t[a])):r.push(...t[a]);return r};return e(t)}static arrRepeat(t,e){if(!t||e<1||"object"!=typeof t)return[];const r=o.isObject(t),n=[];for(let a=0,s=e;a<s;a+=1)r?n.push(t):n.push(...t);return n}static arrCount(t){const e={};for(let r=0;r<t.length;r+=1){const n=t[r];e[n]=(e[n]||0)+1}return e}static sortByObjectKey(t,e,r=!1,n=!1){if(n){const n=new Intl.Collator([],{numeric:!0}),a=t.sort(((t,r)=>n.compare(t[e],r[e])));return r?a.reverse():a}return t.sort(((t,n)=>r?t[e]>n[e]?-1:t[e]<n[e]?1:0:t[e]<n[e]?-1:t[e]>n[e]?1:0))}static sortNumeric(t,e=!1){const r=new Intl.Collator([],{numeric:!0}),n=t.sort(((t,e)=>r.compare(t,e)));return e?n.reverse():n}static arrGroupByMaxCount(t,e=1){const r=[],n=t.length;let a=[];for(let s=0;s<n;s+=1)a.length===e&&(r.push(a),a=[]),a.push(t[s]);return a.length>0&&r.push(a),r}static objToQueryString(t){return Object.keys(t).map((e=>{let r=t[e];return"object"==typeof r&&(r=JSON.stringify(r)),`${encodeURIComponent(e)}=${encodeURIComponent(r)}`})).join("&")}static objFindItemRecursiveByKey(t,e,r,n){const a=t=>{let s;s="object"==typeof t&&Array.isArray(t)?t:[t];for(let t=0,i=s.length;t<i;t+=1){if(s[t][e]===r)return s[t];if(!o.isEmpty(s[t][n])){const e=a(s[t][n]);if(e)return e}}return null};return a(t)}static objToPrettyStr(t){return JSON.stringify(t,null,"\t")}static objToArray(t,e=!1){const r=t=>{const n=[],a=Object.keys(t).length;for(let s=0;s<a;s+=1){const a=Object.keys(t)[s];e&&o.isObject(t[a])?n.push([a,r(t[a])]):n.push([a,t[a]])}return n};return r(t)}static objectTo1d(t,e="."){if(!e||e.length<1)throw new Error("`separator` must have value at least 1 character.");const r=(t,n="")=>{let a={};const s=Object.keys(t).length,i=n.length<1;for(let c=0;c<s;c+=1){const s=Object.keys(t)[c],l=t[s],u=`${n}${i?"":e}${s}`;o.isObject(l)?(a=Object.assign(a,r(l,u)),delete a[s]):a[u]=l}return a};return r(t)}static objDeleteKeyByValue(t,e,r=!1){if(!t||"object"!=typeof t)return null;const n=Object.assign(t,{});for(let t=Object.keys(n).length;t>=0;t-=1){const a=Object.keys(n)[t];r&&n[a]&&o.isObject(n[a])?o.objDeleteKeyByValue(n[a],e,r):n[a]===e&&delete n[a]}return n}static objUpdate(t,e,r,n=!1,a=!1){if(!t||"object"!=typeof t)return null;const s=Object.assign(t,{});let i=!1;const c=t=>{for(let a=0;a<Object.keys(t).length;a+=1){const s=Object.keys(t)[a];n&&t[s]&&o.isObject(t[s])&&c(t[s]),Object.hasOwn(t,e)&&(t[e]=r,i=!0)}};return c(s),!i&&a&&(s[e]=r),s}static trim(t){return"string"==typeof t||t?t.trim().replace(/\s{2,}/g," "):null}static removeSpecialChar(t,e){return t?t.replace(new RegExp(`[^a-zA-Z가-힣ㄱ-ㅎㅏ-ㅣ0-9぀-ヿ㐀-䶿一-鿿豈-﫿ヲ-゚${e??""}]`,"gi"),""):""}static replaceBetween(t,e,r,n=""){if(!t)return"";const a=/[.*+?^${}()|[\]\\]/g,s=a.test(e)?`\\${e}`:e,i=a.test(r)?`\\${r}`:r;return t.replace(new RegExp(`${s}.*?${i}`,"g"),n)}static removeNewLine(t,e=""){return t?t.replace(/(\r\n|\n|\r)/gm,e).trim():""}static capitalizeFirst(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""}static capitalizeEverySentence(t,e){if(!t)return"";const r=e||".",n=t.split(r);let a,s="";for(let t=0,e=n.length;t<e;t+=1){a=[...n[t]];for(let e=0,r=a.length;e<r;e+=1)if(/[a-zA-Z]/.test(n[t][e])){a[e]=n[t][e].toUpperCase();break}s+=`${a.join("")}${t<e-1?r:""}`}return s}static capitalizeEachWords(t,e){if(!t)return"";const r=t.trim().toLowerCase().split(" ");for(let t=0,n=r.length;t<n;t+=1)e&&o.contains(r[t],["in","on","the","at","and","or","of","for","to","that","a","by","it","is","as","are","were","was","nor","an"],!0)||(r[t]=o.capitalizeFirst(r[t]));return o.capitalizeFirst(r.join(" "))}static strCount(t,e){if(!t||!e)return 0;let r=0,n=t.indexOf(e);for(;n>-1;)r+=1,n=t.indexOf(e,n+=e.length);return r}static strShuffle(t){return t?[...t].sort((()=>Math.random()-.5)).join(""):""}static strRandom(t,e){const r=`abcdefghijklmnopqrstuvwxyz0123456789${e}`,n=r.length;let a,s="";for(let e=0;e<t;e+=1)a=r.charAt(Math.floor(Math.random()*n)),a=Math.random()<.5?a.toUpperCase():a,s+=a;return s}static strBlindRandom(t,e,r="*"){if(!t)return"";let n=t,a=0,s=0,i=0;const c=n.length;for(;a<e&&i<c;)s=o.numRandom(0,c),/[a-zA-Z가-힣]/.test(n.substring(s,s+1))&&(n=`${n.substring(0,s+1)}${r}${n.substring(s+2)}`,a+=1),i+=1;return n}static truncate(t,e,r=""){if(!t)return"";let n=t;return t.length>e&&(n=t.substring(0,e)+r),n}static truncateExpect(t,e,r="."){if(!t)return"";const n=t.slice(-1)===r,a=t.split(r),s=a.length;let i="",o=0;for(let t=0;t<s&&o<e;t+=1)i+=`${a[t]}${t!==s-1||n?r:""}`,o+=a[t].length+r.length;return i}static split(t,...e){if(!t)return[];const r=e.length>0&&"object"==typeof e[0]?e[0]:e,n=r.length;let a="",s="";for(let t=0;t<n;t+=1){const e=r[t];e.length>1?s+=`${s.length<1?"":"|"}${e.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/]/g,"\\]").replace(/\?/g,"\\?").replace(/\./g,"\\.").replace(/\{/g,"\\{").replace(/}/g,"\\}").replace(/\+/g,"\\+")}`:a+="-"===e||"["===e||"]"===e?`\\${e}`:e}return a.length<1&&s.length<1?[t]:(a.length>0&&(a=`[${a}]`,s.length>0&&(s=`|${s}`)),t.split(new RegExp(`${a}${s}+`,"gi")))}static encrypt(t,e,r="aes-256-cbc",s=16,i=!1){if(!t||t.length<1)return"";const o=n(s),c=a(r,e,o);let l=c.update(t);l=Buffer.concat([l,c.final()]);const u=i?"base64":"hex";return`${o.toString(u)}:${l.toString(u)}`}static decrypt(t,e,r="aes-256-cbc",n=!1){if(!t||t.length<1)return"";const a=n?"base64":"hex",i=t.split(":"),o=s(r,e,Buffer.from(i.shift(),a));let c=o.update(Buffer.from(i.join(":"),a));return c=Buffer.concat([c,o.final()]),c.toString()}static md5(t){return i("md5").update(t).digest("hex")}static sha1(t){return i("sha1").update(t).digest("hex")}static sha256(t){return i("sha256").update(t).digest("hex")}static encodeBase64(t){return Buffer.from(t,"utf8").toString("base64")}static decodeBase64(t){return Buffer.from(t,"base64").toString("utf8")}static strToNumberHash(t){if(!t)return 0;let e=0;for(let r=0;r<t.length;r+=1)e=(e<<5)-e+t.charCodeAt(r),e|=0;return e}static strToAscii(t){const e=[];for(let r=0;r<t.length;r+=1)e.push(t.charCodeAt(r));return e}static strUnique(t){return t?[...new Set(t)].join(""):""}static urlJoin(...t){if(!t)return"";const e=t.length;let r="",n=0;for(let a=0;a<e;a+=1)null!==t[a]&&void 0!==t[a]&&(0===n||t[a].startsWith("/")||t[a].startsWith("?")||t[a].startsWith("&")?r+=t[a]:r+=`/${t[a]}`,n+=1);return r.replace(/\/$/g,"")}static isObject(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}static isEqual(t,...e){const r=e.length>0&&"object"==typeof e[0]?e[0]:e,n=r.length;for(let e=0;e<n;e+=1)if(r[e]!=t)return!1;return!0}static isEqualStrict(t,...e){const r=e.length>0&&"object"==typeof e[0]?e[0]:e,n=r.length;for(let e=0;e<n;e+=1)if(r[e]!==t)return!1;return!0}static isEmpty(t){if(!t)return!0;switch(typeof t){case"string":return t.length<1;case"object":return Array.isArray(t)?t.length<1:Object.keys(t).length<1;default:return!1}}static isUrl(t,e=!1,r=!1){if(r&&-1===t.indexOf("."))return!1;try{new URL(`${e&&-1===t.indexOf("://")?"https://":""}${t}`).toString()}catch(t){return!1}return!0}static contains(t,e,r=!1){if("string"==typeof e)return!(t.length<1)&&-1!==t.indexOf(e);for(let n=0,a=e.length;n<a;n+=1)if(r){if(t===e[n])return!0}else if(-1!==t.indexOf(e[n]))return!0;return!1}static is2dArray(t){return t.filter(Array.isArray).length>0}static between(t,e,r=!1){const n=Math.min.apply(Math,[t[0],t[1]]),a=Math.max.apply(Math,[t[0],t[1]]);return r?e>=n&&e<=a:e>n&&e<a}static len(t){if(!t)return 0;switch(typeof t){case"object":return Array.isArray(t)?t.length:Object.keys(t).length;case"number":case"bigint":return t.toString().length;case"boolean":return t?4:5;case"function":return t().length;default:return t.length}}static isEmail(t){return/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(t)}static isTrueMinimumNumberOfTimes(t,e=1){const r=t.length;let n=0;for(let e=0;e<r;e+=1)"boolean"==typeof t[e]&&t[e]&&(n+=1);return n>=e}static numberFormat(t){return(new Intl.NumberFormat).format(t)}static fileName(n,a=!1){return n?-1===n.indexOf("/")?a?r.basename(n):r.basename(n,e(n)):a?t(n):t(n,e(n)):""}static fileSize(t,e=2){if(!t||0===t||t<0)return"0 Bytes";const r=Math.floor(Math.log(t)/Math.log(1024));return`${parseFloat((t/1024**r).toFixed(e<0?0:e))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`}static fileExt(t){if(-1===t.indexOf("."))return"Unknown";const e=t.trim().toLowerCase().split(".");return e.length>0?e[e.length-1]:"Unknown"}static duration(t,e){const{useShortString:r=!1,useSpace:n=!0,withZeroValue:a=!1,separator:s=" "}={...e},i=[{name:"Millisecond",short:"ms",divider:1e3},{name:"Second",short:"S",divider:60},{name:"Minute",short:"M",divider:60},{name:"Hour",short:"H",divider:24},{name:"Day",short:"D",divider:31}],o=[];let c=t;for(let t=0;t<i.length;t+=1){const e=i[t];let s=c%e.divider;t===i.length-1?s=Math.trunc(c):c=(c-s)/e.divider,(a||!a&&0!==s)&&o.push(`${s}${n?" ":""}${r?e.short:`${e.name}${s<2?"":"s"}`}`)}return o.reverse().join(s)}}export{o as Qsu};export const{sleep:sleep,funcTimes:funcTimes,debounce:debounce,objectId:objectId,numRandom:numRandom,sum:sum,mul:mul,sub:sub,div:div,dayDiff:dayDiff,today:today,isValidDate:isValidDate,dateToYYYYMMDD:dateToYYYYMMDD,createDateListFromRange:createDateListFromRange,arrShuffle:arrShuffle,arrWithDefault:arrWithDefault,arrUnique:arrUnique,arrWithNumber:arrWithNumber,arrRepeat:arrRepeat,arrCount:arrCount,average:average,arrMove:arrMove,arrTo1dArray:arrTo1dArray,sortByObjectKey:sortByObjectKey,sortNumeric:sortNumeric,arrGroupByMaxCount:arrGroupByMaxCount,objToQueryString:objToQueryString,objToPrettyStr:objToPrettyStr,objFindItemRecursiveByKey:objFindItemRecursiveByKey,objToArray:objToArray,objectTo1d:objectTo1d,objDeleteKeyByValue:objDeleteKeyByValue,objUpdate:objUpdate,trim:trim,replaceBetween:replaceBetween,removeSpecialChar:removeSpecialChar,removeNewLine:removeNewLine,capitalizeFirst:capitalizeFirst,capitalizeEverySentence:capitalizeEverySentence,capitalizeEachWords:capitalizeEachWords,strCount:strCount,strShuffle:strShuffle,strRandom:strRandom,strBlindRandom:strBlindRandom,truncate:truncate,truncateExpect:truncateExpect,split:split,encrypt:encrypt,decrypt:decrypt,md5:md5,sha1:sha1,sha256:sha256,encodeBase64:encodeBase64,decodeBase64:decodeBase64,strToNumberHash:strToNumberHash,strUnique:strUnique,strToAscii:strToAscii,urlJoin:urlJoin,isObject:isObject,isEqual:isEqual,isEqualStrict:isEqualStrict,isEmpty:isEmpty,isUrl:isUrl,contains:contains,is2dArray:is2dArray,between:between,len:len,isEmail:isEmail,isTrueMinimumNumberOfTimes:isTrueMinimumNumberOfTimes,numberFormat:numberFormat,fileName:fileName,fileSize:fileSize,fileExt:fileExt,duration:duration}=o;
1
+ import{basename as t,extname as e,win32 as r}from"path";import{randomBytes as n,createCipheriv as a,createDecipheriv as s,createHash as i}from"crypto";export default class o{static sleep(t){return new Promise((e=>{setTimeout(e,t)}))}static funcTimes(t,e){const r=[];for(let n=0;n<t;n+=1)r[n]="function"==typeof e?e.call():e;return r}static debounce(t,e){let r;return(...n)=>{clearTimeout(r),r=setTimeout((()=>{t.apply(this,n)}),e)}}static objectId(){return Math.floor(Date.now()/1e3).toString(16)+"x".repeat(16).replace(/x/g,(()=>Math.floor(16*Math.random()).toString(16)))}static numRandom(t,e){if(!t&&!e)return Math.random()>.5?1:0;const r=e||t,n=!e||t>=e?null:t;return Math.floor(Math.random()*(n?r-n+1:r+1))+(n||0)}static sum(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=0;for(let t=0,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r+=e[t]);return r}static mul(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=e[0];for(let t=1,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r*=e[t]);return r}static sub(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=e[0];for(let t=1,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r-=e[t]);return r}static div(...t){const e=t.length>0&&"object"==typeof t[0]?t[0]:t;let r=e[0];for(let t=1,n=e.length;t<n;t+=1)"number"==typeof e[t]&&(r/=e[t]);return r}static dayDiff(t,e){const r=e||new Date;return Math.ceil(Math.abs(r.getTime()-t.getTime())/864e5)}static today(t="-",e=!0){const r=new Date,n=r.getMonth()+1,a=r.getDate(),s=[`${n<10?"0":""}${n}`,`${a<10?"0":""}${a}`];return e?s.unshift(r.getFullYear().toString()):s.push(r.getFullYear().toString()),s.join(t)}static isValidDate(t){if(!/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(t))throw new Error("The date format must be 'YYYY-MM-DD'");const e=t.split("-");return/^(?=\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:16|[2468][048]|[3579][26])00)(?:\x20|$))|(?:2[0-8]|1\d|0?[1-9]))([-./])(?:1[012]|0?[1-9])\1(?:1[6-9]|[2-9]\d)?\d\d(?:(?=\x20\d)\x20|$))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\x20[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/.test(`${parseInt(e[2],10)}-${parseInt(e[1],10)}-${parseInt(e[0],10)}`)}static dateToYYYYMMDD(t,e="-"){const r=t.getMonth()+1,n=t.getDate();return`${t.getFullYear()}${e}${r<10?`0${r}`:r}${e}${n<10?`0${n}`:n}`}static createDateListFromRange(t,e){if(!o.isValidDate(o.dateToYYYYMMDD(t))||!o.isValidDate(o.dateToYYYYMMDD(e)))throw new Error("Either the start date or end date is an invalid date.");if(Math.floor((Date.parse(e.toString())-Date.parse(t.toString()))/864e5)<0)throw new Error("The start date is more recent than the end date.");const r=o.dateToYYYYMMDD(e),n=[];let a=t.getFullYear(),s=t.getMonth()+1,i=t.getDate(),c="";const l=(t,e,r)=>`${t}-${e<10?"0":""}${e}-${r<10?"0":""}${r}`;for(;r!==c;){/[0-9]{4}-12-31/g.test(c)&&(a+=1,s=1,i=1);const t=l(a,s,i);o.isValidDate(t)?(i+=1,n.push(t),c=t):(s+=1,i=1,c=l(a,s,i))}return n}static arrShuffle(t){if(1===t.length)return t[0];const e=t;for(let r=t.length-1;r>0;r-=1){const n=Math.floor(Math.random()*(r+1));[e[r],e[n]]=[t[n],t[r]]}return e}static arrWithDefault(t,e=0){return e<1?[]:Array(e).fill(t)}static arrUnique(t){return o.is2dArray(t)?Array.from(new Set(t.map((t=>JSON.stringify(t)))),(t=>JSON.parse(t))):[...new Set(t)]}static arrWithNumber(t,e){if(t>e)throw new Error("`end` is greater than `start`.");return Array.from({length:e-t+1},((e,r)=>r+t))}static average(t){return t.reduce(((t,e)=>t+e),0)/t.length}static arrMove(t,e,r){const n=t.length;if(n<=e||n<=r)throw new Error("Invalid move params");return t.splice(r,0,t.splice(e,1)[0]),t}static arrTo1dArray(t){const e=t=>{const r=[],n=t.length;for(let a=0;a<n;a+=1)"object"!=typeof t[a]?r.push(t[a]):o.is2dArray(t[a])?r.push(...e(t[a])):r.push(...t[a]);return r};return e(t)}static arrRepeat(t,e){if(!t||e<1||"object"!=typeof t)return[];const r=o.isObject(t),n=[];for(let a=0,s=e;a<s;a+=1)r?n.push(t):n.push(...t);return n}static arrCount(t){const e={};for(let r=0;r<t.length;r+=1){const n=t[r];e[n]=(e[n]||0)+1}return e}static sortByObjectKey(t,e,r=!1,n=!1){if(n){const n=new Intl.Collator([],{numeric:!0}),a=t.sort(((t,r)=>n.compare(t[e],r[e])));return r?a.reverse():a}return t.sort(((t,n)=>r?t[e]>n[e]?-1:t[e]<n[e]?1:0:t[e]<n[e]?-1:t[e]>n[e]?1:0))}static sortNumeric(t,e=!1){const r=new Intl.Collator([],{numeric:!0}),n=t.sort(((t,e)=>r.compare(t,e)));return e?n.reverse():n}static arrGroupByMaxCount(t,e=1){const r=[],n=t.length;let a=[];for(let s=0;s<n;s+=1)a.length===e&&(r.push(a),a=[]),a.push(t[s]);return a.length>0&&r.push(a),r}static objToQueryString(t){return Object.keys(t).map((e=>{let r=t[e];return"object"==typeof r&&(r=JSON.stringify(r)),`${encodeURIComponent(e)}=${encodeURIComponent(r)}`})).join("&")}static objFindItemRecursiveByKey(t,e,r,n){const a=t=>{let s;s="object"==typeof t&&Array.isArray(t)?t:[t];for(let t=0,i=s.length;t<i;t+=1){if(s[t][e]===r)return s[t];if(!o.isEmpty(s[t][n])){const e=a(s[t][n]);if(e)return e}}return null};return a(t)}static objToPrettyStr(t){return JSON.stringify(t,null,"\t")}static objToArray(t,e=!1){const r=t=>{const n=[],a=Object.keys(t).length;for(let s=0;s<a;s+=1){const a=Object.keys(t)[s];e&&o.isObject(t[a])?n.push([a,r(t[a])]):n.push([a,t[a]])}return n};return r(t)}static objectTo1d(t,e="."){if(!e||e.length<1)throw new Error("`separator` must have value at least 1 character.");const r=(t,n="")=>{let a={};const s=Object.keys(t).length,i=n.length<1;for(let c=0;c<s;c+=1){const s=Object.keys(t)[c],l=t[s],u=`${n}${i?"":e}${s}`;o.isObject(l)?(a=Object.assign(a,r(l,u)),delete a[s]):a[u]=l}return a};return r(t)}static objDeleteKeyByValue(t,e,r=!1){if(!t||"object"!=typeof t)return null;const n=Object.assign(t,{});for(let t=Object.keys(n).length;t>=0;t-=1){const a=Object.keys(n)[t];r&&n[a]&&o.isObject(n[a])?o.objDeleteKeyByValue(n[a],e,r):n[a]===e&&delete n[a]}return n}static objUpdate(t,e,r,n=!1,a=!1){if(!t||"object"!=typeof t)return null;const s=Object.assign(t,{});let i=!1;const c=t=>{for(let a=0;a<Object.keys(t).length;a+=1){const s=Object.keys(t)[a];n&&t[s]&&o.isObject(t[s])&&c(t[s]),Object.hasOwn(t,e)&&(t[e]=r,i=!0)}};return c(s),!i&&a&&(s[e]=r),s}static trim(t){return"string"==typeof t||t?t.trim().replace(/\s{2,}/g," "):null}static removeSpecialChar(t,e){return t?t.replace(new RegExp(`[^a-zA-Z가-힣ㄱ-ㅎㅏ-ㅣ0-9぀-ヿ㐀-䶿一-鿿豈-﫿ヲ-゚${e??""}]`,"gi"),""):""}static replaceBetween(t,e,r,n=""){if(!t)return"";const a=/[.*+?^${}()|[\]\\]/g,s=a.test(e)?`\\${e}`:e,i=a.test(r)?`\\${r}`:r;return t.replace(new RegExp(`${s}.*?${i}`,"g"),n)}static removeNewLine(t,e=""){return t?t.replace(/(\r\n|\n|\r)/gm,e).trim():""}static capitalizeFirst(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""}static capitalizeEverySentence(t,e){if(!t)return"";const r=e||".",n=t.split(r);let a,s="";for(let t=0,e=n.length;t<e;t+=1){a=[...n[t]];for(let e=0,r=a.length;e<r;e+=1)if(/[a-zA-Z]/.test(n[t][e])){a[e]=n[t][e].toUpperCase();break}s+=`${a.join("")}${t<e-1?r:""}`}return s}static capitalizeEachWords(t,e){if(!t)return"";const r=t.trim().toLowerCase().split(" ");for(let t=0,n=r.length;t<n;t+=1)e&&o.contains(r[t],["in","on","the","at","and","or","of","for","to","that","a","by","it","is","as","are","were","was","nor","an"],!0)||(r[t]=o.capitalizeFirst(r[t]));return o.capitalizeFirst(r.join(" "))}static strCount(t,e){if(!t||!e)return 0;let r=0,n=t.indexOf(e);for(;n>-1;)r+=1,n=t.indexOf(e,n+=e.length);return r}static strShuffle(t){return t?[...t].sort((()=>Math.random()-.5)).join(""):""}static strRandom(t,e){const r=`abcdefghijklmnopqrstuvwxyz0123456789${e}`,n=r.length;let a,s="";for(let e=0;e<t;e+=1)a=r.charAt(Math.floor(Math.random()*n)),a=Math.random()<.5?a.toUpperCase():a,s+=a;return s}static strBlindRandom(t,e,r="*"){if(!t)return"";let n=t,a=0,s=0,i=0;const c=n.length;for(;a<e&&i<c;)s=o.numRandom(0,c),/[a-zA-Z가-힣]/.test(n.substring(s,s+1))&&(n=`${n.substring(0,s+1)}${r}${n.substring(s+2)}`,a+=1),i+=1;return n}static truncate(t,e,r=""){if(!t)return"";let n=t;return t.length>e&&(n=t.substring(0,e)+r),n}static truncateExpect(t,e,r="."){if(!t)return"";const n=t.slice(-1)===r,a=t.split(r),s=a.length;let i="",o=0;for(let t=0;t<s&&o<e;t+=1)i+=`${a[t]}${t!==s-1||n?r:""}`,o+=a[t].length+r.length;return i}static split(t,...e){if(!t)return[];const r=e.length>0&&"object"==typeof e[0]?e[0]:e,n=r.length;let a="",s="";for(let t=0;t<n;t+=1){const e=r[t];e.length>1?s+=`${s.length<1?"":"|"}${e.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/]/g,"\\]").replace(/\?/g,"\\?").replace(/\./g,"\\.").replace(/\{/g,"\\{").replace(/}/g,"\\}").replace(/\+/g,"\\+")}`:a+="-"===e||"["===e||"]"===e?`\\${e}`:e}return a.length<1&&s.length<1?[t]:(a.length>0&&(a=`[${a}]`,s.length>0&&(s=`|${s}`)),t.split(new RegExp(`${a}${s}+`,"gi")))}static strToAscii(t){const e=[];for(let r=0;r<t.length;r+=1)e.push(t.charCodeAt(r));return e}static strUnique(t){return t?[...new Set(t)].join(""):""}static urlJoin(...t){if(!t)return"";const e=t.length;let r="",n=0;for(let a=0;a<e;a+=1)null!==t[a]&&void 0!==t[a]&&(0===n||t[a].startsWith("/")||t[a].startsWith("?")||t[a].startsWith("&")?r+=t[a]:r+=`/${t[a]}`,n+=1);return r.replace(/\/$/g,"")}static isObject(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}static isEqual(t,...e){const r=e.length>0&&"object"==typeof e[0]?e[0]:e,n=r.length;for(let e=0;e<n;e+=1)if(r[e]!=t)return!1;return!0}static isEqualStrict(t,...e){const r=e.length>0&&"object"==typeof e[0]?e[0]:e,n=r.length;for(let e=0;e<n;e+=1)if(r[e]!==t)return!1;return!0}static isEmpty(t){if(!t)return!0;switch(typeof t){case"string":return t.length<1;case"object":return Array.isArray(t)?t.length<1:Object.keys(t).length<1;default:return!1}}static isUrl(t,e=!1,r=!1){if(r&&-1===t.indexOf("."))return!1;try{new URL(`${e&&-1===t.indexOf("://")?"https://":""}${t}`).toString()}catch(t){return!1}return!0}static contains(t,e,r=!1){if("string"==typeof e)return!(t.length<1)&&-1!==t.indexOf(e);for(let n=0,a=e.length;n<a;n+=1)if(r){if(t===e[n])return!0}else if(-1!==t.indexOf(e[n]))return!0;return!1}static is2dArray(t){return t.filter(Array.isArray).length>0}static between(t,e,r=!1){const n=Math.min.apply(Math,[t[0],t[1]]),a=Math.max.apply(Math,[t[0],t[1]]);return r?e>=n&&e<=a:e>n&&e<a}static len(t){if(!t)return 0;switch(typeof t){case"object":return Array.isArray(t)?t.length:Object.keys(t).length;case"number":case"bigint":return t.toString().length;case"boolean":return t?4:5;case"function":return t().length;default:return t.length}}static isEmail(t){return/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(t)}static isTrueMinimumNumberOfTimes(t,e=1){const r=t.length;let n=0;for(let e=0;e<r;e+=1)"boolean"==typeof t[e]&&t[e]&&(n+=1);return n>=e}static numberFormat(t){return(new Intl.NumberFormat).format(t)}static fileName(n,a=!1){return n?-1===n.indexOf("/")?a?r.basename(n):r.basename(n,e(n)):a?t(n):t(n,e(n)):""}static fileSize(t,e=2){if(!t||0===t||t<0)return"0 Bytes";const r=Math.floor(Math.log(t)/Math.log(1024));return`${parseFloat((t/1024**r).toFixed(e<0?0:e))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`}static fileExt(t){if(-1===t.indexOf("."))return"Unknown";const e=t.trim().toLowerCase().split(".");return e.length>0?e[e.length-1]:"Unknown"}static duration(t,e){const{useShortString:r=!1,useSpace:n=!0,withZeroValue:a=!1,separator:s=" "}={...e},i=[{name:"Millisecond",short:"ms",divider:1e3},{name:"Second",short:"S",divider:60},{name:"Minute",short:"M",divider:60},{name:"Hour",short:"H",divider:24},{name:"Day",short:"D",divider:31}],o=[];let c=t;for(let t=0;t<i.length;t+=1){const e=i[t];let s=c%e.divider;t===i.length-1?s=Math.trunc(c):c=(c-s)/e.divider,(a||!a&&0!==s)&&o.push(`${s}${n?" ":""}${r?e.short:`${e.name}${s<2?"":"s"}`}`)}return o.reverse().join(s)}static safeJSONParse(t,e={}){if(!t)return e;if(Array.isArray(t)||"object"==typeof t)try{return JSON.parse(JSON.stringify(t))}catch(t){return e}try{return JSON.parse(t)}catch(t){return e}}static safeParseInt(t,e=0,r=10){if(!t||t.toString().length<1)return e;try{return parseInt(t.toString().split(".")[0],r)}catch(t){return e}}static encrypt(t,e,r="aes-256-cbc",s=16,i=!1){if(!t||t.length<1)return"";const o=n(s),c=a(r,e,o);let l=c.update(t);l=Buffer.concat([l,c.final()]);const u=i?"base64":"hex";return`${o.toString(u)}:${l.toString(u)}`}static decrypt(t,e,r="aes-256-cbc",n=!1){if(!t||t.length<1)return"";const a=n?"base64":"hex",i=t.split(":"),o=s(r,e,Buffer.from(i.shift(),a));let c=o.update(Buffer.from(i.join(":"),a));return c=Buffer.concat([c,o.final()]),c.toString()}static md5(t){return i("md5").update(t).digest("hex")}static sha1(t){return i("sha1").update(t).digest("hex")}static sha256(t){return i("sha256").update(t).digest("hex")}static encodeBase64(t){return Buffer.from(t,"utf8").toString("base64")}static decodeBase64(t){return Buffer.from(t,"base64").toString("utf8")}static strToNumberHash(t){if(!t)return 0;let e=0;for(let r=0;r<t.length;r+=1)e=(e<<5)-e+t.charCodeAt(r),e|=0;return e}}export{o as Qsu};export const{sleep:sleep,funcTimes:funcTimes,debounce:debounce,objectId:objectId,numRandom:numRandom,sum:sum,mul:mul,sub:sub,div:div,dayDiff:dayDiff,today:today,isValidDate:isValidDate,dateToYYYYMMDD:dateToYYYYMMDD,createDateListFromRange:createDateListFromRange,arrShuffle:arrShuffle,arrWithDefault:arrWithDefault,arrUnique:arrUnique,arrWithNumber:arrWithNumber,arrRepeat:arrRepeat,arrCount:arrCount,average:average,arrMove:arrMove,arrTo1dArray:arrTo1dArray,sortByObjectKey:sortByObjectKey,sortNumeric:sortNumeric,arrGroupByMaxCount:arrGroupByMaxCount,objToQueryString:objToQueryString,objToPrettyStr:objToPrettyStr,objFindItemRecursiveByKey:objFindItemRecursiveByKey,objToArray:objToArray,objectTo1d:objectTo1d,objDeleteKeyByValue:objDeleteKeyByValue,objUpdate:objUpdate,trim:trim,replaceBetween:replaceBetween,removeSpecialChar:removeSpecialChar,removeNewLine:removeNewLine,capitalizeFirst:capitalizeFirst,capitalizeEverySentence:capitalizeEverySentence,capitalizeEachWords:capitalizeEachWords,strCount:strCount,strShuffle:strShuffle,strRandom:strRandom,strBlindRandom:strBlindRandom,truncate:truncate,truncateExpect:truncateExpect,split:split,encrypt:encrypt,decrypt:decrypt,md5:md5,sha1:sha1,sha256:sha256,encodeBase64:encodeBase64,decodeBase64:decodeBase64,strToNumberHash:strToNumberHash,strUnique:strUnique,strToAscii:strToAscii,urlJoin:urlJoin,isObject:isObject,isEqual:isEqual,isEqualStrict:isEqualStrict,isEmpty:isEmpty,isUrl:isUrl,contains:contains,is2dArray:is2dArray,between:between,len:len,isEmail:isEmail,isTrueMinimumNumberOfTimes:isTrueMinimumNumberOfTimes,numberFormat:numberFormat,fileName:fileName,fileSize:fileSize,fileExt:fileExt,safeJSONParse:safeJSONParse,safeParseInt:safeParseInt,duration:duration}=o;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qsu",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "QSU is a lightweight and simple module with a variety of built-in utility functions that you can utilize in your NodeJS projects.",
5
5
  "author": "Jooy2 <jooy2.contact@gmail.com>",
6
6
  "license": "MIT",
@@ -57,17 +57,17 @@
57
57
  ],
58
58
  "devDependencies": {
59
59
  "@types/mocha": "^10.0.6",
60
- "@types/node": "^20.12.7",
61
- "@typescript-eslint/eslint-plugin": "^7.6.0",
62
- "@typescript-eslint/parser": "^7.6.0",
63
- "dayjs": "^1.11.10",
60
+ "@types/node": "^20.12.8",
61
+ "@typescript-eslint/eslint-plugin": "^7.8.0",
62
+ "@typescript-eslint/parser": "^7.8.0",
63
+ "dayjs": "^1.11.11",
64
64
  "eslint": "^8.57.0",
65
65
  "eslint-config-airbnb": "^19.0.4",
66
66
  "eslint-config-prettier": "^9.1.0",
67
67
  "eslint-plugin-import": "^2.29.1",
68
68
  "mocha": "^10.4.0",
69
69
  "prettier": "^3.2.5",
70
- "terser": "^5.30.3",
70
+ "terser": "^5.31.0",
71
71
  "ts-node": "^10.9.2",
72
72
  "typescript": "^5.4.5"
73
73
  }