Constructor
# new Validator(name, errorMessageopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string
|
validator name. Should match the type -> subtype of the field |
||
errorMessage |
string
|
<optional> |
Child classes must implement this | should always have a default message |
Methods
# hasErrors(value, …argsopt) → {string|undefined}
returns the error message, or nothing if is valid
.returns the error message, or nothing if is valid
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
the value |
||
args |
<optional> <repeatable> |
optional others args |
errors or nothing
string
|
undefined