@alextheman/utility 3.5.10 → 3.6.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 +15 -13
- package/dist/index.d.cts +13 -9
- package/dist/index.d.ts +13 -9
- package/dist/index.js +15 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -510,6 +510,18 @@ function parseBoolean(inputString) {
|
|
|
510
510
|
const stringToBoolean = parseBoolean;
|
|
511
511
|
var parseBoolean_default = parseBoolean;
|
|
512
512
|
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region src/functions/parsers/parseEnv.ts
|
|
515
|
+
const envSchema = zod.z.enum([
|
|
516
|
+
"test",
|
|
517
|
+
"development",
|
|
518
|
+
"production"
|
|
519
|
+
]);
|
|
520
|
+
function parseEnv(data) {
|
|
521
|
+
return envSchema.parse(data);
|
|
522
|
+
}
|
|
523
|
+
var parseEnv_default = parseEnv;
|
|
524
|
+
|
|
513
525
|
//#endregion
|
|
514
526
|
//#region src/functions/parsers/parseFormData.ts
|
|
515
527
|
function parseFormData(formData, dataParser) {
|
|
@@ -579,26 +591,16 @@ var DataError_default = DataError;
|
|
|
579
591
|
//#endregion
|
|
580
592
|
//#region src/types/Email.ts
|
|
581
593
|
const emailSchema = zod.default.email().brand();
|
|
594
|
+
/** @deprecated Please use `z.email().parse() from Zod instead.`*/
|
|
582
595
|
function parseEmail(data) {
|
|
583
596
|
return emailSchema.parse(data);
|
|
584
597
|
}
|
|
585
598
|
var Email_default = parseEmail;
|
|
586
599
|
|
|
587
|
-
//#endregion
|
|
588
|
-
//#region src/types/Env.ts
|
|
589
|
-
const envSchema = zod.z.enum([
|
|
590
|
-
"test",
|
|
591
|
-
"development",
|
|
592
|
-
"production"
|
|
593
|
-
]);
|
|
594
|
-
function parseEnv(data = "development") {
|
|
595
|
-
return envSchema.parse(data);
|
|
596
|
-
}
|
|
597
|
-
var Env_default = parseEnv;
|
|
598
|
-
|
|
599
600
|
//#endregion
|
|
600
601
|
//#region src/types/UUID.ts
|
|
601
602
|
const uuidSchema = zod.default.uuid().brand();
|
|
603
|
+
/** @deprecated Please use `z.uuid().parse() from Zod instead.`*/
|
|
602
604
|
function parseUUID(UUID) {
|
|
603
605
|
return uuidSchema.parse(UUID);
|
|
604
606
|
}
|
|
@@ -784,7 +786,7 @@ exports.omitProperties = omitProperties_default;
|
|
|
784
786
|
exports.paralleliseArrays = paralleliseArrays_default;
|
|
785
787
|
exports.parseBoolean = parseBoolean_default;
|
|
786
788
|
exports.parseEmail = Email_default;
|
|
787
|
-
exports.parseEnv =
|
|
789
|
+
exports.parseEnv = parseEnv_default;
|
|
788
790
|
exports.parseFormData = parseFormData_default;
|
|
789
791
|
exports.parseIntStrict = parseIntStrict_default;
|
|
790
792
|
exports.parseUUID = UUID_default;
|
package/dist/index.d.cts
CHANGED
|
@@ -115,21 +115,16 @@ declare class DataError extends Error {
|
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/types/Email.d.ts
|
|
117
117
|
declare const emailSchema: z.core.$ZodBranded<z.ZodEmail, "Email">;
|
|
118
|
+
/** @deprecated Please use the inferred type from `z.email() from Zod instead.` */
|
|
118
119
|
type Email = z.infer<typeof emailSchema>;
|
|
120
|
+
/** @deprecated Please use `z.email().parse() from Zod instead.`*/
|
|
119
121
|
declare function parseEmail(data: unknown): Email;
|
|
120
122
|
//#endregion
|
|
121
|
-
//#region src/types/Env.d.ts
|
|
122
|
-
declare const envSchema: z$1.ZodEnum<{
|
|
123
|
-
test: "test";
|
|
124
|
-
development: "development";
|
|
125
|
-
production: "production";
|
|
126
|
-
}>;
|
|
127
|
-
type Env = z$1.infer<typeof envSchema>;
|
|
128
|
-
declare function parseEnv(data?: unknown): Env;
|
|
129
|
-
//#endregion
|
|
130
123
|
//#region src/types/UUID.d.ts
|
|
131
124
|
declare const uuidSchema: z.core.$ZodBranded<z.ZodUUID, "UUID">;
|
|
125
|
+
/** @deprecated Please use the inferred type from `z.uuid() from Zod instead.` */
|
|
132
126
|
type UUID = z.infer<typeof uuidSchema>;
|
|
127
|
+
/** @deprecated Please use `z.uuid().parse() from Zod instead.`*/
|
|
133
128
|
declare function parseUUID(UUID: unknown): UUID;
|
|
134
129
|
//#endregion
|
|
135
130
|
//#region src/types/ArrayElement.d.ts
|
|
@@ -278,6 +273,15 @@ declare function parseBoolean(inputString: string): boolean;
|
|
|
278
273
|
/** @deprecated This function has been renamed to parseBoolean. */
|
|
279
274
|
declare const stringToBoolean: typeof parseBoolean;
|
|
280
275
|
//#endregion
|
|
276
|
+
//#region src/functions/parsers/parseEnv.d.ts
|
|
277
|
+
declare const envSchema: z$1.ZodEnum<{
|
|
278
|
+
test: "test";
|
|
279
|
+
development: "development";
|
|
280
|
+
production: "production";
|
|
281
|
+
}>;
|
|
282
|
+
type Env = z$1.infer<typeof envSchema>;
|
|
283
|
+
declare function parseEnv(data: unknown): Env;
|
|
284
|
+
//#endregion
|
|
281
285
|
//#region src/functions/parsers/parseFormData.d.ts
|
|
282
286
|
declare function parseFormData<T>(formData: FormData, dataParser: (data: Record<string, string | Blob>) => T): T;
|
|
283
287
|
declare function parseFormData(formData: FormData): Record<string, string | Blob>;
|
package/dist/index.d.ts
CHANGED
|
@@ -115,21 +115,16 @@ declare class DataError extends Error {
|
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/types/Email.d.ts
|
|
117
117
|
declare const emailSchema: z.core.$ZodBranded<z.ZodEmail, "Email">;
|
|
118
|
+
/** @deprecated Please use the inferred type from `z.email() from Zod instead.` */
|
|
118
119
|
type Email = z.infer<typeof emailSchema>;
|
|
120
|
+
/** @deprecated Please use `z.email().parse() from Zod instead.`*/
|
|
119
121
|
declare function parseEmail(data: unknown): Email;
|
|
120
122
|
//#endregion
|
|
121
|
-
//#region src/types/Env.d.ts
|
|
122
|
-
declare const envSchema: z$1.ZodEnum<{
|
|
123
|
-
test: "test";
|
|
124
|
-
development: "development";
|
|
125
|
-
production: "production";
|
|
126
|
-
}>;
|
|
127
|
-
type Env = z$1.infer<typeof envSchema>;
|
|
128
|
-
declare function parseEnv(data?: unknown): Env;
|
|
129
|
-
//#endregion
|
|
130
123
|
//#region src/types/UUID.d.ts
|
|
131
124
|
declare const uuidSchema: z.core.$ZodBranded<z.ZodUUID, "UUID">;
|
|
125
|
+
/** @deprecated Please use the inferred type from `z.uuid() from Zod instead.` */
|
|
132
126
|
type UUID = z.infer<typeof uuidSchema>;
|
|
127
|
+
/** @deprecated Please use `z.uuid().parse() from Zod instead.`*/
|
|
133
128
|
declare function parseUUID(UUID: unknown): UUID;
|
|
134
129
|
//#endregion
|
|
135
130
|
//#region src/types/ArrayElement.d.ts
|
|
@@ -278,6 +273,15 @@ declare function parseBoolean(inputString: string): boolean;
|
|
|
278
273
|
/** @deprecated This function has been renamed to parseBoolean. */
|
|
279
274
|
declare const stringToBoolean: typeof parseBoolean;
|
|
280
275
|
//#endregion
|
|
276
|
+
//#region src/functions/parsers/parseEnv.d.ts
|
|
277
|
+
declare const envSchema: z$1.ZodEnum<{
|
|
278
|
+
test: "test";
|
|
279
|
+
development: "development";
|
|
280
|
+
production: "production";
|
|
281
|
+
}>;
|
|
282
|
+
type Env = z$1.infer<typeof envSchema>;
|
|
283
|
+
declare function parseEnv(data: unknown): Env;
|
|
284
|
+
//#endregion
|
|
281
285
|
//#region src/functions/parsers/parseFormData.d.ts
|
|
282
286
|
declare function parseFormData<T>(formData: FormData, dataParser: (data: Record<string, string | Blob>) => T): T;
|
|
283
287
|
declare function parseFormData(formData: FormData): Record<string, string | Blob>;
|
package/dist/index.js
CHANGED
|
@@ -481,6 +481,18 @@ function parseBoolean(inputString) {
|
|
|
481
481
|
const stringToBoolean = parseBoolean;
|
|
482
482
|
var parseBoolean_default = parseBoolean;
|
|
483
483
|
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region src/functions/parsers/parseEnv.ts
|
|
486
|
+
const envSchema = z$1.enum([
|
|
487
|
+
"test",
|
|
488
|
+
"development",
|
|
489
|
+
"production"
|
|
490
|
+
]);
|
|
491
|
+
function parseEnv(data) {
|
|
492
|
+
return envSchema.parse(data);
|
|
493
|
+
}
|
|
494
|
+
var parseEnv_default = parseEnv;
|
|
495
|
+
|
|
484
496
|
//#endregion
|
|
485
497
|
//#region src/functions/parsers/parseFormData.ts
|
|
486
498
|
function parseFormData(formData, dataParser) {
|
|
@@ -550,26 +562,16 @@ var DataError_default = DataError;
|
|
|
550
562
|
//#endregion
|
|
551
563
|
//#region src/types/Email.ts
|
|
552
564
|
const emailSchema = z.email().brand();
|
|
565
|
+
/** @deprecated Please use `z.email().parse() from Zod instead.`*/
|
|
553
566
|
function parseEmail(data) {
|
|
554
567
|
return emailSchema.parse(data);
|
|
555
568
|
}
|
|
556
569
|
var Email_default = parseEmail;
|
|
557
570
|
|
|
558
|
-
//#endregion
|
|
559
|
-
//#region src/types/Env.ts
|
|
560
|
-
const envSchema = z$1.enum([
|
|
561
|
-
"test",
|
|
562
|
-
"development",
|
|
563
|
-
"production"
|
|
564
|
-
]);
|
|
565
|
-
function parseEnv(data = "development") {
|
|
566
|
-
return envSchema.parse(data);
|
|
567
|
-
}
|
|
568
|
-
var Env_default = parseEnv;
|
|
569
|
-
|
|
570
571
|
//#endregion
|
|
571
572
|
//#region src/types/UUID.ts
|
|
572
573
|
const uuidSchema = z.uuid().brand();
|
|
574
|
+
/** @deprecated Please use `z.uuid().parse() from Zod instead.`*/
|
|
573
575
|
function parseUUID(UUID) {
|
|
574
576
|
return uuidSchema.parse(UUID);
|
|
575
577
|
}
|
|
@@ -723,4 +725,4 @@ function wait(seconds) {
|
|
|
723
725
|
var wait_default = wait;
|
|
724
726
|
|
|
725
727
|
//#endregion
|
|
726
|
-
export { APIError_default as APIError, DataError_default as DataError, NAMESPACE_EXPORT_REGEX_default as NAMESPACE_EXPORT_REGEX, addDaysToDate_default as addDaysToDate, appendSemicolon_default as appendSemicolon, camelToKebab_default as camelToKebab, convertFileToBase64_default as convertFileToBase64, createFormData_default as createFormData, createTemplateStringsArray_default as createTemplateStringsArray, deepCopy_default as deepCopy, deepFreeze_default as deepFreeze, fillArray_default as fillArray, formatDateAndTime_default as formatDateAndTime, getRandomNumber_default as getRandomNumber, getRecordKeys_default as getRecordKeys, httpErrorCodeLookup, interpolate_default as interpolate, interpolateObjects_default as interpolateObjects, isAnniversary_default as isAnniversary, isLeapYear_default as isLeapYear, isMonthlyMultiple_default as isMonthlyMultiple, isOrdered_default as isOrdered, isSameDate_default as isSameDate, kebabToCamel_default as kebabToCamel, normaliseImportPath, normaliseIndents_default as normaliseIndents, normalizeImportPath_default as normalizeImportPath, normalizeIndents, omitProperties_default as omitProperties, paralleliseArrays_default as paralleliseArrays, parseBoolean_default as parseBoolean, Email_default as parseEmail,
|
|
728
|
+
export { APIError_default as APIError, DataError_default as DataError, NAMESPACE_EXPORT_REGEX_default as NAMESPACE_EXPORT_REGEX, addDaysToDate_default as addDaysToDate, appendSemicolon_default as appendSemicolon, camelToKebab_default as camelToKebab, convertFileToBase64_default as convertFileToBase64, createFormData_default as createFormData, createTemplateStringsArray_default as createTemplateStringsArray, deepCopy_default as deepCopy, deepFreeze_default as deepFreeze, fillArray_default as fillArray, formatDateAndTime_default as formatDateAndTime, getRandomNumber_default as getRandomNumber, getRecordKeys_default as getRecordKeys, httpErrorCodeLookup, interpolate_default as interpolate, interpolateObjects_default as interpolateObjects, isAnniversary_default as isAnniversary, isLeapYear_default as isLeapYear, isMonthlyMultiple_default as isMonthlyMultiple, isOrdered_default as isOrdered, isSameDate_default as isSameDate, kebabToCamel_default as kebabToCamel, normaliseImportPath, normaliseIndents_default as normaliseIndents, normalizeImportPath_default as normalizeImportPath, normalizeIndents, omitProperties_default as omitProperties, paralleliseArrays_default as paralleliseArrays, parseBoolean_default as parseBoolean, Email_default as parseEmail, parseEnv_default as parseEnv, parseFormData_default as parseFormData, parseIntStrict_default as parseIntStrict, UUID_default as parseUUID, parseZodSchema_default as parseZodSchema, randomiseArray_default as randomiseArray, range_default as range, removeDuplicates_default as removeDuplicates, removeIndents_default as removeIndents, stringListToArray_default as stringListToArray, stringToBoolean, truncate_default as truncate, wait_default as wait };
|