Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.19 KB

File metadata and controls

31 lines (21 loc) · 1.19 KB
code type title description
true
page
validate | Framework | Core
BaseValidationType class validate() abstract method

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.