Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[💡 Feature]: Validate all user inputs with zod #864

Open
roninjin10 opened this issue Sep 10, 2023 · 0 comments
Open

[💡 Feature]: Validate all user inputs with zod #864

roninjin10 opened this issue Sep 10, 2023 · 0 comments

Comments

@roninjin10
Copy link
Contributor

Is your feature request related to a problem?

Easy low hanging fruit is to validate all userInput with zod. E.g.

z.object({
  secretWordsOrPrivateKey: z.string().refine(isPrivateKeyOrSecretWords),
  ...,
}).parse(setupMetamaskOptions)

This would fix an issue where passing in bad user input often throws a non obvious error message. e.g. not including secretWordsOrPrivateKey throws cannot read property includes of undefined

Describe the solution you'd like.

Validate user input before running synpress

Describe alternatives you've considered.

Typescript partially fixes this problem but zod gives the runtime safety too

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant