qsu 1.15.0 → 1.17.0
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/_types/global.d.ts +13 -0
- package/dist/array/_comparableKey.d.ts +9 -0
- package/dist/array/_comparableKey.js +1 -0
- package/dist/array/arrCompact.d.ts +1 -0
- package/dist/array/arrCompact.js +1 -0
- package/dist/array/arrDifference.d.ts +1 -0
- package/dist/array/arrDifference.js +1 -0
- package/dist/array/arrIntersection.d.ts +1 -0
- package/dist/array/arrIntersection.js +1 -0
- package/dist/array/index.d.ts +3 -0
- package/dist/array/index.js +1 -1
- package/dist/math/_decimalShift.d.ts +10 -0
- package/dist/math/_decimalShift.js +1 -0
- package/dist/math/ceil.d.ts +1 -0
- package/dist/math/ceil.js +1 -0
- package/dist/math/clamp.d.ts +1 -0
- package/dist/math/clamp.js +1 -0
- package/dist/math/floor.d.ts +1 -0
- package/dist/math/floor.js +1 -0
- package/dist/math/index.d.ts +6 -0
- package/dist/math/index.js +1 -1
- package/dist/math/max.d.ts +2 -0
- package/dist/math/max.js +1 -0
- package/dist/math/min.d.ts +2 -0
- package/dist/math/min.js +1 -0
- package/dist/math/round.d.ts +1 -0
- package/dist/math/round.js +1 -0
- package/dist/misc/index.d.ts +2 -0
- package/dist/misc/index.js +1 -1
- package/dist/misc/retry.d.ts +2 -0
- package/dist/misc/retry.js +1 -0
- package/dist/misc/throttle.d.ts +2 -0
- package/dist/misc/throttle.js +1 -0
- package/dist/object/index.d.ts +7 -0
- package/dist/object/index.js +1 -1
- package/dist/object/objClone.d.ts +3 -0
- package/dist/object/objClone.js +1 -0
- package/dist/object/objGet.d.ts +4 -0
- package/dist/object/objGet.js +1 -0
- package/dist/object/objInvert.d.ts +4 -0
- package/dist/object/objInvert.js +1 -0
- package/dist/object/objMapKeys.d.ts +2 -0
- package/dist/object/objMapKeys.js +1 -0
- package/dist/object/objMerge.d.ts +2 -0
- package/dist/object/objMerge.js +1 -0
- package/dist/object/objPick.d.ts +2 -0
- package/dist/object/objPick.js +1 -0
- package/dist/object/objPickBy.d.ts +2 -0
- package/dist/object/objPickBy.js +1 -0
- package/dist/string/_capitalizeWord.d.ts +10 -0
- package/dist/string/_capitalizeWord.js +1 -0
- package/dist/string/deburr.d.ts +1 -0
- package/dist/string/deburr.js +1 -0
- package/dist/string/escapeRegExp.d.ts +1 -0
- package/dist/string/escapeRegExp.js +1 -0
- package/dist/string/index.d.ts +10 -0
- package/dist/string/index.js +1 -1
- package/dist/string/pad.d.ts +2 -0
- package/dist/string/pad.js +1 -0
- package/dist/string/strToCamelCase.d.ts +1 -0
- package/dist/string/strToCamelCase.js +1 -0
- package/dist/string/strToConstantCase.d.ts +1 -0
- package/dist/string/strToConstantCase.js +1 -0
- package/dist/string/strToKebabCase.d.ts +1 -0
- package/dist/string/strToKebabCase.js +1 -0
- package/dist/string/strToPascalCase.d.ts +1 -0
- package/dist/string/strToPascalCase.js +1 -0
- package/dist/string/strToSnakeCase.d.ts +1 -0
- package/dist/string/strToSnakeCase.js +1 -0
- package/dist/string/uncapitalizeFirst.d.ts +1 -0
- package/dist/string/uncapitalizeFirst.js +1 -0
- package/dist/string/words.d.ts +1 -0
- package/dist/string/words.js +1 -0
- package/dist/web/escapeHtml.d.ts +1 -0
- package/dist/web/escapeHtml.js +1 -0
- package/dist/web/index.d.ts +2 -0
- package/dist/web/index.js +1 -1
- package/dist/web/unescapeHtml.d.ts +1 -0
- package/dist/web/unescapeHtml.js +1 -0
- package/package.json +5 -5
package/dist/_types/global.d.ts
CHANGED
|
@@ -15,6 +15,19 @@ export type DurationOptions = {
|
|
|
15
15
|
maxUnitCount?: number;
|
|
16
16
|
unit?: DurationUnitName;
|
|
17
17
|
};
|
|
18
|
+
export type RetryOptions = {
|
|
19
|
+
times?: number;
|
|
20
|
+
delay?: number;
|
|
21
|
+
backoff?: number;
|
|
22
|
+
};
|
|
23
|
+
export type PadOptions = {
|
|
24
|
+
position?: 'start' | 'end' | 'both';
|
|
25
|
+
char?: string;
|
|
26
|
+
};
|
|
27
|
+
export type ThrottleOptions = {
|
|
28
|
+
leading?: boolean;
|
|
29
|
+
trailing?: boolean;
|
|
30
|
+
};
|
|
18
31
|
export interface FileInfo {
|
|
19
32
|
success: boolean;
|
|
20
33
|
isDirectory: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (Private, not exported from the package) A stable string key for a value, so that array
|
|
3
|
+
* membership can be decided by value instead of by reference.
|
|
4
|
+
*
|
|
5
|
+
* Python cannot hash a list or a dict at all, so a reference comparison could not have been
|
|
6
|
+
* ported to all three languages. Comparing by value also means `arrDifference([[1]], [[1]])`
|
|
7
|
+
* answers the same way everywhere.
|
|
8
|
+
*/
|
|
9
|
+
export declare function comparableKey(value: any): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function comparableKey(n){if(null===n)return"null";if(void 0===n)return"undefined";const r=typeof n;if("number"===r)return Number.isNaN(n)?"number:NaN":`number:${0===n?0:n}`;if("string"===r||"boolean"===r||"bigint"===r)return`${r}:${n}`;if("function"===r||"symbol"===r)return`${r}:${String(n)}`;try{return`json:${JSON.stringify(n)}`}catch{return`json:${String(n)}`}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function arrCompact(array: any[]): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function arrCompact(r){if(!Array.isArray(r))return[];const t=[];for(let n=0,e=r.length;n<e;n+=1){const e=r[n];null==e||!1===e||0===e||""===e||"number"==typeof e&&Number.isNaN(e)||t.push(e)}return t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function arrDifference(array: any[], ...others: any[][]): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{comparableKey as r}from"./_comparableKey.js";export function arrDifference(e,...t){if(!Array.isArray(e))return[];const n=new Set;for(let e=0,a=t.length;e<a;e+=1){const a=t[e];if(Array.isArray(a))for(let e=0,t=a.length;e<t;e+=1)n.add(r(a[e]))}return e.filter(e=>!n.has(r(e)))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function arrIntersection(...arrays: any[][]): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{comparableKey as r}from"./_comparableKey.js";export function arrIntersection(...e){if(e.length<1||!Array.isArray(e[0]))return[];const[t,...n]=e,a=[];for(let e=0,t=n.length;e<t;e+=1){if(!Array.isArray(n[e]))return[];a.push(new Set(n[e].map(r)))}const o=new Set,s=[];for(let e=0,n=t.length;e<n;e+=1){const n=t[e],h=r(n);o.has(h)||(o.add(h),a.every(r=>r.has(h))&&s.push(n))}return s}
|
package/dist/array/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
export { arrCompact } from './arrCompact.js';
|
|
1
2
|
export { arrCount } from './arrCount.js';
|
|
3
|
+
export { arrDifference } from './arrDifference.js';
|
|
2
4
|
export { arrGroupByMaxCount } from './arrGroupByMaxCount.js';
|
|
5
|
+
export { arrIntersection } from './arrIntersection.js';
|
|
3
6
|
export { arrMove } from './arrMove.js';
|
|
4
7
|
export { arrPick } from './arrPick.js';
|
|
5
8
|
export { arrRepeat } from './arrRepeat.js';
|
package/dist/array/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{arrCount}from"./arrCount.js";export{arrGroupByMaxCount}from"./arrGroupByMaxCount.js";export{arrMove}from"./arrMove.js";export{arrPick}from"./arrPick.js";export{arrRepeat}from"./arrRepeat.js";export{arrShuffle}from"./arrShuffle.js";export{arrTo1dArray}from"./arrTo1dArray.js";export{arrUnique}from"./arrUnique.js";export{arrWithDefault}from"./arrWithDefault.js";export{arrWithNumber}from"./arrWithNumber.js";export{average}from"./average.js";export{sortByObjectKey}from"./sortByObjectKey.js";export{sortNumeric}from"./sortNumeric.js";
|
|
1
|
+
export{arrCompact}from"./arrCompact.js";export{arrCount}from"./arrCount.js";export{arrDifference}from"./arrDifference.js";export{arrGroupByMaxCount}from"./arrGroupByMaxCount.js";export{arrIntersection}from"./arrIntersection.js";export{arrMove}from"./arrMove.js";export{arrPick}from"./arrPick.js";export{arrRepeat}from"./arrRepeat.js";export{arrShuffle}from"./arrShuffle.js";export{arrTo1dArray}from"./arrTo1dArray.js";export{arrUnique}from"./arrUnique.js";export{arrWithDefault}from"./arrWithDefault.js";export{arrWithNumber}from"./arrWithNumber.js";export{average}from"./average.js";export{sortByObjectKey}from"./sortByObjectKey.js";export{sortNumeric}from"./sortNumeric.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (Private, not exported from the package) Multiplies a number by a power of ten by moving
|
|
3
|
+
* the exponent of its shortest string representation, instead of multiplying by `10 ** n`.
|
|
4
|
+
*
|
|
5
|
+
* `1.005 * 100` is `100.49999999999999`, so the naive form answers `1` for `round(1.005, 2)`
|
|
6
|
+
* and `1.1 * 10` is `11.000000000000002`, so `ceil(1.1, 1)` answers `1.2`. Parsing
|
|
7
|
+
* `'1.005e2'` yields exactly `100.5` instead, because the shortest representation is the
|
|
8
|
+
* decimal the caller wrote and the parser rounds it to the nearest double exactly once.
|
|
9
|
+
*/
|
|
10
|
+
export declare function decimalShift(value: number, exponent: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function decimalShift(e,t){const[r,i]=String(e).split("e");return Number(`${r}e${(i?Number(i):0)+t}`)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ceil(value: number, precision?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{decimalShift as i}from"./_decimalShift.js";export function ceil(e,t=0){return Number.isFinite(e)?i(Math.ceil(i(e,t)),-t):e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function clamp(t,a,n){return Math.max(Math.min(t,n),a)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function floor(value: number, precision?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{decimalShift as o}from"./_decimalShift.js";export function floor(r,i=0){return Number.isFinite(r)?o(Math.floor(o(r,i)),-i):r}
|
package/dist/math/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
export { ceil } from './ceil.js';
|
|
2
|
+
export { clamp } from './clamp.js';
|
|
1
3
|
export { div } from './div.js';
|
|
4
|
+
export { floor } from './floor.js';
|
|
5
|
+
export { max } from './max.js';
|
|
6
|
+
export { min } from './min.js';
|
|
2
7
|
export { mul } from './mul.js';
|
|
3
8
|
export { numPick } from './numPick.js';
|
|
4
9
|
export { numUnique } from './numUnique.js';
|
|
10
|
+
export { round } from './round.js';
|
|
5
11
|
export { sub } from './sub.js';
|
|
6
12
|
export { sum } from './sum.js';
|
package/dist/math/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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";
|
|
1
|
+
export{ceil}from"./ceil.js";export{clamp}from"./clamp.js";export{div}from"./div.js";export{floor}from"./floor.js";export{max}from"./max.js";export{min}from"./min.js";export{mul}from"./mul.js";export{numPick}from"./numPick.js";export{numUnique}from"./numUnique.js";export{round}from"./round.js";export{sub}from"./sub.js";export{sum}from"./sum.js";
|
package/dist/math/max.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function max(...n){const r=n.length>0&&Array.isArray(n[0])?n[0]:n;let t=null;for(let n=0,e=r.length;n<e;n+=1){const e=r[n];"number"==typeof e&&!Number.isNaN(e)&&(null===t||e>t)&&(t=e)}return t}
|
package/dist/math/min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function min(...n){const r=n.length>0&&Array.isArray(n[0])?n[0]:n;let t=null;for(let n=0,e=r.length;n<e;n+=1){const e=r[n];"number"==typeof e&&!Number.isNaN(e)&&(null===t||e<t)&&(t=e)}return t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function round(value: number, precision?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{decimalShift as r}from"./_decimalShift.js";export function round(t,n=0){if(!Number.isFinite(t))return t;const i=r(t,n),o=i<0?-Math.round(-i):Math.round(i);return r(o,-n)}
|
package/dist/misc/index.d.ts
CHANGED
package/dist/misc/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{debounce}from"./debounce.js";export{funcTimes}from"./funcTimes.js";export{sleep}from"./sleep.js";
|
|
1
|
+
export{debounce}from"./debounce.js";export{funcTimes}from"./funcTimes.js";export{retry}from"./retry.js";export{sleep}from"./sleep.js";export{throttle}from"./throttle.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{sleep as t}from"./sleep.js";export async function retry(r,e){const a=e?.times??3,o=e?.delay??0,s=e?.backoff??1;if(a<1)throw new Error("`times` must be at least 1.");let i,c=o;for(let e=1;e<=a;e+=1)try{return await r()}catch(r){i=r,e<a&&(c>0&&await t(c),c*=s)}throw i}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function throttle(n,l,t){const o=t?.leading??!0,e=t?.trailing??!0;let u,i=null,r=null;const c=()=>{i=o?Date.now():null,u=void 0;const l=r;r=null,l&&n(...l)};return(...t)=>{const s=Date.now();null!==i||o||(i=s);const a=null===i?0:l-(s-i);if(r=t,a<=0||a>l)return u&&(clearTimeout(u),u=void 0),i=s,r=null,void n(...t);!u&&e&&(u=setTimeout(c,a),u?.unref?.())}}
|
package/dist/object/index.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
export { objClone } from './objClone.js';
|
|
1
2
|
export { objDeleteKeyByValue } from './objDeleteKeyByValue.js';
|
|
2
3
|
export { objFindItemRecursiveByKey } from './objFindItemRecursiveByKey.js';
|
|
4
|
+
export { objGet } from './objGet.js';
|
|
5
|
+
export { objInvert } from './objInvert.js';
|
|
6
|
+
export { objMapKeys } from './objMapKeys.js';
|
|
7
|
+
export { objMerge } from './objMerge.js';
|
|
3
8
|
export { objMergeNewKey } from './objMergeNewKey.js';
|
|
9
|
+
export { objPick } from './objPick.js';
|
|
10
|
+
export { objPickBy } from './objPickBy.js';
|
|
4
11
|
export { objTo1d } from './objTo1d.js';
|
|
5
12
|
export { objToArray } from './objToArray.js';
|
|
6
13
|
export { objToPrettyStr } from './objToPrettyStr.js';
|
package/dist/object/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{objDeleteKeyByValue}from"./objDeleteKeyByValue.js";export{objFindItemRecursiveByKey}from"./objFindItemRecursiveByKey.js";export{objMergeNewKey}from"./objMergeNewKey.js";export{objTo1d}from"./objTo1d.js";export{objToArray}from"./objToArray.js";export{objToPrettyStr}from"./objToPrettyStr.js";export{objToQueryString}from"./objToQueryString.js";export{objUpdate}from"./objUpdate.js";
|
|
1
|
+
export{objClone}from"./objClone.js";export{objDeleteKeyByValue}from"./objDeleteKeyByValue.js";export{objFindItemRecursiveByKey}from"./objFindItemRecursiveByKey.js";export{objGet}from"./objGet.js";export{objInvert}from"./objInvert.js";export{objMapKeys}from"./objMapKeys.js";export{objMerge}from"./objMerge.js";export{objMergeNewKey}from"./objMergeNewKey.js";export{objPick}from"./objPick.js";export{objPickBy}from"./objPickBy.js";export{objTo1d}from"./objTo1d.js";export{objToArray}from"./objToArray.js";export{objToPrettyStr}from"./objToPrettyStr.js";export{objToQueryString}from"./objToQueryString.js";export{objUpdate}from"./objUpdate.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isObject as e}from"../verify/isObject.js";function t(n,r){if(null===n||"object"!=typeof n)return n;if(r.has(n))return r.get(n);if(n instanceof Date)return new Date(n.getTime());if(n instanceof RegExp)return new RegExp(n.source,n.flags);if(Array.isArray(n)){const e=[];r.set(n,e);for(let a=0,o=n.length;a<o;a+=1)e[a]=t(n[a],r);return e}if(n instanceof Map){const e=new Map;return r.set(n,e),n.forEach((n,a)=>{e.set(t(a,r),t(n,r))}),e}if(n instanceof Set){const e=new Set;return r.set(n,e),n.forEach(n=>{e.add(t(n,r))}),e}if(e(n)){const e={};return r.set(n,e),Object.keys(n).forEach(a=>{e[a]=t(n[a],r)}),e}return n}export function objClone(n,r){return null===n||"object"!=typeof n?n:!1===r?.deep?Array.isArray(n)?[...n]:n instanceof Date?new Date(n.getTime()):n instanceof RegExp?new RegExp(n.source,n.flags):n instanceof Map?new Map(n):n instanceof Set?new Set(n):e(n)?{...n}:n:t(n,new WeakMap)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function objGet(t,n,e){const o=e?.fallback??null;if(!t||"object"!=typeof t||"string"!=typeof n)return o;const c=function(t){const n=[],e=t.length;let o="",c=0;for(;c<e;){const e=t[c];if("["===e){const l=t.indexOf("]",c);if(-1===l){o+=e,c+=1;continue}""!==o&&(n.push(o),o="");let s=t.slice(c+1,l);const u=s[0];s.length>=2&&("'"===u||'"'===u)&&s.endsWith(u)&&(s=s.slice(1,-1)),n.push(s),c=l+1,"."===t[c]&&(c+=1);continue}"."!==e?(o+=e,c+=1):(n.push(o),o="",c+=1)}return""===o&&0!==n.length||n.push(o),n}(n);let l=t;for(let t=0,n=c.length;t<n;t+=1){if(null===l||"object"!=typeof l||!Object.hasOwn(l,c[t]))return o;l=l[c[t]]}return l}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function objInvert(t){if(!t||"object"!=typeof t)return null;const e={},n=Object.keys(t);for(let o=0,r=n.length;o<r;o+=1){const r=n[o];e[String(t[r])]=r}return e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function objMapKeys(t,e){if(!t||"object"!=typeof t)return null;const n={},o=Object.keys(t);for(let r=0,c=o.length;r<c;r+=1){const c=o[r];n[e(t[c],c)]=t[c]}return n}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isObject as e}from"../verify/isObject.js";export function objMerge(...t){if(0===t.length)return null;const n={};for(let r=0,o=t.length;r<o;r+=1){const o=t[r];if(!e(o))return null;const l=Object.keys(o);for(let t=0,r=l.length;t<r;t+=1){const r=l[t],c=o[r];n[r]=e(n[r])&&e(c)?objMerge(n[r],c):c}}return n}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function objPick(t,r){if(!t||"object"!=typeof t)return null;const n=Array.isArray(r)?r:[r],e={};for(let r=0,o=n.length;r<o;r+=1){const o=n[r];Object.hasOwn(t,o)&&(e[o]=t[o])}return e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function objPickBy(t,e){if(!t||"object"!=typeof t)return null;const n={},o=Object.keys(t);for(let c=0,r=o.length;c<r;c+=1){const r=o[c];e(t[r],r)&&(n[r]=t[r])}return n}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (Private, not exported from the package) Uppercases the first character of a word and
|
|
3
|
+
* lowercases the rest, so `XML` becomes `Xml`.
|
|
4
|
+
*
|
|
5
|
+
* The word is split by code point rather than indexed, because indexing a JavaScript string
|
|
6
|
+
* walks UTF-16 units and would cut a surrogate pair in half, disagreeing with the Dart and
|
|
7
|
+
* Python implementations. This is what the case-conversion family needs, and it is not the
|
|
8
|
+
* same as the public `capitalizeFirst`, which leaves the rest of the string alone.
|
|
9
|
+
*/
|
|
10
|
+
export declare function capitalizeWord(word: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function capitalizeWord(r){if(!r)return"";const e=Array.from(r);return e[0].toUpperCase()+e.slice(1).join("").toLowerCase()}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deburr(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=[["ÀÁÂÃÄÅĀĂĄ","A"],["àáâãäåāăą","a"],["ÇĆĈĊČ","C"],["çćĉċč","c"],["ÐĎĐ","D"],["ðďđ","d"],["ÈÉÊËĒĔĖĘĚ","E"],["èéêëēĕėęě","e"],["ĜĞĠĢ","G"],["ĝğġģ","g"],["ĤĦ","H"],["ĥħ","h"],["ÌÍÎÏĨĪĬĮİ","I"],["ìíîïĩīĭįı","i"],["Ĵ","J"],["ĵ","j"],["Ķ","K"],["ķĸ","k"],["ĹĻĽĿŁ","L"],["ĺļľŀł","l"],["ÑŃŅŇŊ","N"],["ñńņňŋ","n"],["ÒÓÔÕÖØŌŎŐ","O"],["òóôõöøōŏő","o"],["ŔŖŘ","R"],["ŕŗř","r"],["ŚŜŞŠ","S"],["śŝşšſ","s"],["ŢŤŦ","T"],["ţťŧ","t"],["ÙÚÛÜŨŪŬŮŰŲ","U"],["ùúûüũūŭůűų","u"],["Ŵ","W"],["ŵ","w"],["ÝŶŸ","Y"],["ýÿŷ","y"],["ŹŻŽ","Z"],["źżž","z"],["Æ","Ae"],["æ","ae"],["Þ","Th"],["þ","th"],["ß","ss"],["IJ","IJ"],["ij","ij"],["Œ","Oe"],["œ","oe"],["ʼn","'n"]],e=new Map;for(let n=0,r=t.length;n<r;n+=1){const[s,c]=t[n];for(const f of s)e.set(f,c)}const o=t=>t>=768&&t<=879||t>=8400&&t<=8432||t>=65056&&t<=65071;export function deburr(t){if(!t)return"";let n="";for(const r of t)o(r.codePointAt(0))||(n+=e.get(r)??r);return n}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function escapeRegExp(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=/[\\^$.*+?()[\]{}|]/g;export function escapeRegExp(c){return c?c.replace(e,"\\$&"):""}
|
package/dist/string/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export { capitalizeEachWords } from './capitalizeEachWords.js';
|
|
2
2
|
export { capitalizeEverySentence } from './capitalizeEverySentence.js';
|
|
3
3
|
export { capitalizeFirst } from './capitalizeFirst.js';
|
|
4
|
+
export { deburr } from './deburr.js';
|
|
5
|
+
export { escapeRegExp } from './escapeRegExp.js';
|
|
4
6
|
export { getGroupKeys } from './getGroupKeys.js';
|
|
5
7
|
export { getStrBytes } from './getStrBytes.js';
|
|
8
|
+
export { pad } from './pad.js';
|
|
6
9
|
export { removeNewLine } from './removeNewLine.js';
|
|
7
10
|
export { removeSpecialChar } from './removeSpecialChar.js';
|
|
8
11
|
export { replaceBetween } from './replaceBetween.js';
|
|
@@ -12,8 +15,15 @@ export { strCount } from './strCount.js';
|
|
|
12
15
|
export { strRandom } from './strRandom.js';
|
|
13
16
|
export { strShuffle } from './strShuffle.js';
|
|
14
17
|
export { strToAscii } from './strToAscii.js';
|
|
18
|
+
export { strToCamelCase } from './strToCamelCase.js';
|
|
19
|
+
export { strToConstantCase } from './strToConstantCase.js';
|
|
20
|
+
export { strToKebabCase } from './strToKebabCase.js';
|
|
21
|
+
export { strToPascalCase } from './strToPascalCase.js';
|
|
22
|
+
export { strToSnakeCase } from './strToSnakeCase.js';
|
|
15
23
|
export { strUnique } from './strUnique.js';
|
|
16
24
|
export { trim } from './trim.js';
|
|
17
25
|
export { truncate } from './truncate.js';
|
|
18
26
|
export { truncateExpect } from './truncateExpect.js';
|
|
27
|
+
export { uncapitalizeFirst } from './uncapitalizeFirst.js';
|
|
19
28
|
export { urlJoin } from './urlJoin.js';
|
|
29
|
+
export { words } from './words.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{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
|
+
export{capitalizeEachWords}from"./capitalizeEachWords.js";export{capitalizeEverySentence}from"./capitalizeEverySentence.js";export{capitalizeFirst}from"./capitalizeFirst.js";export{deburr}from"./deburr.js";export{escapeRegExp}from"./escapeRegExp.js";export{getGroupKeys}from"./getGroupKeys.js";export{getStrBytes}from"./getStrBytes.js";export{pad}from"./pad.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{strToCamelCase}from"./strToCamelCase.js";export{strToConstantCase}from"./strToConstantCase.js";export{strToKebabCase}from"./strToKebabCase.js";export{strToPascalCase}from"./strToPascalCase.js";export{strToSnakeCase}from"./strToSnakeCase.js";export{strUnique}from"./strUnique.js";export{trim}from"./trim.js";export{truncate}from"./truncate.js";export{truncateExpect}from"./truncateExpect.js";export{uncapitalizeFirst}from"./uncapitalizeFirst.js";export{urlJoin}from"./urlJoin.js";export{words}from"./words.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,r){if(r<=0)return"";const n=Array.from(t);let o="";for(let t=0;t<r;t+=1)o+=n[t%n.length];return o}export function pad(r,n,o){const e=r||"",f=o?.char??" ",a=Array.from(e).length;if(a>=n||!f)return e;const c=n-a,i=o?.position??"both";let l=Math.floor(c/2);return"start"===i?l=c:"end"===i&&(l=0),t(f,l)+e+t(f,c-l)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function strToCamelCase(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{capitalizeWord as o}from"./_capitalizeWord.js";import{words as r}from"./words.js";export function strToCamelCase(t){return t?r(t).map((r,t)=>0===t?r.toLowerCase():o(r)).join(""):""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function strToConstantCase(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{words as o}from"./words.js";export function strToConstantCase(r){return r?o(r).map(o=>o.toUpperCase()).join("_"):""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function strToKebabCase(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{words as o}from"./words.js";export function strToKebabCase(r){return r?o(r).map(o=>o.toLowerCase()).join("-"):""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function strToPascalCase(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{capitalizeWord as o}from"./_capitalizeWord.js";import{words as r}from"./words.js";export function strToPascalCase(t){return t?r(t).map(o).join(""):""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function strToSnakeCase(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{words as o}from"./words.js";export function strToSnakeCase(r){return r?o(r).map(o=>o.toLowerCase()).join("_"):""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uncapitalizeFirst(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function uncapitalizeFirst(t){return t?t.charAt(0).toLowerCase()+t.slice(1):""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function words(str: string): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=/\p{L}/u,t=/\p{M}/u,s=/\p{Lu}|\p{Lt}/u,o=/\p{Ll}/u,r=e=>e>="0"&&e<="9",f=t=>e.test(t),i=e=>t.test(e),l=e=>s.test(e),n=e=>o.test(e),u=e=>l(e)||n(e);export function words(e){if(!e)return[];const t=Array.from(e),s=t.length,o=[];let p=0;for(;p<s;){const e=t[p];let c=p+1;if(r(e)){for(;c<s&&r(t[c]);)c+=1;o.push(t.slice(p,c).join("")),p=c}else if(f(e)){if(u(e))if(l(e)){for(;c<s&&f(t[c])&&l(t[c]);)c+=1;if(c-p>1)c<s&&f(t[c])&&n(t[c])&&(c-=1);else for(;c<s&&(i(t[c])||f(t[c])&&n(t[c]));)c+=1}else for(;c<s&&(i(t[c])||f(t[c])&&n(t[c]));)c+=1;else for(;c<s&&(i(t[c])||f(t[c])&&!u(t[c]));)c+=1;o.push(t.slice(p,c).join("")),p=c}else p+=1}return o}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function escapeHtml(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=/[&<>"']/g,e={"&":"&","<":"<",">":">",'"':""","'":"'"};export function escapeHtml(c){return c?c.replace(t,t=>e[t]):""}
|
package/dist/web/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { escapeHtml } from './escapeHtml.js';
|
|
1
2
|
export { generateLicense } from './generateLicense.js';
|
|
2
3
|
export { getParsedInfoFromAddress } from './getParsedInfoFromAddress.js';
|
|
3
4
|
export { getSlug } from './getSlug.js';
|
|
@@ -5,3 +6,4 @@ export { isBotAgent } from './isBotAgent.js';
|
|
|
5
6
|
export { isMatchPathname } from './isMatchPathname.js';
|
|
6
7
|
export { isMobile } from './isMobile.js';
|
|
7
8
|
export { removeLocalePrefix } from './removeLocalePrefix.js';
|
|
9
|
+
export { unescapeHtml } from './unescapeHtml.js';
|
package/dist/web/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{generateLicense}from"./generateLicense.js";export{getParsedInfoFromAddress}from"./getParsedInfoFromAddress.js";export{getSlug}from"./getSlug.js";export{isBotAgent}from"./isBotAgent.js";export{isMatchPathname}from"./isMatchPathname.js";export{isMobile}from"./isMobile.js";export{removeLocalePrefix}from"./removeLocalePrefix.js";
|
|
1
|
+
export{escapeHtml}from"./escapeHtml.js";export{generateLicense}from"./generateLicense.js";export{getParsedInfoFromAddress}from"./getParsedInfoFromAddress.js";export{getSlug}from"./getSlug.js";export{isBotAgent}from"./isBotAgent.js";export{isMatchPathname}from"./isMatchPathname.js";export{isMobile}from"./isMobile.js";export{removeLocalePrefix}from"./removeLocalePrefix.js";export{unescapeHtml}from"./unescapeHtml.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function unescapeHtml(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=/&(?:amp|lt|gt|quot|#39);/g,e={"&":"&","<":"<",">":">",""":'"',"'":"'"};export function unescapeHtml(n){return n?n.replace(t,t=>e[t]):""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qsu",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
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",
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@eslint/js": "^9.39.2",
|
|
76
76
|
"@types/node": "^26.1.2",
|
|
77
|
-
"@typescript-eslint/parser": "^8.
|
|
77
|
+
"@typescript-eslint/parser": "^8.66.0",
|
|
78
78
|
"dayjs": "^1.11.21",
|
|
79
79
|
"eslint": "^9.39.2",
|
|
80
80
|
"eslint-config-prettier": "^10.1.8",
|
|
81
81
|
"eslint-plugin-n": "^18.2.2",
|
|
82
|
-
"globals": "^17.
|
|
82
|
+
"globals": "^17.9.0",
|
|
83
83
|
"jiti": "^2.7.0",
|
|
84
84
|
"prettier": "^3.9.6",
|
|
85
85
|
"terser-glob": "^1.2.1",
|
|
86
|
-
"tsx": "^4.23.
|
|
86
|
+
"tsx": "^4.23.9",
|
|
87
87
|
"typescript": "6.0.3",
|
|
88
|
-
"typescript-eslint": "^8.
|
|
88
|
+
"typescript-eslint": "^8.66.0"
|
|
89
89
|
}
|
|
90
90
|
}
|