@yext/phonenumber-util 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/pre-commit +1 -1
- package/README.md +12 -1
- package/package.json +6 -6
- package/src/areaCodeList.js +2 -0
- package/src/phoneCodes.js +2 -0
package/.husky/pre-commit
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
Utility for extracting and validating phone numbers. Extracts an array of phone numbers from an inputted string, validates that these numbers appear genuine and provide data about those phone numbers.
|
|
2
2
|
|
|
3
|
-
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
3
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
4
|
+
[](https://www.npmjs.com/package/@yext/phonenumber-util)
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
4
9
|
|
|
5
10
|
### Scripts
|
|
6
11
|
|
|
@@ -38,6 +43,12 @@ npx vitest run --coverage
|
|
|
38
43
|
|
|
39
44
|
The returned object will include a `rawNumber` value. This value is the return of the exact value passed to the function. No sanitization occurs with this value. If you reference this number, ensure you sanitize it _BEFORE_ passing to this function.
|
|
40
45
|
|
|
46
|
+
### Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm i @yext/phonenumber-util --save
|
|
50
|
+
```
|
|
51
|
+
|
|
41
52
|
### Usage
|
|
42
53
|
|
|
43
54
|
There is additional functionality exposed as `export`, but the primary expected use case is:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yext/phonenumber-util",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"author": "bajohnson@hearsaycorp.com",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"description": "Utility for extracting and validating phone numbers",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@eslint/js": "^9.7.0",
|
|
29
|
-
"@vitest/coverage-v8": "^2.1.
|
|
30
|
-
"eslint": "^9.
|
|
29
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
30
|
+
"eslint": "^9.17.0",
|
|
31
31
|
"generate-license-file": "^3.6.0",
|
|
32
|
-
"globals": "^15.
|
|
32
|
+
"globals": "^15.14.0",
|
|
33
33
|
"husky": "^9.1.7",
|
|
34
34
|
"istanbul-badges-readme": "^1.9.0",
|
|
35
|
-
"lint-staged": "^15.2.
|
|
36
|
-
"prettier": "^3.
|
|
35
|
+
"lint-staged": "^15.2.11",
|
|
36
|
+
"prettier": "^3.4.2",
|
|
37
37
|
"vitest": "^2.1.1"
|
|
38
38
|
},
|
|
39
39
|
"eslintConfig": {},
|
package/src/areaCodeList.js
CHANGED
package/src/phoneCodes.js
CHANGED
|
@@ -6,6 +6,7 @@ export const AREA_CODES = {
|
|
|
6
6
|
// Toll Free / Not Geographic
|
|
7
7
|
800: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
8
8
|
833: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
9
|
+
844: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
9
10
|
888: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
10
11
|
877: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
11
12
|
866: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
@@ -156,6 +157,7 @@ export const AREA_CODES = {
|
|
|
156
157
|
504: { name: 'Louisiana', code: 'LA', region: UNITED_STATES },
|
|
157
158
|
985: { name: 'Louisiana', code: 'LA', region: UNITED_STATES },
|
|
158
159
|
207: { name: 'Maine', code: 'ME', region: UNITED_STATES },
|
|
160
|
+
227: { name: 'Maryland', code: 'MD', region: UNITED_STATES },
|
|
159
161
|
240: { name: 'Maryland', code: 'MD', region: UNITED_STATES },
|
|
160
162
|
301: { name: 'Maryland', code: 'MD', region: UNITED_STATES },
|
|
161
163
|
410: { name: 'Maryland', code: 'MD', region: UNITED_STATES },
|