Add your own rules
You can add your own rules by using Kensho.rule.add()
.
Also, You have to set to return boolean type in the callback function.
It meaning is the value is valid or invalid.
The 1st argument is rule name. The 2nd argument is callback function as your own rule validation.
callback function arguments
Arguments | Type | Description |
value | any | Value to be validated. |
option | object | Callback option. |
Kensho | Kensho | Kensho class. |
With TypeScript
Last updated