@alextheman/utility 1.11.6 → 1.12.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.cjs +10 -0
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +9 -0
- package/package.json +6 -3
package/dist/index.cjs
CHANGED
|
@@ -28,6 +28,7 @@ __export(index_exports, {
|
|
|
28
28
|
isLeapYear: () => isLeapYear_default,
|
|
29
29
|
isMonthlyMultiple: () => isMonthlyMultiple_default,
|
|
30
30
|
isSameDate: () => isSameDate_default,
|
|
31
|
+
newEnv: () => newEnv_default,
|
|
31
32
|
randomiseArray: () => randomiseArray_default,
|
|
32
33
|
range: () => range_default,
|
|
33
34
|
truncate: () => truncate_default,
|
|
@@ -154,6 +155,14 @@ function isMonthlyMultiple(firstDate, secondDate) {
|
|
|
154
155
|
}
|
|
155
156
|
var isMonthlyMultiple_default = isMonthlyMultiple;
|
|
156
157
|
|
|
158
|
+
// src/newEnv.ts
|
|
159
|
+
var import_zod = require("zod");
|
|
160
|
+
var envSchema = import_zod.z.enum(["test", "development", "production"]);
|
|
161
|
+
function newEnv(data = "development") {
|
|
162
|
+
return envSchema.parse(data);
|
|
163
|
+
}
|
|
164
|
+
var newEnv_default = newEnv;
|
|
165
|
+
|
|
157
166
|
// src/randomiseArray.ts
|
|
158
167
|
function randomiseArray(array) {
|
|
159
168
|
const mutableArray = [...array];
|
|
@@ -215,6 +224,7 @@ var wait_default = wait;
|
|
|
215
224
|
isLeapYear,
|
|
216
225
|
isMonthlyMultiple,
|
|
217
226
|
isSameDate,
|
|
227
|
+
newEnv,
|
|
218
228
|
randomiseArray,
|
|
219
229
|
range,
|
|
220
230
|
truncate,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
1
3
|
declare function addDaysToDate(currentDate?: Date, dayIncrement?: number): Date;
|
|
2
4
|
|
|
3
5
|
declare function appendSemicolon(stringToAppendTo: string): string;
|
|
@@ -14,6 +16,14 @@ declare function isMonthlyMultiple(firstDate: Date, secondDate: Date): boolean;
|
|
|
14
16
|
|
|
15
17
|
declare function isSameDate(firstDate: Date, secondDate: Date): boolean;
|
|
16
18
|
|
|
19
|
+
declare const envSchema: z.ZodEnum<{
|
|
20
|
+
test: "test";
|
|
21
|
+
development: "development";
|
|
22
|
+
production: "production";
|
|
23
|
+
}>;
|
|
24
|
+
type Env = z.infer<typeof envSchema>;
|
|
25
|
+
declare function newEnv(data?: unknown): Env;
|
|
26
|
+
|
|
17
27
|
declare function randomiseArray(array: unknown[]): unknown[];
|
|
18
28
|
|
|
19
29
|
declare function range(start: number, stop: number, step?: number): number[];
|
|
@@ -22,4 +32,4 @@ declare function truncate(stringToTruncate: string, maxLength?: number): string;
|
|
|
22
32
|
|
|
23
33
|
declare function wait(seconds: number): Promise<void>;
|
|
24
34
|
|
|
25
|
-
export { addDaysToDate, appendSemicolon, convertFileToBase64, formatDateAndTime, getRandomNumber, isLeapYear, isMonthlyMultiple, isSameDate, randomiseArray, range, truncate, wait };
|
|
35
|
+
export { type Env, addDaysToDate, appendSemicolon, convertFileToBase64, formatDateAndTime, getRandomNumber, isLeapYear, isMonthlyMultiple, isSameDate, newEnv, randomiseArray, range, truncate, wait };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
1
3
|
declare function addDaysToDate(currentDate?: Date, dayIncrement?: number): Date;
|
|
2
4
|
|
|
3
5
|
declare function appendSemicolon(stringToAppendTo: string): string;
|
|
@@ -14,6 +16,14 @@ declare function isMonthlyMultiple(firstDate: Date, secondDate: Date): boolean;
|
|
|
14
16
|
|
|
15
17
|
declare function isSameDate(firstDate: Date, secondDate: Date): boolean;
|
|
16
18
|
|
|
19
|
+
declare const envSchema: z.ZodEnum<{
|
|
20
|
+
test: "test";
|
|
21
|
+
development: "development";
|
|
22
|
+
production: "production";
|
|
23
|
+
}>;
|
|
24
|
+
type Env = z.infer<typeof envSchema>;
|
|
25
|
+
declare function newEnv(data?: unknown): Env;
|
|
26
|
+
|
|
17
27
|
declare function randomiseArray(array: unknown[]): unknown[];
|
|
18
28
|
|
|
19
29
|
declare function range(start: number, stop: number, step?: number): number[];
|
|
@@ -22,4 +32,4 @@ declare function truncate(stringToTruncate: string, maxLength?: number): string;
|
|
|
22
32
|
|
|
23
33
|
declare function wait(seconds: number): Promise<void>;
|
|
24
34
|
|
|
25
|
-
export { addDaysToDate, appendSemicolon, convertFileToBase64, formatDateAndTime, getRandomNumber, isLeapYear, isMonthlyMultiple, isSameDate, randomiseArray, range, truncate, wait };
|
|
35
|
+
export { type Env, addDaysToDate, appendSemicolon, convertFileToBase64, formatDateAndTime, getRandomNumber, isLeapYear, isMonthlyMultiple, isSameDate, newEnv, randomiseArray, range, truncate, wait };
|
package/dist/index.js
CHANGED
|
@@ -117,6 +117,14 @@ function isMonthlyMultiple(firstDate, secondDate) {
|
|
|
117
117
|
}
|
|
118
118
|
var isMonthlyMultiple_default = isMonthlyMultiple;
|
|
119
119
|
|
|
120
|
+
// src/newEnv.ts
|
|
121
|
+
import { z } from "zod";
|
|
122
|
+
var envSchema = z.enum(["test", "development", "production"]);
|
|
123
|
+
function newEnv(data = "development") {
|
|
124
|
+
return envSchema.parse(data);
|
|
125
|
+
}
|
|
126
|
+
var newEnv_default = newEnv;
|
|
127
|
+
|
|
120
128
|
// src/randomiseArray.ts
|
|
121
129
|
function randomiseArray(array) {
|
|
122
130
|
const mutableArray = [...array];
|
|
@@ -177,6 +185,7 @@ export {
|
|
|
177
185
|
isLeapYear_default as isLeapYear,
|
|
178
186
|
isMonthlyMultiple_default as isMonthlyMultiple,
|
|
179
187
|
isSameDate_default as isSameDate,
|
|
188
|
+
newEnv_default as newEnv,
|
|
180
189
|
randomiseArray_default as randomiseArray,
|
|
181
190
|
range_default as range,
|
|
182
191
|
truncate_default as truncate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/utility",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"description": "",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@alextheman/eslint-plugin": "^1.6.
|
|
28
|
+
"@alextheman/eslint-plugin": "^1.6.5",
|
|
29
29
|
"@eslint/js": "^9.33.0",
|
|
30
30
|
"@types/node": "^24.3.0",
|
|
31
31
|
"eslint": "^9.33.0",
|
|
@@ -37,8 +37,11 @@
|
|
|
37
37
|
"prettier": "^3.6.2",
|
|
38
38
|
"tsup": "^8.5.0",
|
|
39
39
|
"typescript": "^5.9.2",
|
|
40
|
-
"typescript-eslint": "^8.
|
|
40
|
+
"typescript-eslint": "^8.40.0",
|
|
41
41
|
"vite-tsconfig-paths": "^5.1.4",
|
|
42
42
|
"vitest": "^3.2.4"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"zod": "^4.0.17"
|
|
43
46
|
}
|
|
44
47
|
}
|