se-panfilov / jsvat

Check the validity of the format of an EU VAT number
http://se-panfilov.github.io/jsvat
MIT License
131 stars 34 forks source link

custom country validator country is not in countries #95

Closed javi-p-nt closed 4 years ago

javi-p-nt commented 4 years ago

I've tried this:export const andorra = { name: 'Andorra', codes: ['AD', 'AND', '20'], // This codes should follow ISO standards (short, long and numeric), but it's your own business calcFn: (vat) => { return vat.length === 10; }, rules: { regex: [/^(AD)(\d{8})$/] } }; and in main file import { andorra } from "../lib/jsvatCustom/checkNIFAndorra"; //and then: checkVAT(, [andorra])

What i am doing wrong?? I think it doesnt pass the right country to de checker

javi-p-nt commented 4 years ago

Sorry, I had a problem with the regex.