Skip to content

Halfi/russian-requisites-validation

Repository files navigation

Russian data validation

Running Code Coverage Codecov npm version install size Libraries.io dependency status for latest release license styled with prettier


This is more modern realisation of this library written on typescript and published to the npm.

Validate inn, ogrn, ogrnip, snils, bik, kpp, correspondent and checking account.

More detail information about data validation here.

Installation

npm i russian-requisites-validation

Usage

Typescript

import { ResponseCode, Validation } from 'russian-requisites-validation'

const validation = new Validation({ lng: 'ru' });
const response = validation.Inn(value);

console.log('valid: ', response === ResponseCode.Success);
console.log('error: ', response.message);
console.log('error code: ', response.code);

EcmaScript

import { ResponseCode, Validation } from 'russian-requisites-validation'

const validation = new Validation({ lng: 'ru' });
const response = validation.Inn(value);

console.log('valid: ', response === ResponseCode.Success);
console.log('error: ', response.message);
console.log('error code: ', response.code);

License

The scripts and documentation in this project are released under the MIT License