@devoxs/ati-doc-validator
v2.1.0
Published
Libreria de validacion de documentos oficiales del Ecuador
Downloads
25
Maintainers
Readme
Ati doc validator
Libreria para validacion de documentos de Ecuador
Installation
npm i -g npm
npm i @devoxs/ati-doc-validator
Note: add --save if you are using npm < 5.0.0
Usage
import {AtiDocumentValidator} from '@devoxs/ati-doc-validator';
const instaceValidator = new AtiDocumentValidator();
const documentToValidate = '1234567890';
/**
* valResult contains:
* - a flag result -> true if document number is valid
* - a message in case of validation results false
**/
const valResult = instaceValidator.cedulaValidator(documentToValidate);
// for RUC validator
const valResult1 = instaceValidator.rucValidator(documentToValidate);
References
RUC format: https://www.sri.gob.ec/web/guest/RUC#:~:text=Est%C3%A1%20conformado%20por%2013%20d%C3%ADgitos,emite%20el%20n%C3%BAmero%20de%20RUC.