parris/iz — pull request #7 by eldonferrandepol (2013-05-17 09:07:13+00:00)
Title: All validators return false for null & undefined (almost all)

Please note: This request modifies existing behaviour.

Found some inconsistency in the output of the various validators when handling null and undefined. In general they all return false; however the following inconsistencies were found:

alphaNumeric, date & ip all return true rather than false
empty, ofType, minLength x 2 & maxLength x 2 all throw exceptions.

In all cases they now return false.

There has been no change to iz_extension as this is not actually testing the value of the argument. i.e. iz_extension(null, null) is perfectly valid if fairly pointless.

There has also been no change to iz_inArray. Again, no reason why iz_inArray(null, [null, "a string", 2]) should not be allowed.