Skip to content

Commit

Permalink
Fix --verbose flag Zod parsing (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
0237h authored Jul 10, 2024
1 parent e780c37 commit c435713
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit c435713

Please sign in to comment.