itlmka.blogg.se

Checkit at
Checkit at













If the flat argument is passed as a "truthy" value, it will output only the first ValidationError in the FieldError otherwise it will output each validation message in a comma separated string.toJSON()Ĭonverts the current error object to a json representation of the error, for easy use/refinement elsewhere. Useful for debugging, the toString method converts the Checkit error into a human readable representation of the failed validation. The get method returns the Checkit.FieldError object for a specific key, or undefined if one does not exist.toString() The keys in this hash are the invalid fields, and the values are Checkit.FieldError objects, which in-turn have an errors attribute, an array containing errors for each failed rule.get(key) The "errors" property of a Checkit.Error object is a hash of errors for each of the fields which are considered "invalid" in any way by the validation rules. The main Error object, Checkit.Error is returned from the has several helper methods & properties, as well as a number of utility methods.

checkit at

One of the main features of Checkit is the error handling By extending the error object with utility methods from underscore, the errors are even easier to work with.

checkit at checkit at

checkSync ( 'email', email, ) if ( err ) Checkit Errors















Checkit at