Skip to content

Utilidades para validar documentos salvadoreños 🇸🇻

License

Notifications You must be signed in to change notification settings

alepaz/sivar-utils

 
 

Repository files navigation

sivar-utils 🇸🇻

TS/JS utils para el desarrollo de sistemas salvadoreños (Validacion de docs DUI, NIT, etc...)

Version Build Install Size Downloads PRs Welcome Commitizen friendly MIT License

All Contributors

Watch on GitHub Star on GitHub Tweet

Getting Started

Installation

npm install --save sivar-utils

Usage

  • isDUI

import { isDUI } from 'sivar-utils';

const str = 'test';
const fakeDUI = '00000000-0';
const validDUI = '02495046-3'; // DISCLAIMER: taken from Google

isDUI(str); // false
isDUI(fakeDUI); // false
isDUI(validDUI); // true
  • isNIT

import { isNIT } from 'sivar-utils';

const str = 'test';
const fakeNIT = '0000-000000-000-0';
const validNIT = '0614-051286-129-4'; // DISCLAIMER: taken from Google

isNIT(str); // false
isNIT(fakeNIT); // false
isNIT(validNIT); // true
  • isMobilePhoneNumber

import { isMobilePhoneNumber } from 'sivar-utils';

const str = 'test';
const fakeMobilePhone = '9999-9999';
const validMobilePhone = '7071-1244'; // DISCLAIMER: taken from Google

isMobilePhoneNumber(str); // false
isMobilePhoneNumber(fakeMobilePhone); // false
isMobilePhoneNumber(validMobilePhone); // true
  • isResidentialPhoneNumber

import { isResidentialPhoneNumber } from 'sivar-utils';

const str = 'test';
const fakeResidentialPhone = '5555-5555';
const validResidentialPhone = '2244-4777'; // DISCLAIMER: taken from Google

isResidentialPhoneNumber(str); // false
isResidentialPhoneNumber(fakeResidentialPhone); // false
isResidentialPhoneNumber(validResidentialPhone); // true
  • isPhoneNumber

import { isPhoneNumber } from 'sivar-utils';

const str = 'test';
const fakePhone = '1234-5678';
const validPhone = '2591-3000'; /* or '7725-4747' */ // DISCLAIMER: taken from Google

isPhoneNumber(str); // false
isPhoneNumber(fakePhone); // false
isPhoneNumber(validPhone); // true

Contributing

How to contribute?

This is a commitizen friendly repository, so instead of creating commits using git commit, please use our custom CLI by running:

npm run cz

Formatting & Linting

Make sure you have installed the following plugins on your Code Editor

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Alejandro Paz

⚠️ 💻

Jorge Monge

💻 🐛

Ricardo Ramírez

🤔

Jaime Leonardo Suncin Cruz

💻 ⚠️ 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © jonathanpalma

About

Utilidades para validar documentos salvadoreños 🇸🇻

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.2%
  • JavaScript 4.8%