@@ -4,24 +4,28 @@ This package offers a simple and efficient way to validate Dominican Republic ID
44
55# Installation
66
7- you can install the package using:
7+ You can install the package using:
88
99``` sh
1010npm install do-validator
1111```
1212
1313# Use
1414
15- ``` sh
16- import { documentValidator } from ' do-validator' ;
15+ ``` ts
16+ import { documentValidator , electoralRollValidation } from ' do-validator' ;
17+
18+ const document = ' 10000000001' ;
1719
18- const validation = documentValidator(' 12345678901 ' );
20+ console . log ( documentValidator (document ) );
1921
20- console.log(validation);
22+ const validation = async () => console .log (await electoralRollValidation (document ));
23+
24+ validation ();
2125```
2226# API
23- ` ` ` sh
24- documentValidator(document)
27+ ``` ts
28+ documentValidator (document ) // Faster
2529```
2630
2731Validates a Dominican identity card number.
@@ -31,9 +35,29 @@ document (string): The identity card number to validate 11 characters without sp
3135
3236### Return
3337boolean: true if the ID number is valid, false otherwise.
38+ <hr >
3439
35- # Example
36- ` ` ` sh
40+ ``` ts
41+ // validation by API Call
42+ await electoralRollValidation (document )
43+ ```
44+ Validates a Dominican identity card number by an API Call in the Electoral roll.
45+
46+ ### Parameters
47+ document (string): The identity card number to validate 11 characters without special characters.
48+
49+ ### Return
50+ ``` ts
51+ {
52+ statusCode : number ,
53+ valid : boolean ,
54+ message : string
55+ }
56+ ```
57+
58+
59+ # Examples
60+ ``` ts
3761import { documentValidator } from ' do-validator' ;
3862
3963const validId = ' YOUR_DOMINICAN_DOCUMENT' ;
@@ -42,6 +66,19 @@ const invalidId = '12345678901';
4266console .log (documentValidator (validId )); // true
4367console .log (documentValidator (invalidId )); // false
4468
69+ ```
70+
71+ ``` ts
72+ import { electoralRollValidation } from ' do-validator' ;
73+
74+ const validId = ' YOUR_DOMINICAN_DOCUMENT' ;
75+ const invalidId = ' 12345678901' ;
76+
77+ const validation = async (document ) => console .log (await electoralRollValidation (document ));
78+
79+ validation (validId ); // valid json response
80+ validation (invalidId ) // invalid json response
81+
4582```
4683# Author
4784DevKevs
0 commit comments