1.2.0 • Published 3 years ago

belarus-personal-number-validator v1.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Belarus personal number validator

Validator for personal number in passport of Belarus.

Install

npm i belarus-personal-number-validator

Usage

import { validate } from 'belarus-personal-number-validator';

validate('0000000A000PB2'); //=> {valid: true, error: null}
validate('0000000A000PB3'); //=> {valid: false, error: 'Control numbers are not equal'}

Validation errors

  • 'Personal number must be string'
  • 'Personal number must contain 14 symbols'
  • 'Personal number must contain only numbers and uppercase Latin letters'
  • 'Control numbers are not equal'