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