@yext/phonenumber-util 0.2.6 → 0.2.7
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/package.json +7 -7
- package/src/areaCodeList.js +57 -0
- package/src/compliance.js +1 -0
- package/src/phoneCodes.js +189 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yext/phonenumber-util",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"author": "bajohnson@hearsaycorp.com",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"description": "Utility for extracting and validating phone numbers",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"make-badges": "istanbul-badges-readme"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@eslint/js": "^9.
|
|
29
|
-
"@vitest/coverage-v8": "^3.0.
|
|
30
|
-
"eslint": "^9.
|
|
31
|
-
"generate-license-file": "
|
|
28
|
+
"@eslint/js": "^9.22.0",
|
|
29
|
+
"@vitest/coverage-v8": "^3.0.9",
|
|
30
|
+
"eslint": "^9.22.0",
|
|
31
|
+
"generate-license-file": "4.0.0",
|
|
32
32
|
"globals": "^16.0.0",
|
|
33
33
|
"husky": "^9.1.7",
|
|
34
34
|
"istanbul-badges-readme": "^1.9.0",
|
|
35
|
-
"lint-staged": "^15.
|
|
35
|
+
"lint-staged": "^15.5.0",
|
|
36
36
|
"prettier": "^3.5.3",
|
|
37
|
-
"vitest": "^3.0.
|
|
37
|
+
"vitest": "^3.0.9"
|
|
38
38
|
},
|
|
39
39
|
"eslintConfig": {},
|
|
40
40
|
"lint-staged": {
|
package/src/areaCodeList.js
CHANGED
|
@@ -81,6 +81,7 @@ export const AREA_CODE_LIST = [
|
|
|
81
81
|
'323',
|
|
82
82
|
'325',
|
|
83
83
|
'326',
|
|
84
|
+
'329',
|
|
84
85
|
'330',
|
|
85
86
|
'331',
|
|
86
87
|
'332',
|
|
@@ -159,6 +160,7 @@ export const AREA_CODE_LIST = [
|
|
|
159
160
|
'480',
|
|
160
161
|
'483',
|
|
161
162
|
'484',
|
|
163
|
+
'500',
|
|
162
164
|
'501',
|
|
163
165
|
'502',
|
|
164
166
|
'503',
|
|
@@ -178,27 +180,57 @@ export const AREA_CODE_LIST = [
|
|
|
178
180
|
'518',
|
|
179
181
|
'519',
|
|
180
182
|
'520',
|
|
183
|
+
'521',
|
|
184
|
+
'522',
|
|
185
|
+
'523',
|
|
186
|
+
'524',
|
|
187
|
+
'525',
|
|
188
|
+
'526',
|
|
189
|
+
'527',
|
|
190
|
+
'528',
|
|
191
|
+
'529',
|
|
181
192
|
'530',
|
|
182
193
|
'531',
|
|
194
|
+
'532',
|
|
195
|
+
'533',
|
|
183
196
|
'534',
|
|
197
|
+
'535',
|
|
198
|
+
'538',
|
|
184
199
|
'539',
|
|
185
200
|
'540',
|
|
186
201
|
'541',
|
|
202
|
+
'542',
|
|
203
|
+
'543',
|
|
204
|
+
'544',
|
|
205
|
+
'545',
|
|
206
|
+
'546',
|
|
207
|
+
'547',
|
|
187
208
|
'548',
|
|
209
|
+
'549',
|
|
210
|
+
'550',
|
|
188
211
|
'551',
|
|
212
|
+
'552',
|
|
213
|
+
'553',
|
|
214
|
+
'554',
|
|
215
|
+
'556',
|
|
189
216
|
'557',
|
|
217
|
+
'558',
|
|
190
218
|
'559',
|
|
191
219
|
'561',
|
|
192
220
|
'562',
|
|
193
221
|
'563',
|
|
194
222
|
'564',
|
|
223
|
+
'566',
|
|
195
224
|
'567',
|
|
225
|
+
'569',
|
|
196
226
|
'570',
|
|
197
227
|
'571',
|
|
198
228
|
'572',
|
|
199
229
|
'573',
|
|
200
230
|
'574',
|
|
201
231
|
'575',
|
|
232
|
+
'577',
|
|
233
|
+
'578',
|
|
202
234
|
'579',
|
|
203
235
|
'580',
|
|
204
236
|
'581',
|
|
@@ -206,6 +238,9 @@ export const AREA_CODE_LIST = [
|
|
|
206
238
|
'585',
|
|
207
239
|
'586',
|
|
208
240
|
'587',
|
|
241
|
+
'588',
|
|
242
|
+
'589',
|
|
243
|
+
'600',
|
|
209
244
|
'601',
|
|
210
245
|
'602',
|
|
211
246
|
'603',
|
|
@@ -226,21 +261,26 @@ export const AREA_CODE_LIST = [
|
|
|
226
261
|
'619',
|
|
227
262
|
'620',
|
|
228
263
|
'621',
|
|
264
|
+
'622',
|
|
229
265
|
'623',
|
|
230
266
|
'626',
|
|
231
267
|
'628',
|
|
232
268
|
'629',
|
|
233
269
|
'630',
|
|
234
270
|
'631',
|
|
271
|
+
'633',
|
|
235
272
|
'636',
|
|
236
273
|
'639',
|
|
237
274
|
'640',
|
|
238
275
|
'641',
|
|
276
|
+
'644',
|
|
277
|
+
'645',
|
|
239
278
|
'646',
|
|
240
279
|
'647',
|
|
241
280
|
'649',
|
|
242
281
|
'650',
|
|
243
282
|
'651',
|
|
283
|
+
'655',
|
|
244
284
|
'656',
|
|
245
285
|
'657',
|
|
246
286
|
'658',
|
|
@@ -254,13 +294,17 @@ export const AREA_CODE_LIST = [
|
|
|
254
294
|
'670',
|
|
255
295
|
'671',
|
|
256
296
|
'672',
|
|
297
|
+
'677',
|
|
257
298
|
'678',
|
|
258
299
|
'679',
|
|
259
300
|
'680',
|
|
260
301
|
'681',
|
|
261
302
|
'682',
|
|
262
303
|
'684',
|
|
304
|
+
'686',
|
|
305
|
+
'688',
|
|
263
306
|
'689',
|
|
307
|
+
'700',
|
|
264
308
|
'701',
|
|
265
309
|
'702',
|
|
266
310
|
'703',
|
|
@@ -270,6 +314,7 @@ export const AREA_CODE_LIST = [
|
|
|
270
314
|
'707',
|
|
271
315
|
'708',
|
|
272
316
|
'709',
|
|
317
|
+
'710',
|
|
273
318
|
'712',
|
|
274
319
|
'713',
|
|
275
320
|
'714',
|
|
@@ -286,6 +331,7 @@ export const AREA_CODE_LIST = [
|
|
|
286
331
|
'727',
|
|
287
332
|
'728',
|
|
288
333
|
'729',
|
|
334
|
+
'730',
|
|
289
335
|
'731',
|
|
290
336
|
'732',
|
|
291
337
|
'734',
|
|
@@ -340,6 +386,7 @@ export const AREA_CODE_LIST = [
|
|
|
340
386
|
'818',
|
|
341
387
|
'819',
|
|
342
388
|
'820',
|
|
389
|
+
'822',
|
|
343
390
|
'825',
|
|
344
391
|
'826',
|
|
345
392
|
'828',
|
|
@@ -381,7 +428,17 @@ export const AREA_CODE_LIST = [
|
|
|
381
428
|
'876',
|
|
382
429
|
'877',
|
|
383
430
|
'878',
|
|
431
|
+
'880',
|
|
432
|
+
'881',
|
|
433
|
+
'882',
|
|
434
|
+
'883',
|
|
435
|
+
'884',
|
|
436
|
+
'885',
|
|
437
|
+
'886',
|
|
438
|
+
'887',
|
|
384
439
|
'888',
|
|
440
|
+
'889',
|
|
441
|
+
'900',
|
|
385
442
|
'901',
|
|
386
443
|
'902',
|
|
387
444
|
'903',
|
package/src/compliance.js
CHANGED
|
@@ -17,6 +17,7 @@ export const CRTC_QUIET_HOURS = {
|
|
|
17
17
|
|
|
18
18
|
// The strings of CRTC_STATES must match the `name` field found within AREA_CODES object in phoneCodes.js.
|
|
19
19
|
export const CRTC_STATES = [
|
|
20
|
+
'Canadian Special Services',
|
|
20
21
|
'Alberta',
|
|
21
22
|
'British Columbia',
|
|
22
23
|
'Manitoba',
|
package/src/phoneCodes.js
CHANGED
|
@@ -5,12 +5,194 @@ const CANADA = { name: 'Canada', code: 'CA', flag: '🇨🇦' };
|
|
|
5
5
|
export const AREA_CODES = {
|
|
6
6
|
// Toll Free / Not Geographic
|
|
7
7
|
800: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
8
|
+
822: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
8
9
|
833: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
9
10
|
844: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
10
|
-
888: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
11
|
-
877: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
12
|
-
866: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
13
11
|
855: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
12
|
+
866: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
13
|
+
877: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
14
|
+
880: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
15
|
+
881: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
16
|
+
882: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
17
|
+
883: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
18
|
+
884: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
19
|
+
885: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
20
|
+
886: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
21
|
+
887: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
22
|
+
888: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
23
|
+
889: { name: 'Toll-free', region: { name: 'United States', code: 'US' } },
|
|
24
|
+
900: {
|
|
25
|
+
name: 'Premium Call Services',
|
|
26
|
+
region: { name: 'United States', code: 'US' },
|
|
27
|
+
},
|
|
28
|
+
500: {
|
|
29
|
+
name: 'Personal Communication Service',
|
|
30
|
+
region: { name: 'United States', code: 'US' },
|
|
31
|
+
},
|
|
32
|
+
521: {
|
|
33
|
+
name: 'Personal Communication Service',
|
|
34
|
+
region: { name: 'United States', code: 'US' },
|
|
35
|
+
},
|
|
36
|
+
522: {
|
|
37
|
+
name: 'Personal Communication Service',
|
|
38
|
+
region: { name: 'United States', code: 'US' },
|
|
39
|
+
},
|
|
40
|
+
523: {
|
|
41
|
+
name: 'Personal Communication Service',
|
|
42
|
+
region: { name: 'United States', code: 'US' },
|
|
43
|
+
},
|
|
44
|
+
524: {
|
|
45
|
+
name: 'Personal Communication Service',
|
|
46
|
+
region: { name: 'United States', code: 'US' },
|
|
47
|
+
},
|
|
48
|
+
525: {
|
|
49
|
+
name: 'Personal Communication Service',
|
|
50
|
+
region: { name: 'United States', code: 'US' },
|
|
51
|
+
},
|
|
52
|
+
526: {
|
|
53
|
+
name: 'Personal Communication Service',
|
|
54
|
+
region: { name: 'United States', code: 'US' },
|
|
55
|
+
},
|
|
56
|
+
527: {
|
|
57
|
+
name: 'Personal Communication Service',
|
|
58
|
+
region: { name: 'United States', code: 'US' },
|
|
59
|
+
},
|
|
60
|
+
528: {
|
|
61
|
+
name: 'Personal Communication Service',
|
|
62
|
+
region: { name: 'United States', code: 'US' },
|
|
63
|
+
},
|
|
64
|
+
529: {
|
|
65
|
+
name: 'Personal Communication Service',
|
|
66
|
+
region: { name: 'United States', code: 'US' },
|
|
67
|
+
},
|
|
68
|
+
532: {
|
|
69
|
+
name: 'Personal Communication Service',
|
|
70
|
+
region: { name: 'United States', code: 'US' },
|
|
71
|
+
},
|
|
72
|
+
533: {
|
|
73
|
+
name: 'Personal Communication Service',
|
|
74
|
+
region: { name: 'United States', code: 'US' },
|
|
75
|
+
},
|
|
76
|
+
535: {
|
|
77
|
+
name: 'Personal Communication Service',
|
|
78
|
+
region: { name: 'United States', code: 'US' },
|
|
79
|
+
},
|
|
80
|
+
538: {
|
|
81
|
+
name: 'Personal Communication Service',
|
|
82
|
+
region: { name: 'United States', code: 'US' },
|
|
83
|
+
},
|
|
84
|
+
542: {
|
|
85
|
+
name: 'Personal Communication Service',
|
|
86
|
+
region: { name: 'United States', code: 'US' },
|
|
87
|
+
},
|
|
88
|
+
543: {
|
|
89
|
+
name: 'Personal Communication Service',
|
|
90
|
+
region: { name: 'United States', code: 'US' },
|
|
91
|
+
},
|
|
92
|
+
544: {
|
|
93
|
+
name: 'Personal Communication Service',
|
|
94
|
+
region: { name: 'United States', code: 'US' },
|
|
95
|
+
},
|
|
96
|
+
545: {
|
|
97
|
+
name: 'Personal Communication Service',
|
|
98
|
+
region: { name: 'United States', code: 'US' },
|
|
99
|
+
},
|
|
100
|
+
546: {
|
|
101
|
+
name: 'Personal Communication Service',
|
|
102
|
+
region: { name: 'United States', code: 'US' },
|
|
103
|
+
},
|
|
104
|
+
547: {
|
|
105
|
+
name: 'Personal Communication Service',
|
|
106
|
+
region: { name: 'United States', code: 'US' },
|
|
107
|
+
},
|
|
108
|
+
549: {
|
|
109
|
+
name: 'Personal Communication Service',
|
|
110
|
+
region: { name: 'United States', code: 'US' },
|
|
111
|
+
},
|
|
112
|
+
550: {
|
|
113
|
+
name: 'Personal Communication Service',
|
|
114
|
+
region: { name: 'United States', code: 'US' },
|
|
115
|
+
},
|
|
116
|
+
552: {
|
|
117
|
+
name: 'Personal Communication Service',
|
|
118
|
+
region: { name: 'United States', code: 'US' },
|
|
119
|
+
},
|
|
120
|
+
553: {
|
|
121
|
+
name: 'Personal Communication Service',
|
|
122
|
+
region: { name: 'United States', code: 'US' },
|
|
123
|
+
},
|
|
124
|
+
554: {
|
|
125
|
+
name: 'Personal Communication Service',
|
|
126
|
+
region: { name: 'United States', code: 'US' },
|
|
127
|
+
},
|
|
128
|
+
556: {
|
|
129
|
+
name: 'Personal Communication Service',
|
|
130
|
+
region: { name: 'United States', code: 'US' },
|
|
131
|
+
},
|
|
132
|
+
558: {
|
|
133
|
+
name: 'Personal Communication Service',
|
|
134
|
+
region: { name: 'United States', code: 'US' },
|
|
135
|
+
},
|
|
136
|
+
566: {
|
|
137
|
+
name: 'Personal Communication Service',
|
|
138
|
+
region: { name: 'United States', code: 'US' },
|
|
139
|
+
},
|
|
140
|
+
569: {
|
|
141
|
+
name: 'Personal Communication Service',
|
|
142
|
+
region: { name: 'United States', code: 'US' },
|
|
143
|
+
},
|
|
144
|
+
577: {
|
|
145
|
+
name: 'Personal Communication Service',
|
|
146
|
+
region: { name: 'United States', code: 'US' },
|
|
147
|
+
},
|
|
148
|
+
578: {
|
|
149
|
+
name: 'Personal Communication Service',
|
|
150
|
+
region: { name: 'United States', code: 'US' },
|
|
151
|
+
},
|
|
152
|
+
588: {
|
|
153
|
+
name: 'Personal Communication Service',
|
|
154
|
+
region: { name: 'United States', code: 'US' },
|
|
155
|
+
},
|
|
156
|
+
589: {
|
|
157
|
+
name: 'Personal Communication Service',
|
|
158
|
+
region: { name: 'United States', code: 'US' },
|
|
159
|
+
},
|
|
160
|
+
600: {
|
|
161
|
+
name: 'Canadian Special Services',
|
|
162
|
+
region: { name: 'Canada', code: 'CA' },
|
|
163
|
+
},
|
|
164
|
+
622: {
|
|
165
|
+
name: 'Canadian Special Services',
|
|
166
|
+
region: { name: 'Canada', code: 'CA' },
|
|
167
|
+
},
|
|
168
|
+
633: {
|
|
169
|
+
name: 'Canadian Special Services',
|
|
170
|
+
region: { name: 'Canada', code: 'CA' },
|
|
171
|
+
},
|
|
172
|
+
644: {
|
|
173
|
+
name: 'Canadian Special Services',
|
|
174
|
+
region: { name: 'Canada', code: 'CA' },
|
|
175
|
+
},
|
|
176
|
+
655: {
|
|
177
|
+
name: 'Canadian Special Services',
|
|
178
|
+
region: { name: 'Canada', code: 'CA' },
|
|
179
|
+
},
|
|
180
|
+
677: {
|
|
181
|
+
name: 'Canadian Special Services',
|
|
182
|
+
region: { name: 'Canada', code: 'CA' },
|
|
183
|
+
},
|
|
184
|
+
688: {
|
|
185
|
+
name: 'Canadian Special Services',
|
|
186
|
+
region: { name: 'Canada', code: 'CA' },
|
|
187
|
+
},
|
|
188
|
+
700: {
|
|
189
|
+
name: 'Interexchange carrier-specific services',
|
|
190
|
+
region: { name: 'United States', code: 'US' },
|
|
191
|
+
},
|
|
192
|
+
710: {
|
|
193
|
+
name: 'US Government Special Services',
|
|
194
|
+
region: { name: 'United States', code: 'US' },
|
|
195
|
+
},
|
|
14
196
|
// US Numbers
|
|
15
197
|
205: { name: 'Alabama', code: 'AL', region: UNITED_STATES },
|
|
16
198
|
251: { name: 'Alabama', code: 'AL', region: UNITED_STATES },
|
|
@@ -88,6 +270,7 @@ export const AREA_CODES = {
|
|
|
88
270
|
407: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
89
271
|
448: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
90
272
|
561: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
273
|
+
645: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
91
274
|
656: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
92
275
|
689: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
93
276
|
727: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
@@ -124,6 +307,7 @@ export const AREA_CODES = {
|
|
|
124
307
|
618: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
125
308
|
630: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
126
309
|
708: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
310
|
+
730: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
127
311
|
773: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
128
312
|
779: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
129
313
|
815: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
@@ -227,6 +411,7 @@ export const AREA_CODES = {
|
|
|
227
411
|
575: { name: 'New Mexico', code: 'NM', region: UNITED_STATES },
|
|
228
412
|
212: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
229
413
|
315: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
414
|
+
329: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
230
415
|
332: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
231
416
|
347: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
232
417
|
363: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
@@ -346,6 +531,7 @@ export const AREA_CODES = {
|
|
|
346
531
|
434: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
347
532
|
540: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
348
533
|
571: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
534
|
+
686: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
349
535
|
703: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
350
536
|
757: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
351
537
|
804: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|