validate-rut-serie
v1.0.3
Published
tool to validate serie of rut, chile
Downloads
15
Maintainers
Readme
Validate rut
Tool for validate rut with document number in Chile
Starting 🚀
How to install 📋
First install with npm
npm i validate-rut-serie
Or yarn
yarn add validate-rut-serie
Using the tool ⚙️
First import the tool, then call the async method isValid, sending an object with rut and serie (without points), it will return an boolean
Example 🔩
const { isValid } = require("validate-rut-serie")
async function tellIfIsValid() {
const valid = await isValid({rut:"11.111.111-1", serie:"123456789"})
console.log(valid) // return true if is valid, or false if is invalid
}
tellIfIsValid()
Valid formats for serie
The only format is 9 numbers of the number document, without points, string format
Valid formats for rut ⌨️
// valids
('18.972.631-7')
('18972631-7')
('189726317')
('9.068.826-k')
('9068826-k')
('9068826k')
// invalids
('18.972.631-0')
('18,972,631-7')
('18*972*631-7')
('18-972-631-7')
('error18.972.631-7')
('9068826-1')
('')
(189726317)
('0')
(0)
Building with: 🛠️
Authors ✒️
- Christian Rodriguez - Inforser - crod
Licence 📄
MIT
Thanks 🎁
- Thanks for read this readme! 📢
⌨️ with ❤️ for crod-inforser 😊