Closed fernandogmar closed 9 years ago
And using an assert for the Collection(new Assert().Email()) doesn't work either http://jsfiddle.net/6785byju/
Hi @fernandogmar,
Thanks for using this lib! :) I see, this is quite frustrating and should be possible to do so functionally speaking. I'll try to have a look today and see if difficult to implement.
Hi @guillaumepotier,
I have just found the 'bug',
Collection returns an object like {0: Violation, 1: Violation} but _validateString is expeciting a Violation instance directly
result = assert[ i ].check( string, group );
if ( result instanceof Violation )
failures.push( result );
a quick fix thinking out loud could be:
result = assert[ i ].check( string, group );
if ( result !== true)
failures.push( result );
Hi,
I might have fixed your problem in latest commit, thanks to your hint! Do you mind to check? :)
Thanks
Thanks @guillaumepotier
It works for me ;)
P.S don't forget to update the validator.js on the 'dist' folder :D, thanks
Hi Guillaume,
I have problems to validate an array of strings. I was trying to use Assert Collection, but this needs as parameter a Constraint, but the Constraint only accepts a valid mapping object :(.
So this is the example:
Is it possible to define a Constraint for Arrays of strings? could it be soon?
Thanks a lot!