Validates an option value based on its type and throws an error if the value is invalid.
The option config.
The name of the option.
Optional
Whether to throw an error if the value is invalid.
true Copy
true
The option value to validate.
Throws an error if the option value is invalid and throws is true.
throws
Validates an option value based on its type and throws an error if the value is invalid.