blob: ff6000cb8e81ee6c6c51fa88fec0030217b03e79 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { useValidation } from '@/composable/validation';
import type { Ref } from 'vue';
function macAddressValidation(value: Ref) {
return useValidation({
source: value,
rules: [
{
message: 'Invalid MAC address',
validator: (value) => value.trim().match(/^([0-9A-Fa-f]{2}[:-]){2,5}([0-9A-Fa-f]{2})$/),
},
],
});
}
export { macAddressValidation };
|