validate (abstract) #
Validates a field against this implemented data type.
This is an abstract method. If not overloaded, it always returns true
Arguments #
validate(opts: JSONObject, field: any, errors: string[]): boolean;
Arguments | Type | Description |
---|---|---|
opts | JSONObject | Data type options. The provided object can only contain the keys defined in the allowedTypeOptions property |
field | any | Data to validate |
errors | string[] | If the provided field is not valid, the reason must be pushed in that array |
Return #
The validate
function returns a boolean telling whether the field is valid.
Edit this page on Github(opens new window)