optional
Learn about the available options, methods and use cases.
You can pass any validator to this utility and make it optional. If an undefined value is received from the input, it will skip the validation and optionally return a default value.
Usage
Following is the simple usage of this validator
Options
Following are the available options for this validator
Methods
Following are the available methods on this validator
Examples
Read the examples below to understand different use cases
Case 1 (Basic usage)
Case 2 (Use with object)
Last updated
Was this helpful?