lucavandro / CodiceFiscaleJS

CodiceFiscale.js is a utility library to compute and validate Italian Tax code (codice fiscale).
Creative Commons Attribution Share Alike 4.0 International
197 stars 77 forks source link

Check Fiscal Code #71

Closed adilorenzodema closed 2 years ago

adilorenzodema commented 2 years ago

Hi! How I can verify, in typescript, if a fiscal code is valid or invalid? Hi try with 'try catch', do you known a better method?

try { cf = new CodiceFiscale(control.value); return true; } catch (error) { return false }

lucavandro commented 2 years ago

Hi! CodiceFiscale.check(control.value) this will return a boolean