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