Boolean
Validate boolean values with optional coercion.
Parameters
- options?:
table- required_error?:
string- Custom required message
- type_error?:
string- Custom invalid type message
- required_error?:
local superUser = calid:string({
required_error = "Super user is required",
type_error = "Super user must be a boolean"
})Options
:default(value)– Specifies a fallback value when the input isnil. Useful for optional fields with defaults.:optional()– Allowsnilas a valid value without causing a validation error.:coerce()– Converts strings ("true"/"1") or numbers to boolean (non-zero= true).