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

Default values #71

Closed
lukasruczkowski opened this issue Sep 18, 2015 · 3 comments
Closed

Default values #71

lukasruczkowski opened this issue Sep 18, 2015 · 3 comments

Comments

@lukasruczkowski
Copy link

It would be nice if also "null" or "[]" values could be set up to default value. Not only "undefined" values.

@knownasilya
Copy link
Collaborator

Feel free to submit a PR 👍

@lukasruczkowski
Copy link
Author

OK. From my point of view there are two ways how can I do this.

The first one is to use existing "defaultValue" option and set default value for all - "undefined", null or empty array.

The second one - create a new options (e.g. - notNull and notEmpty). And if notNull or notEmpty values will be set to TRUE the default value will be use for all null or empty array values.

This library is your baby so which method of implementation do you suggest? ;-)

@knownasilya
Copy link
Collaborator

So currently default values are supported as of v3.0.0, but only when using as the module (see the enhanced fields property). I could see a --default-values value1,value2 option for the CLI which would pass the defaults to the fields in the order defined.

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

2 participants