UNPKG

id-doc-validator

Version:

A validator for different types of personal ID for multiple countries.

15 lines (10 loc) 310 B
const { testStringAgainstRegex } = require("../utils"); const validateVatBE = (vat) => { const vatPattern = /^BE0[1-9][- .]?\d{4}[- .]?\d{4}$/; if (!testStringAgainstRegex(vat, vatPattern)) return false; //TODO: add validation of check digits return true; }; module.exports = { validateVatBE, };