I'm creating a custom validation rule using VeeValidate. The offical docs uses arrow functions for the getMessage
and validate
methods. How do I implement these functions in the regular function syntax?
VeeValidate.Validator.extend('verify_username', {
getMessage: field => 'Your username must be 3-24 characters long, \
contains only a-z, 0-9, a period or an underscore, and should begin \
with an alphabetic character.',
validate: value => /^[a-z][a-z0-9._]{2,23}$/.test(value)
});