package
Individual Taxpayer Identification Number validator and masker
npm install itin-validatorGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Registry package owners.
Validate and mask a U.S. Individual Taxpayer Identification Number (ITIN).
Install the package via npm:
npm install itin-validator --saveisValid(value)This method validates if the given value is a valid Individual Taxpayer Identification Number.
value (*): The value to validate.(boolean): Returns whether the input value is a valid ITIN or not.
isValid({});
// => false
isValid('9-0-0700000');
// => false
isValid('900-70-0000');
// => true
isValid('900700000');
// => truemask(value)This method will help you protect this sensitive piece of information by obfuscating some digits.
value (*): The value to mask.(string): Returns the masked value by replacing value certain digits by 'X'.
mask({});
// Throws an Error.
mask('9-0-0700000');
// Throws an Error.
mask('900-70-0000');
// => XXX-XX-0000
mask('900700000');
// => XXXXX0000To test using a local installation of node.js:
npm testTo test using Docker exclusively:
docker-compose run --rm sutnpm version [<newversion> | major | minor | patch] -m "Release %s"MIT