pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/DevKevs/do-validator

GitHub - DevKevs/do-validator · GitHub
Skip to content

DevKevs/do-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dominican document validation

This package offers a simple and efficient way to validate Dominican Republic ID numbers. Perfect for developers who need to ensure the validity of identity documents in their applications. It checks the format and integrity of the ID number according to official rules.

Installation

You can install the package using:

npm install do-validator

Use

import { documentValidator, electoralRollValidation } from 'do-validator';

const document = '10000000001';

console.log(documentValidator(document));

const validation = async () =>  console.log(await electoralRollValidation(document));

validation();

API

documentValidator(document) //Faster

Validates a Dominican identity card number.

Parameters

document (string): The identity card number to validate 11 characters without special characters.

Return

boolean: true if the ID number is valid, false otherwise.


//validation by API Call
await electoralRollValidation(document) 

Validates a Dominican identity card number by an API Call in the Electoral roll.

Parameters

document (string): The identity card number to validate 11 characters without special characters.

Return

{
    statusCode: number,
    valid: boolean,
    message: string
}

Examples

import { documentValidator } from 'do-validator';

const validId = 'YOUR_DOMINICAN_DOCUMENT';
const invalidId = '12345678901';

console.log(documentValidator(validId));  // true
console.log(documentValidator(invalidId));  // false
import { electoralRollValidation } from 'do-validator';

const validId = 'YOUR_DOMINICAN_DOCUMENT';
const invalidId = '12345678901';

const validation = async (document) =>  console.log(await electoralRollValidation(document));

validation(validId); // valid json response
validation(invalidId) // invalid json response

Looking for Flutter / Dart version?

Also available in pub.dev, take a look!

npm

Author

DevKevs

LinkedIn X Portfolio

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy