Skip to content

Add the "noDefaults" option#683

Merged
Marsup merged 1 commit intohapijs:masterfrom
ludoblues:master
Jul 13, 2015
Merged

Add the "noDefaults" option#683
Marsup merged 1 commit intohapijs:masterfrom
ludoblues:master

Conversation

@ludoblues
Copy link
Contributor

This option enables you to validate your data without applying default values into it.
Can be usefull when your default values are dynamic.

Corresponding issue: #682

@Marsup Marsup added this to the 6.6.0 milestone Jul 11, 2015
@Marsup Marsup added the feature New functionality or improvement label Jul 11, 2015
@Marsup Marsup self-assigned this Jul 11, 2015
lib/any.js Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not enough, you're only short-circuiting the non-function form of default (previous if).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Marsup you are right, i was looking for adding the minimum of complexity in this area, since there are plenty of conditions out there.

Let me know if it would be better to change each conditions to ensure that the "noDefaults" option is not set to "false".

Thanks !

@Marsup
Copy link
Collaborator

Marsup commented Jul 11, 2015

It's OK like that. Can you add other tests with functions and refs ? Also squash the commits when you're done please.

update readme

fix condition
@ludoblues
Copy link
Contributor Author

@Marsup all done !

Marsup added a commit that referenced this pull request Jul 13, 2015
Add the "noDefaults" option
@Marsup Marsup merged commit 8eff7cf into hapijs:master Jul 13, 2015
@Marsup
Copy link
Collaborator

Marsup commented Jul 13, 2015

Thanks.

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants