@yext/phonenumber-util 0.1.0 → 0.1.1
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/CODEOWNERS +1 -1
- package/README.md +4 -4
- package/package.json +2 -1
- package/src/areaCodeList.js +1 -0
package/CODEOWNERS
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# The following aliases have approval permissions in this repo:
|
|
2
|
-
* @imbrianj @mi4l
|
|
2
|
+
* @imbrianj @mi4l @DerekWW
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ Returns a boolean based on whether the passed number is presumed to be valid or
|
|
|
47
47
|
This checks for region code, number length and validity of region code and area code (where applicable).
|
|
48
48
|
|
|
49
49
|
```javascript
|
|
50
|
-
import { isValidPhoneNumber } from 'phonenumber-util';
|
|
50
|
+
import { isValidPhoneNumber } from '@yext/phonenumber-util';
|
|
51
51
|
const validPhoneNumber = '3103496333';
|
|
52
52
|
isValidPhoneNumber(validPhoneNumber); // Returns `true` - "310" is an area code for California
|
|
53
53
|
|
|
@@ -66,7 +66,7 @@ isValidPhoneNumber(invalidIntlNumber); // Returns `false` - "666" is not a valid
|
|
|
66
66
|
Return an object of relevant phone number parts and information.
|
|
67
67
|
|
|
68
68
|
```javascript
|
|
69
|
-
import { getPhoneParts } from 'phonenumber-util';
|
|
69
|
+
import { getPhoneParts } from '@yext/phonenumber-util';
|
|
70
70
|
const validPhoneNumber = '3496333';
|
|
71
71
|
getPhoneParts(validPhoneNumber); // Returns an object, assumed to be US / Canada, region code "1" but no area code can be reliably determined.
|
|
72
72
|
|
|
@@ -109,7 +109,7 @@ Example for US with full area code provided ("310.349.9999"):
|
|
|
109
109
|
```javascript
|
|
110
110
|
{
|
|
111
111
|
areaCode: "310",
|
|
112
|
-
e164: "+
|
|
112
|
+
e164: "+13103499999",
|
|
113
113
|
format: "(xxx) xxx-xxxx",
|
|
114
114
|
formattedNumber: "(310) 349-9999",
|
|
115
115
|
href: "tel:+13103499999",
|
|
@@ -133,7 +133,7 @@ Example for US with full area code provided ("Hey there, my number is 310.349.99
|
|
|
133
133
|
index: 24,
|
|
134
134
|
lastIndex: 36,
|
|
135
135
|
areaCode: '310',
|
|
136
|
-
e164: '+
|
|
136
|
+
e164: '+13103499999',
|
|
137
137
|
format: '(xxx) xxx-xxxx',
|
|
138
138
|
formattedNumber: '(310) 349-9999',
|
|
139
139
|
href: 'tel:+13103499999',
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yext/phonenumber-util",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"author": "bajohnson@hearsaycorp.com",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"description": "Utility for extracting and validating phone numbers",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"types": "src/index.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
12
13
|
"url": "git+https://github.com/hearsaycorp/phonenumber-util.git"
|