Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Disable validations Per environments (i.e. do not validate on Production) #1921

Closed
galarbel opened this issue Jan 22, 2023 · 2 comments
Closed

Comments

@galarbel
Copy link

Hi All,

this looks like a really great project, but I was looking for a way to set it up so that real-time validations will only be done on Non-Production environments.

the idea is to make sure that production environment will run as fast as possible.
similar to what redux have with their "production mode".

is there any way to achieve this?
are there any plans to add something like that?

Thanks,
Gal

@JacobWeisenburger
Copy link
Contributor

Is this what you are looking for?

// for node use: process.env.ENVIRONMENT
const schema = Deno.env.get( 'ENVIRONMENT' ) === 'production'
    ? z.any()
    : z.string()

@JacobWeisenburger JacobWeisenburger added enhancement New feature or request question Further information is requested labels Jan 22, 2023
@galarbel
Copy link
Author

something like this just might work :)
it'd be nice to see something like this built in though.

z.configure({ production: true });

this could potentially help with performance issues as was mentioned here:
#205

thanks for the quick response.

@JacobWeisenburger JacobWeisenburger removed enhancement New feature or request question Further information is requested labels Jan 22, 2023
Repository owner locked and limited conversation to collaborators Jan 22, 2023
@JacobWeisenburger JacobWeisenburger converted this issue into discussion #1924 Jan 22, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants