UNPKG

id-doc-validator

Version:

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

15 lines (10 loc) 282 B
const { testStringAgainstRegex } = require("../utils"); const validateVatHR = (vat) => { const vatPattern = /^HR\d{11}$/; if (!testStringAgainstRegex(vat, vatPattern)) return false; //TODO: validate the check digit return true; }; module.exports = { validateVatHR, };