validate-polish-ext
v1.0.1
Published
Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed at mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.
Downloads
2
Readme
Description
Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed at mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.
Installation
npm i validate-polish-ext
Features
- Fast, lightweight, no dependencies required.
- PESEL validation.
- NIP validation.
- REGON ( 9, 14 ) validation.
- Identity card ([Polish] dowód osobisty) validation.
Usage
import { validatePolish } from 'validate-polish-ext';
if (!validatePolish.pesel(`92060512181`)) {
throw new Error(`Invalid pesel.`);
}
if (!validatePolish.nip('115667734')) {
throw new Error(`Invalid nip.`);
}
if (!validatePolish.regon(`1251677`)) {
throw new Error(`Invalid regon.`);
}
if (!validatePolish.identityCard(`14124142`)) {
throw new Error(`Invalid identity card.`);
}