qsu 1.11.0 → 1.11.2
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/format/numberFormat.js +1 -1
- package/dist/math/index.d.ts +2 -1
- package/dist/math/index.js +1 -1
- package/dist/math/numPick.d.ts +1 -0
- package/dist/math/numPick.js +1 -0
- package/dist/math/numUnique.d.ts +1 -0
- package/dist/math/numUnique.js +1 -0
- package/dist/node/file/getFileName.js +1 -1
- package/dist/node/os/getCpu.d.ts +1 -0
- package/dist/node/os/getCpu.js +1 -0
- package/dist/node/os/index.d.ts +1 -0
- package/dist/node/os/index.js +1 -1
- package/dist/string/getGroupKeys.d.ts +1 -0
- package/dist/string/getGroupKeys.js +1 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.js +1 -1
- package/dist/string/strBlindRandom.js +1 -1
- package/dist/verify/isEmail.js +1 -1
- package/dist/verify/isUnique.d.ts +1 -0
- package/dist/verify/isUnique.js +0 -0
- package/package.json +13 -14
- package/dist/math/numRandom.d.ts +0 -1
- package/dist/math/numRandom.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export function numberFormat(t){const r="string"==typeof t?t.
|
|
1
|
+
export function numberFormat(t){if(!t)return"";const r="string"==typeof t?t:t.toString(),n=r.startsWith("-"),e=(n?r.slice(1):r).split("."),i=`${new Intl.NumberFormat("en-US",{roundingPriority:"morePrecision"}).format(parseInt(e[0],10))}${e.length>1?`.${e[1]}`:""}`;return n?`-${i}`:i}
|
package/dist/math/index.d.ts
CHANGED
package/dist/math/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{div}from"./div.js";export{mul}from"./mul.js";export{
|
|
1
|
+
export{div}from"./div.js";export{mul}from"./mul.js";export{numPick}from"./numPick.js";export{numUnique}from"./numUnique.js";export{sub}from"./sub.js";export{sum}from"./sum.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function numPick(min: number, max: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function numPick(n,r){if(!n&&!r)return Math.random()>.5?1:0;const t=r||n,o=!r||n>=r?null:n;return Math.floor(Math.random()*(o?t-o+1:t+1))+(o||0)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function numUnique(): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function numUnique(){const e=[...Array(89999).keys()].map((e=>e+1e4));return parseInt((new Date).valueOf()+""+e[Math.floor(Math.random()*e.length)],10)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{posix as e,win32 as n}from"path";export function getFileName(
|
|
1
|
+
import{posix as e,win32 as n}from"path";export function getFileName(t,i=!1){const a=!i&&!t.endsWith("/")&&!t.endsWith("\\");return-1===t.indexOf("/")&&-1!==t.indexOf("\\")?n.basename(t,a?n.extname(t):void 0)||"":e.basename(t,a?e.extname(t):void 0)||""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCpu(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cpus as o}from"os";export function getCpu(){return`${o()?.[0]?.model||"Unknown"}`}
|
package/dist/node/os/index.d.ts
CHANGED
package/dist/node/os/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getHostname}from"./getHostname.js";export{getMachineId}from"./getMachineId.js";export{getRamSize}from"./getRamSize.js";export{getSid}from"./getSid.js";export{runCommand}from"./runCommand.js";
|
|
1
|
+
export{getCpu}from"./getCpu.js";export{getHostname}from"./getHostname.js";export{getMachineId}from"./getMachineId.js";export{getRamSize}from"./getRamSize.js";export{getSid}from"./getSid.js";export{runCommand}from"./runCommand.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getGroupKeys(str: string, groupStart: string, groupEnd: string, ignoreValidation?: boolean): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getGroupKeys(r,e,t,n=!1){if(!r)return[];if(!e||!t)throw new Error("`groupStart` and `groupEnd` must be non-empty.");if(e===t)throw new Error("`groupStart` and `groupEnd` must be different.");if(1===e.length&&1!==t.length)throw new Error("When `groupStart` is a single character, `groupEnd` must also be a single character.");if(1===t.length&&1!==e.length)throw new Error("When `groupEnd` is a single character, `groupStart` must also be a single character.");const i=[],u=r.length,o=e.length,f=t.length,l=e=>{let t=0;for(let n=e-1;n>=0&&"\\"===r[n];n--)t++;return t%2==1},s=1===o&&1===f,a=s?e:"",c=s?t:"",g=t=>{if(t<0||t+o>u)return!1;if(r.slice(t,t+o)!==e)return!1;if(l(t))return!1;if(s){if(t>0&&r[t-1]===a)return!1;if(t+1<u&&r[t+1]===a)return!1}return!0},h=e=>{if(e<0||e+f>u)return!1;if(r.slice(e,e+f)!==t)return!1;if(l(e))return!1;if(s){if(e>0&&r[e-1]===c)return!1;if(e+1<u&&r[e+1]===c)return!1}return!0},p=r=>!r.includes("\n")&&!r.includes("\r")&&(!r.includes(e)&&!r.includes(t)&&(!!n||/^[A-Za-z0-9_$-]*$/.test(r)));for(let e=0;e<=u-o;e++){if(!g(e))continue;const t=e+o;let n=-1;for(let r=t;r<=u-f;r++)if(h(r)){n=r;break}if(-1===n)continue;const l=r.slice(t,n);p(l)&&i.push(l),e=n+f-1}return i}
|
package/dist/string/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { capitalizeEachWords } from './capitalizeEachWords.js';
|
|
2
2
|
export { capitalizeEverySentence } from './capitalizeEverySentence.js';
|
|
3
3
|
export { capitalizeFirst } from './capitalizeFirst.js';
|
|
4
|
+
export { getGroupKeys } from './getGroupKeys.js';
|
|
4
5
|
export { getStrBytes } from './getStrBytes.js';
|
|
5
6
|
export { removeNewLine } from './removeNewLine.js';
|
|
6
7
|
export { removeSpecialChar } from './removeSpecialChar.js';
|
package/dist/string/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{capitalizeEachWords}from"./capitalizeEachWords.js";export{capitalizeEverySentence}from"./capitalizeEverySentence.js";export{capitalizeFirst}from"./capitalizeFirst.js";export{getStrBytes}from"./getStrBytes.js";export{removeNewLine}from"./removeNewLine.js";export{removeSpecialChar}from"./removeSpecialChar.js";export{replaceBetween}from"./replaceBetween.js";export{split}from"./split.js";export{strBlindRandom}from"./strBlindRandom.js";export{strCount}from"./strCount.js";export{strRandom}from"./strRandom.js";export{strShuffle}from"./strShuffle.js";export{strToAscii}from"./strToAscii.js";export{strUnique}from"./strUnique.js";export{trim}from"./trim.js";export{truncate}from"./truncate.js";export{truncateExpect}from"./truncateExpect.js";export{urlJoin}from"./urlJoin.js";
|
|
1
|
+
export{capitalizeEachWords}from"./capitalizeEachWords.js";export{capitalizeEverySentence}from"./capitalizeEverySentence.js";export{capitalizeFirst}from"./capitalizeFirst.js";export{getGroupKeys}from"./getGroupKeys.js";export{getStrBytes}from"./getStrBytes.js";export{removeNewLine}from"./removeNewLine.js";export{removeSpecialChar}from"./removeSpecialChar.js";export{replaceBetween}from"./replaceBetween.js";export{split}from"./split.js";export{strBlindRandom}from"./strBlindRandom.js";export{strCount}from"./strCount.js";export{strRandom}from"./strRandom.js";export{strShuffle}from"./strShuffle.js";export{strToAscii}from"./strToAscii.js";export{strUnique}from"./strUnique.js";export{trim}from"./trim.js";export{truncate}from"./truncate.js";export{truncateExpect}from"./truncateExpect.js";export{urlJoin}from"./urlJoin.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{numPick as t}from"../math/numPick.js";export function strBlindRandom(n,r,s="*"){if(!n)return"";let i=n,o=0,u=0,e=0;const m=i.length;for(;o<r&&e<m;)u=t(0,m),/[a-zA-Z가-힣]/.test(i.substring(u,u+1))&&(i=`${i.substring(0,u+1)}${s}${i.substring(u+2)}`,o+=1),e+=1;return i}
|
package/dist/verify/isEmail.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function isEmail($,t=!1){const e=
|
|
1
|
+
export function isEmail($,t=!1){const e="a-z"+(t?"":"A-Z");return new RegExp(`^[${e}0-9!#$%&'*+/=?^_\`{|}~-]+(?:\\.[${e}0-9!#$%&'*+/=?^_\`{|}~-]+)*@(?:[${e}0-9](?:[${e}0-9-]*[${e}0-9])?\\.)+[${e}0-9](?:[${e}0-9-]*[${e}0-9])?$`,"g").test($)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qsu",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"description": "qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.",
|
|
5
5
|
"author": "CDGet <jooy2.contact@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"toolkit",
|
|
60
60
|
"underscore",
|
|
61
61
|
"web",
|
|
62
|
-
"website",
|
|
63
62
|
"helper",
|
|
64
63
|
"array",
|
|
65
64
|
"string",
|
|
@@ -73,20 +72,20 @@
|
|
|
73
72
|
"file"
|
|
74
73
|
],
|
|
75
74
|
"devDependencies": {
|
|
76
|
-
"@eslint/js": "^9.39.
|
|
77
|
-
"@types/node": "^
|
|
78
|
-
"@typescript-eslint/parser": "^8.
|
|
79
|
-
"dayjs": "^1.11.
|
|
80
|
-
"eslint": "^9.39.
|
|
75
|
+
"@eslint/js": "^9.39.2",
|
|
76
|
+
"@types/node": "^25.5.0",
|
|
77
|
+
"@typescript-eslint/parser": "^8.57.2",
|
|
78
|
+
"dayjs": "^1.11.20",
|
|
79
|
+
"eslint": "^9.39.2",
|
|
81
80
|
"eslint-config-prettier": "^10.1.8",
|
|
82
|
-
"eslint-plugin-n": "^17.
|
|
83
|
-
"glob-bin": "^1.
|
|
84
|
-
"globals": "^
|
|
81
|
+
"eslint-plugin-n": "^17.24.0",
|
|
82
|
+
"glob-bin": "^1.1.0",
|
|
83
|
+
"globals": "^17.4.0",
|
|
85
84
|
"jiti": "^2.6.1",
|
|
86
|
-
"prettier": "^3.
|
|
85
|
+
"prettier": "^3.8.1",
|
|
87
86
|
"terser-glob": "^1.1.0",
|
|
88
|
-
"tsx": "^4.
|
|
89
|
-
"typescript": "
|
|
90
|
-
"typescript-eslint": "^8.
|
|
87
|
+
"tsx": "^4.21.0",
|
|
88
|
+
"typescript": "5.9.3",
|
|
89
|
+
"typescript-eslint": "^8.57.2"
|
|
91
90
|
}
|
|
92
91
|
}
|
package/dist/math/numRandom.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function numRandom(min: number, max: number): number;
|
package/dist/math/numRandom.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function numRandom(n,o){if(!n&&!o)return Math.random()>.5?1:0;const r=o||n,t=!o||n>=o?null:n;return Math.floor(Math.random()*(t?r-t+1:r+1))+(t||0)}
|