zerohelper-utils 11.0.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/README.md +73 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +179 -0
- package/dist/index.js.map +1 -0
- package/package.json +15 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# zerohelper-utils
|
|
2
|
+
|
|
3
|
+
Utility functions for ZeroHelper.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install zerohelper-utils
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { random_module, string_module, math_module, array_module } from 'zerohelper-utils';
|
|
15
|
+
|
|
16
|
+
// Random functions
|
|
17
|
+
const id = random_module.makeUniqueId();
|
|
18
|
+
const text = random_module.randomText(10);
|
|
19
|
+
const num = random_module.randomNumber(1, 100);
|
|
20
|
+
|
|
21
|
+
// String functions
|
|
22
|
+
const title = string_module.titleCase('hello world');
|
|
23
|
+
const slug = string_module.generateSlug('Hello World!');
|
|
24
|
+
const count = string_module.wordCount('hello world test');
|
|
25
|
+
|
|
26
|
+
// Math functions
|
|
27
|
+
const avg = math_module.mean([1, 2, 3, 4, 5]);
|
|
28
|
+
const med = math_module.median([1, 2, 3, 4, 5]);
|
|
29
|
+
const isPrime = math_module.isPrime(17);
|
|
30
|
+
|
|
31
|
+
// Array functions
|
|
32
|
+
const shuffled = array_module.shuffleArray([1, 2, 3, 4, 5]);
|
|
33
|
+
const grouped = array_module.groupBy([{ a: 1 }, { a: 2 }, { a: 1 }], 'a');
|
|
34
|
+
const sorted = array_module.sortBy([{ id: 3 }, { id: 1 }], 'id');
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Modules
|
|
38
|
+
|
|
39
|
+
### random_module
|
|
40
|
+
- `makeUniqueId(length?)` - Generate unique ID
|
|
41
|
+
- `randomText(length)` - Generate random text
|
|
42
|
+
- `randomArray(arr)` - Pick random element
|
|
43
|
+
- `randomNumber(min, max)` - Generate random number
|
|
44
|
+
|
|
45
|
+
### string_module
|
|
46
|
+
- `titleCase(str)` - Convert to title case
|
|
47
|
+
- `generateSlug(str)` - Create URL-friendly slug
|
|
48
|
+
- `wordCount(str)` - Count words
|
|
49
|
+
|
|
50
|
+
### math_module
|
|
51
|
+
- `mean(arr)` - Calculate average
|
|
52
|
+
- `median(arr)` - Find median
|
|
53
|
+
- `range(start, end)` - Generate number range
|
|
54
|
+
- `isPrime(n)` - Check if prime
|
|
55
|
+
|
|
56
|
+
### array_module
|
|
57
|
+
- `shuffleArray(arr)` - Shuffle array
|
|
58
|
+
- `groupBy(arr, key)` - Group by key
|
|
59
|
+
- `sortBy(arr, key)` - Sort by key
|
|
60
|
+
|
|
61
|
+
### date_module
|
|
62
|
+
- `formatDate(date, format?)` - Format date
|
|
63
|
+
|
|
64
|
+
### async_module
|
|
65
|
+
- `sleep(ms)` - Async sleep
|
|
66
|
+
|
|
67
|
+
### function_module
|
|
68
|
+
- `debounce(fn, delay)` - Debounce function
|
|
69
|
+
- `throttle(fn, limit)` - Throttle function
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
ISC
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare function makeUniqueId(length?: number): string;
|
|
2
|
+
export declare function randomText(length: number): string;
|
|
3
|
+
export declare function randomArray<T>(arr: T[]): T;
|
|
4
|
+
export declare function randomNumber(min: number, max: number): number;
|
|
5
|
+
export declare function titleCase(str: string): string;
|
|
6
|
+
export declare function generateSlug(str: string): string;
|
|
7
|
+
export declare function wordCount(str: string): number;
|
|
8
|
+
export declare function mean(arr: number[]): number;
|
|
9
|
+
export declare function median(arr: number[]): number;
|
|
10
|
+
export declare function range(start: number, end: number): number[];
|
|
11
|
+
export declare function isPrime(n: number): boolean;
|
|
12
|
+
export declare function shuffleArray<T>(arr: T[]): T[];
|
|
13
|
+
export declare function groupBy<T>(arr: T[], key: keyof T): Record<string, T[]>;
|
|
14
|
+
export declare function sortBy<T>(arr: T[], key: keyof T): T[];
|
|
15
|
+
export declare function formatDate(date: Date | string, format?: string): string;
|
|
16
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
17
|
+
export declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
18
|
+
export declare function throttle<T extends (...args: any[]) => any>(fn: T, limit: number): (...args: Parameters<T>) => void;
|
|
19
|
+
export declare const random_module: {
|
|
20
|
+
makeUniqueId: typeof makeUniqueId;
|
|
21
|
+
randomText: typeof randomText;
|
|
22
|
+
randomArray: typeof randomArray;
|
|
23
|
+
randomNumber: typeof randomNumber;
|
|
24
|
+
};
|
|
25
|
+
export declare const string_module: {
|
|
26
|
+
titleCase: typeof titleCase;
|
|
27
|
+
generateSlug: typeof generateSlug;
|
|
28
|
+
wordCount: typeof wordCount;
|
|
29
|
+
};
|
|
30
|
+
export declare const math_module: {
|
|
31
|
+
mean: typeof mean;
|
|
32
|
+
median: typeof median;
|
|
33
|
+
range: typeof range;
|
|
34
|
+
isPrime: typeof isPrime;
|
|
35
|
+
};
|
|
36
|
+
export declare const array_module: {
|
|
37
|
+
shuffleArray: typeof shuffleArray;
|
|
38
|
+
groupBy: typeof groupBy;
|
|
39
|
+
sortBy: typeof sortBy;
|
|
40
|
+
};
|
|
41
|
+
export declare const date_module: {
|
|
42
|
+
formatDate: typeof formatDate;
|
|
43
|
+
};
|
|
44
|
+
export declare const async_module: {
|
|
45
|
+
sleep: typeof sleep;
|
|
46
|
+
};
|
|
47
|
+
export declare const function_module: {
|
|
48
|
+
debounce: typeof debounce;
|
|
49
|
+
throttle: typeof throttle;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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G,MAAM,EAAE,MAAM,GAAE,MAAqB,GAAG,MAAM,CAgBrF;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,KAAK,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAMlC;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,KAAK,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CASlC;AAED,eAAO,MAAM,aAAa;;;;;CAKzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAIzB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,eAAO,MAAM,WAAW;;CAEvB,CAAC;AAEF,eAAO,MAAM,YAAY;;CAExB,CAAC;AAEF,eAAO,MAAM,eAAe;;;CAG3B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.function_module = exports.async_module = exports.date_module = exports.array_module = exports.math_module = exports.string_module = exports.random_module = void 0;
|
|
4
|
+
exports.makeUniqueId = makeUniqueId;
|
|
5
|
+
exports.randomText = randomText;
|
|
6
|
+
exports.randomArray = randomArray;
|
|
7
|
+
exports.randomNumber = randomNumber;
|
|
8
|
+
exports.titleCase = titleCase;
|
|
9
|
+
exports.generateSlug = generateSlug;
|
|
10
|
+
exports.wordCount = wordCount;
|
|
11
|
+
exports.mean = mean;
|
|
12
|
+
exports.median = median;
|
|
13
|
+
exports.range = range;
|
|
14
|
+
exports.isPrime = isPrime;
|
|
15
|
+
exports.shuffleArray = shuffleArray;
|
|
16
|
+
exports.groupBy = groupBy;
|
|
17
|
+
exports.sortBy = sortBy;
|
|
18
|
+
exports.formatDate = formatDate;
|
|
19
|
+
exports.sleep = sleep;
|
|
20
|
+
exports.debounce = debounce;
|
|
21
|
+
exports.throttle = throttle;
|
|
22
|
+
function makeUniqueId(length = 16) {
|
|
23
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
24
|
+
let result = '';
|
|
25
|
+
for (let i = 0; i < length; i++) {
|
|
26
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
function randomText(length) {
|
|
31
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ';
|
|
32
|
+
let result = '';
|
|
33
|
+
for (let i = 0; i < length; i++) {
|
|
34
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
function randomArray(arr) {
|
|
39
|
+
return arr[Math.floor(Math.random() * arr.length)];
|
|
40
|
+
}
|
|
41
|
+
function randomNumber(min, max) {
|
|
42
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
43
|
+
}
|
|
44
|
+
function titleCase(str) {
|
|
45
|
+
return str.replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase());
|
|
46
|
+
}
|
|
47
|
+
function generateSlug(str) {
|
|
48
|
+
return str.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)+/g, '');
|
|
49
|
+
}
|
|
50
|
+
function wordCount(str) {
|
|
51
|
+
return str.trim().split(/\s+/).length;
|
|
52
|
+
}
|
|
53
|
+
function mean(arr) {
|
|
54
|
+
if (arr.length === 0)
|
|
55
|
+
return 0;
|
|
56
|
+
return arr.reduce((a, b) => a + b, 0) / arr.length;
|
|
57
|
+
}
|
|
58
|
+
function median(arr) {
|
|
59
|
+
if (arr.length === 0)
|
|
60
|
+
return 0;
|
|
61
|
+
const sorted = [...arr].sort((a, b) => a - b);
|
|
62
|
+
const mid = Math.floor(sorted.length / 2);
|
|
63
|
+
return sorted.length % 2 !== 0 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
|
|
64
|
+
}
|
|
65
|
+
function range(start, end) {
|
|
66
|
+
const result = [];
|
|
67
|
+
for (let i = start; i <= end; i++) {
|
|
68
|
+
result.push(i);
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
function isPrime(n) {
|
|
73
|
+
if (n <= 1)
|
|
74
|
+
return false;
|
|
75
|
+
if (n <= 3)
|
|
76
|
+
return true;
|
|
77
|
+
if (n % 2 === 0 || n % 3 === 0)
|
|
78
|
+
return false;
|
|
79
|
+
for (let i = 5; i * i <= n; i += 6) {
|
|
80
|
+
if (n % i === 0 || n % (i + 2) === 0)
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
function shuffleArray(arr) {
|
|
86
|
+
const shuffled = [...arr];
|
|
87
|
+
for (let i = shuffled.length - 1; i > 0; i--) {
|
|
88
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
89
|
+
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
|
90
|
+
}
|
|
91
|
+
return shuffled;
|
|
92
|
+
}
|
|
93
|
+
function groupBy(arr, key) {
|
|
94
|
+
return arr.reduce((groups, item) => {
|
|
95
|
+
const groupKey = String(item[key]);
|
|
96
|
+
if (!groups[groupKey])
|
|
97
|
+
groups[groupKey] = [];
|
|
98
|
+
groups[groupKey].push(item);
|
|
99
|
+
return groups;
|
|
100
|
+
}, {});
|
|
101
|
+
}
|
|
102
|
+
function sortBy(arr, key) {
|
|
103
|
+
return [...arr].sort((a, b) => {
|
|
104
|
+
if (a[key] < b[key])
|
|
105
|
+
return -1;
|
|
106
|
+
if (a[key] > b[key])
|
|
107
|
+
return 1;
|
|
108
|
+
return 0;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function formatDate(date, format = 'YYYY-MM-DD') {
|
|
112
|
+
const d = typeof date === 'string' ? new Date(date) : date;
|
|
113
|
+
const year = d.getFullYear();
|
|
114
|
+
const month = String(d.getMonth() + 1).padStart(2, '0');
|
|
115
|
+
const day = String(d.getDate()).padStart(2, '0');
|
|
116
|
+
const hours = String(d.getHours()).padStart(2, '0');
|
|
117
|
+
const minutes = String(d.getMinutes()).padStart(2, '0');
|
|
118
|
+
const seconds = String(d.getSeconds()).padStart(2, '0');
|
|
119
|
+
return format
|
|
120
|
+
.replace('YYYY', String(year))
|
|
121
|
+
.replace('MM', month)
|
|
122
|
+
.replace('DD', day)
|
|
123
|
+
.replace('HH', hours)
|
|
124
|
+
.replace('mm', minutes)
|
|
125
|
+
.replace('ss', seconds);
|
|
126
|
+
}
|
|
127
|
+
function sleep(ms) {
|
|
128
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
129
|
+
}
|
|
130
|
+
function debounce(fn, delay) {
|
|
131
|
+
let timeoutId;
|
|
132
|
+
return (...args) => {
|
|
133
|
+
clearTimeout(timeoutId);
|
|
134
|
+
timeoutId = setTimeout(() => fn(...args), delay);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function throttle(fn, limit) {
|
|
138
|
+
let inThrottle;
|
|
139
|
+
return (...args) => {
|
|
140
|
+
if (!inThrottle) {
|
|
141
|
+
fn(...args);
|
|
142
|
+
inThrottle = true;
|
|
143
|
+
setTimeout(() => (inThrottle = false), limit);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
exports.random_module = {
|
|
148
|
+
makeUniqueId,
|
|
149
|
+
randomText,
|
|
150
|
+
randomArray,
|
|
151
|
+
randomNumber,
|
|
152
|
+
};
|
|
153
|
+
exports.string_module = {
|
|
154
|
+
titleCase,
|
|
155
|
+
generateSlug,
|
|
156
|
+
wordCount,
|
|
157
|
+
};
|
|
158
|
+
exports.math_module = {
|
|
159
|
+
mean,
|
|
160
|
+
median,
|
|
161
|
+
range,
|
|
162
|
+
isPrime,
|
|
163
|
+
};
|
|
164
|
+
exports.array_module = {
|
|
165
|
+
shuffleArray,
|
|
166
|
+
groupBy,
|
|
167
|
+
sortBy,
|
|
168
|
+
};
|
|
169
|
+
exports.date_module = {
|
|
170
|
+
formatDate,
|
|
171
|
+
};
|
|
172
|
+
exports.async_module = {
|
|
173
|
+
sleep,
|
|
174
|
+
};
|
|
175
|
+
exports.function_module = {
|
|
176
|
+
debounce,
|
|
177
|
+
throttle,
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,oCAOC;AAED,gCAOC;AAED,kCAEC;AAED,oCAEC;AAED,8BAEC;AAED,oCAEC;AAED,8BAEC;AAED,oBAGC;AAED,wBAKC;AAED,sBAMC;AAED,0BAQC;AAED,oCAOC;AAED,0BAOC;AAED,wBAMC;AAED,gCAgBC;AAED,sBAEC;AAED,4BASC;AAED,4BAYC;AA3ID,SAAgB,YAAY,CAAC,SAAiB,EAAE;IAC9C,MAAM,KAAK,GAAG,gEAAgE,CAAC;IAC/E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM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,CAAC;AAEY,QAAA,aAAa,GAAG;IAC3B,YAAY;IACZ,UAAU;IACV,WAAW;IACX,YAAY;CACb,CAAC;AAEW,QAAA,aAAa,GAAG;IAC3B,SAAS;IACT,YAAY;IACZ,SAAS;CACV,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,IAAI;IACJ,MAAM;IACN,KAAK;IACL,OAAO;CACR,CAAC;AAEW,QAAA,YAAY,GAAG;IAC1B,YAAY;IACZ,OAAO;IACP,MAAM;CACP,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,UAAU;CACX,CAAC;AAEW,QAAA,YAAY,GAAG;IAC1B,KAAK;CACN,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,QAAQ;IACR,QAAQ;CACT,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zerohelper-utils",
|
|
3
|
+
"version": "11.0.0",
|
|
4
|
+
"description": "Core utility functions for ZeroHelper",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": { "build": "tsc", "clean": "rm -rf dist" },
|
|
8
|
+
"keywords": ["zerohelper", "utils", "helper", "utilities"],
|
|
9
|
+
"author": "Onure9e",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {},
|
|
12
|
+
"devDependencies": { "@types/node": "^22.10.2", "typescript": "^5.7.2" },
|
|
13
|
+
"files": ["dist", "README.md"],
|
|
14
|
+
"publishConfig": { "access": "public" }
|
|
15
|
+
}
|