uuid
Creates an UUID validation action.
const Action = v.uuid<TInput, TMessage>(message);
Generics
TInputextends stringTMessageextends ErrorMessage<UuidIssue<TInput>> | undefined
Parameters
messageTMessage
Explanation
With uuid you can validate the formatting of a string. If the input is not an UUID, you can use message to customize the error message.
Returns
ActionUuidAction<TInput, TMessage>
Examples
The following examples show how uuid can be used.
UUID schema
Schema to validate an UUID.
const UuidSchema = v.pipe(v.string(), v.uuid('The UUID is badly formatted.'));
Related
The following APIs can be combined with uuid.
Schemas
Methods
Utils
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/uuid/