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

Add default option #641

Open
Gabriel-Alves-Cunha opened this issue Sep 21, 2021 · 1 comment
Open

Add default option #641

Gabriel-Alves-Cunha opened this issue Sep 21, 2021 · 1 comment

Comments

@Gabriel-Alves-Cunha
Copy link

For example:

const foo = Nope.object().shape({
        bar: Nope
               .string()
	       .default("bar"),
});

With Yup one can do that with every type (not just string). Would it be possible to add to Nope?

@ftonato
Copy link
Owner

ftonato commented May 27, 2022

Hello @Gabriel-Alves-Cunha, I will take a look on this during next weekend and then I'll provide you my conclusion...


Update: As promised, I took a look and apparently it seems like it makes sense to add both, at least for Strings and Numbers, but this implies a breaking change for the library, so although PR is already created, I would like to change some things internally in the library (responsibilities) before releasing this, so stay tuned and soon the functionality will be available 🚀

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

No branches or pull requests

2 participants