cf-it-validator
v1.0.7
Published
This package purpose is to provide a simple solution for a form validation where the user must insert his Italian Fiscal code
Downloads
18
Maintainers
Readme
CF Italy validator
This package purpose is to provide a simple solution for a form validation where the user must insert his Italian Fiscal code
How to install
run npm i cf-it-validator
inside your project
How to use
Just import the package where you need and use the validation function:
import {validateITCF} from 'cf-it-validator'
const isValid = validateITCF(fiscal_code, {name, lastname, birthdate /*use this formats: DD/MM/YY or DD/MM/YYYY*/, municipe})
for municipes the list is taken here
everything is calculated in lowercase, so no need to worry about case sensitiveness
Other info
You can check just a part of the fiscal code, for example if in the object you pass only the name and the lastname the library will check only the first six characters