Constructor
# new PatternValidator(errorMessage)
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
errorMessage |
string
|
Field does not match pattern |
Methods
# hasErrors(value, pattern) → {string|undefined}
returns the error message, or nothing if is valid
.returns the error message, or nothing if is valid
Parameters:
| Name | Type | Description |
|---|---|---|
value |
the value |
|
pattern |
the pattern to validate |
the errors or nothing
string
|
undefined