cusip validator
Validate a CUSIP number
Options
Using with form field
Name | HTML attribute | Type | Description |
---|
message | data-fv-cusip___message | String | The error message |
Using the ES6 module
import { cusip } from '/vendors/@form-validation/cjs/validator-cusip';
const result = cusip().validate({
value: ...,
options: {
message: ...,
},
});
Using the npm package
- Install the validator package:
$ npm install @form-validation/validator-cusip
import { cusip } from '@form-validation/validator-cusip';
const result = cusip().validate({
value: ...,
options: {
message: ...,
},
});
Basic example
NPM package example
The following snippet shows how to use the cusip validator with the npm package:
import { cusip } from '@form-validation/validator-cusip';
const res1 = cusip().validate({
value: '037833100',
options: {
message: 'The value is not valid CUSIP',
},
});
const res2 = cusip().validate({
value: '31430F200',
options: {
message: 'The value is not valid CUSIP',
},
});
See also
Changelog
- Fixed an issue that the cusip validator doesn't work properly