Skip to content

Commit aa8b526

Browse files
committed
Initial commit.
0 parents  commit aa8b526

File tree

11 files changed

+1957
-0
lines changed

11 files changed

+1957
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{json,gitignore}]
15+
insert_final_newline = false

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "airbnb-base"
3+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Jeff Mosawy
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# IRCHECK
2+
IRCHECK is a Node.js validation library developed for Iranian developers in order to help them to do some validations on their specific national data.
3+
4+
## Install & Usage
5+
You can install the package via the following command:
6+
`npm install ircheck`
7+
8+
### Usage
9+
First you need to import the package:
10+
```javascript
11+
const IRCheck = require('ircheck');
12+
```
13+
14+
Then you can use the available methods for different available validators:
15+
```javascript
16+
IRCheck.Phone.checkType('02191001848'); //returns 'LANDLINE'
17+
IRCheck.Phone.normalizeMobile('+989121234567'); // returns '91234567'
18+
```
19+
20+
## Validators Availability
21+
Currently, the following validators are available:
22+
* [Iranian Phone Numbers](#phone)
23+
24+
### Phone
25+
Here’s a list of available methods:
26+
* `checkType(number)` Check whether if a number is a type of mobile or landline
27+
* `isMobile(number)` Verify the input number is a type of mobile
28+
* `isLandline(number)` Verify the input number is a type of landline
29+
* `normalizeMobile(number)` Normalize a mobile number as 9121234567
30+
* `normalizeLandline(number)` Normalize a landline number as 2191001848
31+
* `getProvinceData(number)` Get province info from its area code or code name
32+
* `getProvincesFromLandline(number)` Extract province data from a landline numbers
33+
34+
## History
35+
### 0.1.0
36+
* Initial release
37+
38+
## Contribution
39+
Any contribution is much appreciated. Make sure that you write and run tests before submitting PR.
40+
41+
## License
42+
MIT licensed
43+
Copyright (C) 2017 Jeff Mosawy, [http://jmosawy.com](http://jmosawy.com)

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const Phone = require('./phone');
2+
3+
const Verifier = function () {};
4+
5+
Verifier.prototype.Phone = Phone;
6+
7+
module.exports = new Verifier();

0 commit comments

Comments
 (0)