uuid validator
Validate an UUID
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-uuid___message | String | The error message |
version | data-fv-uuid___version | String | The UUID version. Can be 3 , 4 , 5 or all (the default version) |
Using the ES6 module
import { uuid } from '/vendors/@form-validation/cjs/validator-uuid';
const result = uuid().validate({
value: ...,
options: {
message: ...,
},
});
Using the npm package
- Install the validator package:
$ npm install @form-validation/validator-uuid
import { uuid } from '@form-validation/validator-uuid';
const result = uuid().validate({
value: ...,
options: {
message: ...,
},
});
See also
Changelog
- The validator doesn't work properly if the
message
property isn't defined
- Fixed an issue that the
version
option isn't passed to the placeholder message