qsu 1.11.0 → 1.11.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.
|
@@ -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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qsu",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.1",
|
|
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",
|
|
@@ -73,20 +73,20 @@
|
|
|
73
73
|
"file"
|
|
74
74
|
],
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@eslint/js": "^9.39.
|
|
77
|
-
"@types/node": "^
|
|
78
|
-
"@typescript-eslint/parser": "^8.
|
|
76
|
+
"@eslint/js": "^9.39.2",
|
|
77
|
+
"@types/node": "^25.0.9",
|
|
78
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
79
79
|
"dayjs": "^1.11.19",
|
|
80
|
-
"eslint": "^9.39.
|
|
80
|
+
"eslint": "^9.39.2",
|
|
81
81
|
"eslint-config-prettier": "^10.1.8",
|
|
82
|
-
"eslint-plugin-n": "^17.23.
|
|
82
|
+
"eslint-plugin-n": "^17.23.2",
|
|
83
83
|
"glob-bin": "^1.0.0",
|
|
84
|
-
"globals": "^
|
|
84
|
+
"globals": "^17.0.0",
|
|
85
85
|
"jiti": "^2.6.1",
|
|
86
|
-
"prettier": "^3.
|
|
86
|
+
"prettier": "^3.8.0",
|
|
87
87
|
"terser-glob": "^1.1.0",
|
|
88
|
-
"tsx": "^4.
|
|
88
|
+
"tsx": "^4.21.0",
|
|
89
89
|
"typescript": "^5.9.3",
|
|
90
|
-
"typescript-eslint": "^8.
|
|
90
|
+
"typescript-eslint": "^8.53.0"
|
|
91
91
|
}
|
|
92
92
|
}
|