toBoolean
Creates a to boolean transformation action.
const Action = v.toBoolean<TInput>();
Generics
TInputextends any
Returns
ActionToBooleanAction<TInput>
Examples
The following examples show how toBoolean can be used.
Boolean schema
Schema to validate a string and transform it to a boolean.
const BooleanSchema = v.pipe(v.string(), v.toBoolean());
Related
The following APIs can be combined with toBoolean.
Schemas
any, bigint, custom, date, null, number, string, symbol, undefined, unknown
Methods
Utils
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/toBoolean/