@digitraffic/common 2026.2.17-3 → 2026.2.17-4
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.
|
@@ -21,6 +21,7 @@ export declare function zStringToNumber(message?: string): z.ZodPipe<z.ZodString
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function zStringToDate(message?: string): z.ZodPipe<z.ZodString, z.ZodTransform<Date | undefined, string>>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* A non-empty string. Empty strings produce a validation error.
|
|
25
|
+
* Chain with .optional() to also accept undefined.
|
|
25
26
|
*/
|
|
26
|
-
export declare function
|
|
27
|
+
export declare function zNonEmptyString(message?: string): z.ZodString;
|
package/dist/utils/zod-utils.js
CHANGED
|
@@ -46,12 +46,12 @@ export function zStringToDate(message) {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* A non-empty string. Empty strings produce a validation error.
|
|
50
|
+
* Chain with .optional() to also accept undefined.
|
|
50
51
|
*/
|
|
51
|
-
export function
|
|
52
|
-
return z
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
.transform((val) => (val === "" ? undefined : val));
|
|
52
|
+
export function zNonEmptyString(message) {
|
|
53
|
+
return z.string().refine((val) => val !== "", {
|
|
54
|
+
message: message ?? "String must not be empty",
|
|
55
|
+
});
|
|
56
56
|
}
|
|
57
57
|
//# sourceMappingURL=zod-utils.js.map
|