@alextheman/utility 5.2.0 → 5.4.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/index.cjs +16 -5
- package/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +12 -5
- package/dist/internal/index.cjs +13 -2
- package/dist/internal/index.js +13 -2
- package/dist/node/index.cjs +13 -2
- package/dist/node/index.js +13 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,15 +32,22 @@ let libsodium_wrappers = require("libsodium-wrappers");
|
|
|
32
32
|
libsodium_wrappers = __toESM(libsodium_wrappers);
|
|
33
33
|
|
|
34
34
|
//#region src/root/constants/FILE_PATH_REGEX.ts
|
|
35
|
-
const
|
|
35
|
+
const FILE_PATH_PATTERN = String.raw`(?<directory>.+)[\/\\](?<base>[^\/\\]+)`;
|
|
36
|
+
const FILE_PATH_REGEX = RegExp(`^${FILE_PATH_PATTERN}$`);
|
|
36
37
|
|
|
37
38
|
//#endregion
|
|
38
|
-
//#region src/root/constants/
|
|
39
|
-
const
|
|
39
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.ts
|
|
40
|
+
const ONE_DAY_IN_MILLISECONDS = 1440 * 60 * 1e3;
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/root/constants/UUID_REGEX.ts
|
|
44
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
45
|
+
const UUID_REGEX = new RegExp(`^${UUID_PATTERN}$`);
|
|
40
46
|
|
|
41
47
|
//#endregion
|
|
42
48
|
//#region src/root/constants/VERSION_NUMBER_REGEX.ts
|
|
43
|
-
const
|
|
49
|
+
const VERSION_NUMBER_PATTERN = String.raw`^(?:v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$`;
|
|
50
|
+
const VERSION_NUMBER_REGEX = RegExp(`^${VERSION_NUMBER_PATTERN}$`);
|
|
44
51
|
|
|
45
52
|
//#endregion
|
|
46
53
|
//#region src/root/functions/arrayHelpers/fillArray.ts
|
|
@@ -1612,8 +1619,12 @@ function truncate(stringToTruncate, maxLength = 5) {
|
|
|
1612
1619
|
exports.APIError = APIError;
|
|
1613
1620
|
exports.DataError = DataError;
|
|
1614
1621
|
exports.Env = Env;
|
|
1622
|
+
exports.FILE_PATH_PATTERN = FILE_PATH_PATTERN;
|
|
1615
1623
|
exports.FILE_PATH_REGEX = FILE_PATH_REGEX;
|
|
1616
|
-
exports.
|
|
1624
|
+
exports.ONE_DAY_IN_MILLISECONDS = ONE_DAY_IN_MILLISECONDS;
|
|
1625
|
+
exports.UUID_PATTERN = UUID_PATTERN;
|
|
1626
|
+
exports.UUID_REGEX = UUID_REGEX;
|
|
1627
|
+
exports.VERSION_NUMBER_PATTERN = VERSION_NUMBER_PATTERN;
|
|
1617
1628
|
exports.VERSION_NUMBER_REGEX = VERSION_NUMBER_REGEX;
|
|
1618
1629
|
exports.VersionNumber = VersionNumber;
|
|
1619
1630
|
exports.VersionType = VersionType;
|
package/dist/index.d.cts
CHANGED
|
@@ -2,13 +2,19 @@ import z, { ZodError, ZodType, z as z$1 } from "zod";
|
|
|
2
2
|
import { DotenvParseOutput } from "dotenv";
|
|
3
3
|
|
|
4
4
|
//#region src/root/constants/FILE_PATH_REGEX.d.ts
|
|
5
|
-
declare const
|
|
5
|
+
declare const FILE_PATH_PATTERN: string;
|
|
6
|
+
declare const FILE_PATH_REGEX: RegExp;
|
|
6
7
|
//#endregion
|
|
7
|
-
//#region src/root/constants/
|
|
8
|
-
declare const
|
|
8
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.d.ts
|
|
9
|
+
declare const ONE_DAY_IN_MILLISECONDS: number;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/root/constants/UUID_REGEX.d.ts
|
|
12
|
+
declare const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
13
|
+
declare const UUID_REGEX: RegExp;
|
|
9
14
|
//#endregion
|
|
10
15
|
//#region src/root/constants/VERSION_NUMBER_REGEX.d.ts
|
|
11
|
-
declare const
|
|
16
|
+
declare const VERSION_NUMBER_PATTERN: string;
|
|
17
|
+
declare const VERSION_NUMBER_REGEX: RegExp;
|
|
12
18
|
//#endregion
|
|
13
19
|
//#region src/root/functions/arrayHelpers/fillArray.d.ts
|
|
14
20
|
/**
|
|
@@ -1080,4 +1086,4 @@ declare function normaliseIndents(strings: TemplateStringsArray, ...interpolatio
|
|
|
1080
1086
|
*/
|
|
1081
1087
|
declare const normalizeIndents: typeof normaliseIndents;
|
|
1082
1088
|
//#endregion
|
|
1083
|
-
export { APIError, ArrayElement, CallReturnType, CamelToKebabOptions, CreateEnumType, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, Env, FILE_PATH_REGEX, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, IsTypeArgumentString, KebabToCamelOptions,
|
|
1089
|
+
export { APIError, ArrayElement, CallReturnType, CamelToKebabOptions, CreateEnumType, CreateFormDataOptions, CreateFormDataOptionsNullableResolution, CreateFormDataOptionsUndefinedOrNullResolution, DataError, DisallowUndefined, Env, FILE_PATH_PATTERN, FILE_PATH_REGEX, FormDataArrayResolutionStrategy, FormDataNullableResolutionStrategy, HTTPErrorCode, IgnoreCase, IsTypeArgumentString, KebabToCamelOptions, NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, ONE_DAY_IN_MILLISECONDS, OptionalOnCondition, ParallelTuple, RecordKey, RemoveUndefined, StringListToArrayOptions, UUID_PATTERN, UUID_REGEX, VERSION_NUMBER_PATTERN, VERSION_NUMBER_REGEX, VersionNumber, FormatOptionsBase as VersionNumberToStringOptions, VersionType, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, encryptWithKey, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, getStringsAndInterpolations, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, isTemplateStringsArray, kebabToCamel, normaliseIndents, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseVersionType, parseZodSchema, parseZodSchemaAsync, randomiseArray, range, removeDuplicates, removeUndefinedFromObject, sayHello, stringListToArray, stringifyDotenv, truncate, wait, zodVersionNumber };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,19 @@ import z, { ZodError, ZodType, z as z$1 } from "zod";
|
|
|
2
2
|
import { DotenvParseOutput } from "dotenv";
|
|
3
3
|
|
|
4
4
|
//#region src/root/constants/FILE_PATH_REGEX.d.ts
|
|
5
|
-
declare const
|
|
5
|
+
declare const FILE_PATH_PATTERN: string;
|
|
6
|
+
declare const FILE_PATH_REGEX: RegExp;
|
|
6
7
|
//#endregion
|
|
7
|
-
//#region src/root/constants/
|
|
8
|
-
declare const
|
|
8
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.d.ts
|
|
9
|
+
declare const ONE_DAY_IN_MILLISECONDS: number;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/root/constants/UUID_REGEX.d.ts
|
|
12
|
+
declare const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
13
|
+
declare const UUID_REGEX: RegExp;
|
|
9
14
|
//#endregion
|
|
10
15
|
//#region src/root/constants/VERSION_NUMBER_REGEX.d.ts
|
|
11
|
-
declare const
|
|
16
|
+
declare const VERSION_NUMBER_PATTERN: string;
|
|
17
|
+
declare const VERSION_NUMBER_REGEX: RegExp;
|
|
12
18
|
//#endregion
|
|
13
19
|
//#region src/root/functions/arrayHelpers/fillArray.d.ts
|
|
14
20
|
/**
|
|
@@ -1080,4 +1086,4 @@ declare function normaliseIndents(strings: TemplateStringsArray, ...interpolatio
|
|
|
1080
1086
|
*/
|
|
1081
1087
|
declare const normalizeIndents: typeof normaliseIndents;
|
|
1082
1088
|
//#endregion
|
|
1083
|
-
export { APIError, type ArrayElement, type CallReturnType, CamelToKebabOptions, type CreateEnumType, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DisallowUndefined, Env, FILE_PATH_REGEX, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type IsTypeArgumentString, KebabToCamelOptions,
|
|
1089
|
+
export { APIError, type ArrayElement, type CallReturnType, CamelToKebabOptions, type CreateEnumType, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, DataError, type DisallowUndefined, Env, FILE_PATH_PATTERN, FILE_PATH_REGEX, type FormDataArrayResolutionStrategy, type FormDataNullableResolutionStrategy, type HTTPErrorCode, type IgnoreCase, type IsTypeArgumentString, KebabToCamelOptions, type NonUndefined, NormaliseIndentsFunction, NormaliseIndentsOptions, NormalizeIndentsFunction, NormalizeIndentsOptions, ONE_DAY_IN_MILLISECONDS, type OptionalOnCondition, ParallelTuple, type RecordKey, type RemoveUndefined, type StringListToArrayOptions, UUID_PATTERN, UUID_REGEX, VERSION_NUMBER_PATTERN, VERSION_NUMBER_REGEX, VersionNumber, type FormatOptionsBase as VersionNumberToStringOptions, VersionType, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, encryptWithKey, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, getStringsAndInterpolations, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, isTemplateStringsArray, kebabToCamel, normaliseIndents, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseVersionType, parseZodSchema, parseZodSchemaAsync, randomiseArray, range, removeDuplicates, removeUndefinedFromObject, sayHello, stringListToArray, stringifyDotenv, truncate, wait, zodVersionNumber };
|
package/dist/index.js
CHANGED
|
@@ -2,15 +2,22 @@ import z, { z as z$1 } from "zod";
|
|
|
2
2
|
import sodium from "libsodium-wrappers";
|
|
3
3
|
|
|
4
4
|
//#region src/root/constants/FILE_PATH_REGEX.ts
|
|
5
|
-
const
|
|
5
|
+
const FILE_PATH_PATTERN = String.raw`(?<directory>.+)[\/\\](?<base>[^\/\\]+)`;
|
|
6
|
+
const FILE_PATH_REGEX = RegExp(`^${FILE_PATH_PATTERN}$`);
|
|
6
7
|
|
|
7
8
|
//#endregion
|
|
8
|
-
//#region src/root/constants/
|
|
9
|
-
const
|
|
9
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.ts
|
|
10
|
+
const ONE_DAY_IN_MILLISECONDS = 1440 * 60 * 1e3;
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/root/constants/UUID_REGEX.ts
|
|
14
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
15
|
+
const UUID_REGEX = new RegExp(`^${UUID_PATTERN}$`);
|
|
10
16
|
|
|
11
17
|
//#endregion
|
|
12
18
|
//#region src/root/constants/VERSION_NUMBER_REGEX.ts
|
|
13
|
-
const
|
|
19
|
+
const VERSION_NUMBER_PATTERN = String.raw`^(?:v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$`;
|
|
20
|
+
const VERSION_NUMBER_REGEX = RegExp(`^${VERSION_NUMBER_PATTERN}$`);
|
|
14
21
|
|
|
15
22
|
//#endregion
|
|
16
23
|
//#region src/root/functions/arrayHelpers/fillArray.ts
|
|
@@ -1579,4 +1586,4 @@ function truncate(stringToTruncate, maxLength = 5) {
|
|
|
1579
1586
|
}
|
|
1580
1587
|
|
|
1581
1588
|
//#endregion
|
|
1582
|
-
export { APIError, DataError, Env, FILE_PATH_REGEX,
|
|
1589
|
+
export { APIError, DataError, Env, FILE_PATH_PATTERN, FILE_PATH_REGEX, ONE_DAY_IN_MILLISECONDS, UUID_PATTERN, UUID_REGEX, VERSION_NUMBER_PATTERN, VERSION_NUMBER_REGEX, VersionNumber, VersionType, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, createTemplateStringsArray, deepCopy, deepFreeze, encryptWithKey, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, getStringsAndInterpolations, httpErrorCodeLookup, interpolate, interpolateObjects, isAnniversary, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, isTemplateStringsArray, kebabToCamel, normaliseIndents, normalizeIndents, omitProperties, paralleliseArrays, parseBoolean, parseEnv, parseFormData, parseIntStrict, parseVersionType, parseZodSchema, parseZodSchemaAsync, randomiseArray, range, removeDuplicates, removeUndefinedFromObject, sayHello, stringListToArray, stringifyDotenv, truncate, wait, zodVersionNumber };
|
package/dist/internal/index.cjs
CHANGED
|
@@ -183,11 +183,22 @@ var DataError = class DataError extends Error {
|
|
|
183
183
|
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region src/root/constants/FILE_PATH_REGEX.ts
|
|
186
|
-
const
|
|
186
|
+
const FILE_PATH_PATTERN = String.raw`(?<directory>.+)[\/\\](?<base>[^\/\\]+)`;
|
|
187
|
+
const FILE_PATH_REGEX = RegExp(`^${FILE_PATH_PATTERN}$`);
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.ts
|
|
191
|
+
const ONE_DAY_IN_MILLISECONDS = 1440 * 60 * 1e3;
|
|
192
|
+
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/root/constants/UUID_REGEX.ts
|
|
195
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
196
|
+
const UUID_REGEX = new RegExp(`^${UUID_PATTERN}$`);
|
|
187
197
|
|
|
188
198
|
//#endregion
|
|
189
199
|
//#region src/root/constants/VERSION_NUMBER_REGEX.ts
|
|
190
|
-
const
|
|
200
|
+
const VERSION_NUMBER_PATTERN = String.raw`^(?:v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$`;
|
|
201
|
+
const VERSION_NUMBER_REGEX = RegExp(`^${VERSION_NUMBER_PATTERN}$`);
|
|
191
202
|
|
|
192
203
|
//#endregion
|
|
193
204
|
//#region src/root/types/VersionNumber.ts
|
package/dist/internal/index.js
CHANGED
|
@@ -153,11 +153,22 @@ var DataError = class DataError extends Error {
|
|
|
153
153
|
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/root/constants/FILE_PATH_REGEX.ts
|
|
156
|
-
const
|
|
156
|
+
const FILE_PATH_PATTERN = String.raw`(?<directory>.+)[\/\\](?<base>[^\/\\]+)`;
|
|
157
|
+
const FILE_PATH_REGEX = RegExp(`^${FILE_PATH_PATTERN}$`);
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.ts
|
|
161
|
+
const ONE_DAY_IN_MILLISECONDS = 1440 * 60 * 1e3;
|
|
162
|
+
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/root/constants/UUID_REGEX.ts
|
|
165
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
166
|
+
const UUID_REGEX = new RegExp(`^${UUID_PATTERN}$`);
|
|
157
167
|
|
|
158
168
|
//#endregion
|
|
159
169
|
//#region src/root/constants/VERSION_NUMBER_REGEX.ts
|
|
160
|
-
const
|
|
170
|
+
const VERSION_NUMBER_PATTERN = String.raw`^(?:v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$`;
|
|
171
|
+
const VERSION_NUMBER_REGEX = RegExp(`^${VERSION_NUMBER_PATTERN}$`);
|
|
161
172
|
|
|
162
173
|
//#endregion
|
|
163
174
|
//#region src/root/types/VersionNumber.ts
|
package/dist/node/index.cjs
CHANGED
|
@@ -70,11 +70,22 @@ const normaliseImportPath = normalizeImportPath;
|
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/root/constants/FILE_PATH_REGEX.ts
|
|
73
|
-
const
|
|
73
|
+
const FILE_PATH_PATTERN = String.raw`(?<directory>.+)[\/\\](?<base>[^\/\\]+)`;
|
|
74
|
+
const FILE_PATH_REGEX = RegExp(`^${FILE_PATH_PATTERN}$`);
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.ts
|
|
78
|
+
const ONE_DAY_IN_MILLISECONDS = 1440 * 60 * 1e3;
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/root/constants/UUID_REGEX.ts
|
|
82
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
83
|
+
const UUID_REGEX = new RegExp(`^${UUID_PATTERN}$`);
|
|
74
84
|
|
|
75
85
|
//#endregion
|
|
76
86
|
//#region src/root/constants/VERSION_NUMBER_REGEX.ts
|
|
77
|
-
const
|
|
87
|
+
const VERSION_NUMBER_PATTERN = String.raw`^(?:v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$`;
|
|
88
|
+
const VERSION_NUMBER_REGEX = RegExp(`^${VERSION_NUMBER_PATTERN}$`);
|
|
78
89
|
|
|
79
90
|
//#endregion
|
|
80
91
|
//#region src/root/functions/arrayHelpers/fillArray.ts
|
package/dist/node/index.js
CHANGED
|
@@ -40,11 +40,22 @@ const normaliseImportPath = normalizeImportPath;
|
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/root/constants/FILE_PATH_REGEX.ts
|
|
43
|
-
const
|
|
43
|
+
const FILE_PATH_PATTERN = String.raw`(?<directory>.+)[\/\\](?<base>[^\/\\]+)`;
|
|
44
|
+
const FILE_PATH_REGEX = RegExp(`^${FILE_PATH_PATTERN}$`);
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/root/constants/ONE_DAY_IN_MILLISECONDS.ts
|
|
48
|
+
const ONE_DAY_IN_MILLISECONDS = 1440 * 60 * 1e3;
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/root/constants/UUID_REGEX.ts
|
|
52
|
+
const UUID_PATTERN = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
53
|
+
const UUID_REGEX = new RegExp(`^${UUID_PATTERN}$`);
|
|
44
54
|
|
|
45
55
|
//#endregion
|
|
46
56
|
//#region src/root/constants/VERSION_NUMBER_REGEX.ts
|
|
47
|
-
const
|
|
57
|
+
const VERSION_NUMBER_PATTERN = String.raw`^(?:v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$`;
|
|
58
|
+
const VERSION_NUMBER_REGEX = RegExp(`^${VERSION_NUMBER_PATTERN}$`);
|
|
48
59
|
|
|
49
60
|
//#endregion
|
|
50
61
|
//#region src/root/functions/arrayHelpers/fillArray.ts
|