field-validators
Common library for master data field validations such as VAT ID, IBAN, etc.
The library has the following validators:
- International Bank Account Number (IBAN)
- Bank Identifier Code (BIC)
- Value Added Tax number (VAT)
- Data Universal Numbering System number (DUNS)
- Global Location Number (GLN)
- Finnish Party Identification number (OVT-number) (OVT)
- Company register number (REGNO)
- ISR party number under Swiss IBAN (ISR)
- ABA routing transit number (ABA)
- Tax Identification Number
- LeitwegID Number
To have a look at the full API, please visit the related wiki page.
Setup
Install library by running:
npm install @opuscapita/field-validators
Perform a validation by doing:
const validators = require('@opuscapita/field-validators');
validators.IBAN.isValid('DE10000000000000000000');
validators.VAT.isValid('DE 10000000');
validators.BIC.isValid('DEDSLTJXXXX');
validators.DUNS.isValid('356932675');
validators.GLN.isValid('3569326752346');
validators.OVT.isValid('003708599126');
validators.REGNO.isValid('Jena GnR 100008', 'DE');
validators.ISR.isValid('54-354567-8');
validators.ABA.isValid('051000017');
validators.LEITWEGID.isValid('04011000-1234512345-06');