toBigint
Creates a to bigint transformation action.
const Action = v.toBigint<TInput, TMessage>(message);
Generics
TInputextends anyTMessageextends ErrorMessage<ToBigintIssue<TInput>> | undefined
Parameters
messageTMessage
Explanation
With toBigint you can transform the input to a bigint. If the input cannot be transformed, you can use message to customize the error message.
Returns
ActionToBigintAction<TInput, TMessage>
Examples
The following examples show how toBigint can be used.
Number schema
Schema to validate a number and transform it to a bigint.
const NumberSchema = v.pipe(v.number(), v.toBigint());
Related
The following APIs can be combined with toBigint.
Schemas
any, boolean, custom, number, string, unknown
Methods
Utils
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/toBigint/