From c435713209ea4e26a80913b41a31cfe2617ba329 Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Wed, 10 Jul 2024 10:08:41 -0400 Subject: [PATCH] Fix `--verbose` flag Zod parsing (#50) --- src/config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index d6de2cd..53f1912 100644 --- a/src/config.ts +++ b/src/config.ts @@ -44,5 +44,6 @@ export const config = z.object({ username: z.string(), password: z.string(), maxLimit: z.coerce.number(), - verbose: z.coerce.boolean(), + // `z.coerce.boolean` doesn't parse boolean string values as expected (see https://github.com/colinhacks/zod/issues/1630) + verbose: z.coerce.string().transform((val) => val.toLowerCase() === "true"), }).parse(opts);