Closed franciscolourenco closed 9 years ago
I don't like the concept of having multi purpose functions. It makes testing harder and there might be issues with assuming that all non objects should be validated like you propose.
I'd rather have a separate function such as validate.short
or validate.single
that does this.
The purpose would be the same, just adding flexibility to the form of input it supports. Instead of checking non objects it could check for boolean, number and strings. But I understand your point.
Do you mind moving this to https://github.com/ansman/validate.js
All further development will be done there.
Do you want the PR?
Yes please, thanks
validate('example@email.com', {presence: true, email: true});
closes #21