UNPKG

dgii-utils

Version:

DGII-Utils es un paquete de herramientas diseñado para simplificar la interacción con las aplicaciones web de la Dirección General de Impuestos Internos (DGII) en la República Dominicana. Este paquete incluye funciones para validar formatos fiscales como

1 lines 956 B
function clearRNC(e=""){return e.replace(/\D/g,"")}function clearNCF(e=""){return e.replace(/[^BE0-9]/g,"")}function clearCarPlate(e=""){return e.replace(/[^A-Z0-9]/gi,"")}function isRNC(e=""){e=clearRNC(e);return/^[0-9]{9,11}$/.test(e)}function isENCF(e=""){e=clearNCF(e);return/^E(?:3[1-4]{1}|41|4[3-7]{1})[0-9]{10}$/.test(e)}function isNCF(e=""){e=clearNCF(e);return/^B(?:0[1-4]{1}|1[1-7]{1})[0-9]{8}$/.test(e)}function isCarPlate(e=""){clearCarPlate(e);return/^(A|AA|B|C|D|F|G|L|H|I|T|P|U|J|R|S|M|OE|OF|OM|OP|EA|EG|EL|EM|ED|EI|VC|WD|OI|EX|YX|Z|NZ|DD|PP|K)\d{4,6}$/i.test(e)}function isSecureCode(e=""){return/^[a-zA-Z0-9]{6}$/.test(e)}exports.clearRNC=clearRNC,exports.clearNCF=clearNCF,exports.clearCarPlate=clearCarPlate,exports.isRNC=isRNC,exports.isENCF=isENCF,exports.isNCF=isNCF,module.exports={clearRNC:clearRNC,clearNCF:clearNCF,clearCarPlate:clearCarPlate,isRNC:isRNC,isENCF:isENCF,isNCF:isNCF,isCarPlate:isCarPlate,isSecureCode:isSecureCode};