hapijs / hapijs/joi

Add more details to behavior of allow() and valid()

Open
#3,076 0 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
JavaScript
Stars
21.2k
Forks
1.5k
Avg merge
4h 57m
Merged PRs (30d)
14

Description

### Module version

17.13.3

### What documentation problem did you notice?

Please add this clearly to the details to behavior of allow() and valid() functions such that:

allow() and valid() functions short circuits the validation, if the field value is one of the values set as parameters to the given functions.

For example, allow('', null) will not trigger additional validations in the chain if the value is 'empty string', since the given value is one of the "allowed" values.

Similarly, valid('', null) will not trigger additionally chained validations if the field value is either 'empty string' or null.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.