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

Optional string regex-based rule throws if key is missing #127

Closed
hueniverse opened this issue Sep 30, 2013 · 3 comments
Closed

Optional string regex-based rule throws if key is missing #127

hueniverse opened this issue Sep 30, 2013 · 3 comments
Labels
bug Bug or defect

Comments

@hueniverse
Copy link
Contributor

See hapijs/hapi#1078

@danielb2
Copy link
Contributor

danielb2 commented Oct 2, 2013

Is it sufficient just to check if value is undefined on this line? https://github.com/spumko/joi/blob/master/lib/types/string.js#L123

if (typeof(value) === 'undefined') { return null; }

It does fix the test.

@hueniverse
Copy link
Contributor Author

Sounds good. PR?

@danielb2
Copy link
Contributor

danielb2 commented Oct 2, 2013

updated pull request

hueniverse pushed a commit that referenced this issue Oct 2, 2013
Fixes #127: Optional string regex-based rule throws if key is missing
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants