wrapp-archive / validate.js

Declarative validation written in javascript
http://validatejs.org/
178 stars 18 forks source link

Add support for validation of single primitives #23

Closed franciscolourenco closed 9 years ago

franciscolourenco commented 10 years ago

validate('example@email.com', {presence: true, email: true});

closes #21

ansman commented 10 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.

franciscolourenco commented 10 years ago

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.

ansman commented 10 years ago

Do you mind moving this to https://github.com/ansman/validate.js

All further development will be done there.

franciscolourenco commented 10 years ago

Do you want the PR?

ansman commented 10 years ago

Yes please, thanks