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