Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
national-identity-validator
Advanced tools
This Module validate the NIN of a user by doing a mathematical operation.
The Operation is as follows:
To install the package simply execute:
npm install national-identity-validator
Then in your file import the module:
import validateNationalIdentityNumber from 'national-identity-validator';
validateNationalIdentityNumber(nid: 'string', lastname?: 'string', dob?: 'object' | 'string');
//return an object
date of birth string data should be in the format YYYY-MM-DD
or YYYY/MM/DD
The parameter lastname
is optional which will validate the last name of the person by comparing the first character of the last name with the first character from the nid.
The parameter dob
is optional which will validate the date of birth of the person by comparing the dob with the date of birth of the person from the nid.
The object return is as follows:
{
isValid : boolean,
isNidValid: boolean,
isSurnameValid: boolean,
isValidDob: boolean,
age: number
}
import validateNationalIdentityNumber from 'national-identity-validator';
validateNationalIdentityNumber("S0808739500", "Sample", "YYYY-MM-DD"); //return an object
Simply add type in your package.json file
"type": "module",
FAQs
Mauritius National Identity Validator
We found that national-identity-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.