Validator
- Version:
- Since:
- Module:
Module usage
See JET Module Loading for an overview of module usage within JET.
Typescript Import Format
//To use this interface, import as below.
import {Validator} from "ojs/ojvalidator";
Generic Parameters
| Parameter | Description |
|---|
| V | Type of value to be validated |
JET In Typescript
A detailed description of working with JET elements and classes in your typescript project can be found at:
JET Typescript Usage.
Methods
-
getHint(): string|null
-
Returns a hint that describes the validator rule.
Returns:
a hint string or null
-
Type
-
string
|
null
-
validate(value) : {void}
-
Validates the value.
The function typically returns if the validation passes and throws an error if it fails.
Parameters:
| Name |
Type |
Description |
value |
V
|
to be validated
|
Throws:
if validation fails
-
Type
-
Error
Returns:
-
Type
-
void