integer
Creates an integer validation action.
const Action = v.integer<TInput, TMessage>(message);
Generics
TInputextends numberTMessageextends ErrorMessage<IntegerIssue<TInput>> | undefined
Parameters
messageTMessage
Explanation
With integer you can validate the value of a number. If the input is not an integer, you can use message to customize the error message.
Returns
ActionIntegerAction<TInput, TMessage>
Examples
The following examples show how integer can be used.
Integer schema
Schema to validate an integer.
const IntegerSchema = v.pipe(
v.number(),
v.integer('The number must be an integer.')
);
Related
The following APIs can be combined with integer.
Schemas
Methods
Utils
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/integer/