@yext/phonenumber-util 0.2.4 → 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/README.md +1 -1
- package/package.json +9 -9
- package/src/areaCodeList.js +58 -0
- package/src/compliance.js +1 -0
- package/src/phoneCodes.js +190 -3
package/README.md
CHANGED
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": "^
|
|
30
|
-
"eslint": "^9.
|
|
31
|
-
"generate-license-file": "
|
|
32
|
-
"globals": "^
|
|
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
|
+
"globals": "^16.0.0",
|
|
33
33
|
"husky": "^9.1.7",
|
|
34
34
|
"istanbul-badges-readme": "^1.9.0",
|
|
35
|
-
"lint-staged": "^15.
|
|
36
|
-
"prettier": "^3.
|
|
37
|
-
"vitest": "^
|
|
35
|
+
"lint-staged": "^15.5.0",
|
|
36
|
+
"prettier": "^3.5.3",
|
|
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',
|
|
@@ -103,6 +104,7 @@ export const AREA_CODE_LIST = [
|
|
|
103
104
|
'363',
|
|
104
105
|
'364',
|
|
105
106
|
'365',
|
|
107
|
+
'369',
|
|
106
108
|
'380',
|
|
107
109
|
'385',
|
|
108
110
|
'386',
|
|
@@ -158,6 +160,7 @@ export const AREA_CODE_LIST = [
|
|
|
158
160
|
'480',
|
|
159
161
|
'483',
|
|
160
162
|
'484',
|
|
163
|
+
'500',
|
|
161
164
|
'501',
|
|
162
165
|
'502',
|
|
163
166
|
'503',
|
|
@@ -177,27 +180,57 @@ export const AREA_CODE_LIST = [
|
|
|
177
180
|
'518',
|
|
178
181
|
'519',
|
|
179
182
|
'520',
|
|
183
|
+
'521',
|
|
184
|
+
'522',
|
|
185
|
+
'523',
|
|
186
|
+
'524',
|
|
187
|
+
'525',
|
|
188
|
+
'526',
|
|
189
|
+
'527',
|
|
190
|
+
'528',
|
|
191
|
+
'529',
|
|
180
192
|
'530',
|
|
181
193
|
'531',
|
|
194
|
+
'532',
|
|
195
|
+
'533',
|
|
182
196
|
'534',
|
|
197
|
+
'535',
|
|
198
|
+
'538',
|
|
183
199
|
'539',
|
|
184
200
|
'540',
|
|
185
201
|
'541',
|
|
202
|
+
'542',
|
|
203
|
+
'543',
|
|
204
|
+
'544',
|
|
205
|
+
'545',
|
|
206
|
+
'546',
|
|
207
|
+
'547',
|
|
186
208
|
'548',
|
|
209
|
+
'549',
|
|
210
|
+
'550',
|
|
187
211
|
'551',
|
|
212
|
+
'552',
|
|
213
|
+
'553',
|
|
214
|
+
'554',
|
|
215
|
+
'556',
|
|
188
216
|
'557',
|
|
217
|
+
'558',
|
|
189
218
|
'559',
|
|
190
219
|
'561',
|
|
191
220
|
'562',
|
|
192
221
|
'563',
|
|
193
222
|
'564',
|
|
223
|
+
'566',
|
|
194
224
|
'567',
|
|
225
|
+
'569',
|
|
195
226
|
'570',
|
|
196
227
|
'571',
|
|
197
228
|
'572',
|
|
198
229
|
'573',
|
|
199
230
|
'574',
|
|
200
231
|
'575',
|
|
232
|
+
'577',
|
|
233
|
+
'578',
|
|
201
234
|
'579',
|
|
202
235
|
'580',
|
|
203
236
|
'581',
|
|
@@ -205,6 +238,9 @@ export const AREA_CODE_LIST = [
|
|
|
205
238
|
'585',
|
|
206
239
|
'586',
|
|
207
240
|
'587',
|
|
241
|
+
'588',
|
|
242
|
+
'589',
|
|
243
|
+
'600',
|
|
208
244
|
'601',
|
|
209
245
|
'602',
|
|
210
246
|
'603',
|
|
@@ -225,21 +261,26 @@ export const AREA_CODE_LIST = [
|
|
|
225
261
|
'619',
|
|
226
262
|
'620',
|
|
227
263
|
'621',
|
|
264
|
+
'622',
|
|
228
265
|
'623',
|
|
229
266
|
'626',
|
|
230
267
|
'628',
|
|
231
268
|
'629',
|
|
232
269
|
'630',
|
|
233
270
|
'631',
|
|
271
|
+
'633',
|
|
234
272
|
'636',
|
|
235
273
|
'639',
|
|
236
274
|
'640',
|
|
237
275
|
'641',
|
|
276
|
+
'644',
|
|
277
|
+
'645',
|
|
238
278
|
'646',
|
|
239
279
|
'647',
|
|
240
280
|
'649',
|
|
241
281
|
'650',
|
|
242
282
|
'651',
|
|
283
|
+
'655',
|
|
243
284
|
'656',
|
|
244
285
|
'657',
|
|
245
286
|
'658',
|
|
@@ -253,13 +294,17 @@ export const AREA_CODE_LIST = [
|
|
|
253
294
|
'670',
|
|
254
295
|
'671',
|
|
255
296
|
'672',
|
|
297
|
+
'677',
|
|
256
298
|
'678',
|
|
257
299
|
'679',
|
|
258
300
|
'680',
|
|
259
301
|
'681',
|
|
260
302
|
'682',
|
|
261
303
|
'684',
|
|
304
|
+
'686',
|
|
305
|
+
'688',
|
|
262
306
|
'689',
|
|
307
|
+
'700',
|
|
263
308
|
'701',
|
|
264
309
|
'702',
|
|
265
310
|
'703',
|
|
@@ -269,6 +314,7 @@ export const AREA_CODE_LIST = [
|
|
|
269
314
|
'707',
|
|
270
315
|
'708',
|
|
271
316
|
'709',
|
|
317
|
+
'710',
|
|
272
318
|
'712',
|
|
273
319
|
'713',
|
|
274
320
|
'714',
|
|
@@ -285,6 +331,7 @@ export const AREA_CODE_LIST = [
|
|
|
285
331
|
'727',
|
|
286
332
|
'728',
|
|
287
333
|
'729',
|
|
334
|
+
'730',
|
|
288
335
|
'731',
|
|
289
336
|
'732',
|
|
290
337
|
'734',
|
|
@@ -339,6 +386,7 @@ export const AREA_CODE_LIST = [
|
|
|
339
386
|
'818',
|
|
340
387
|
'819',
|
|
341
388
|
'820',
|
|
389
|
+
'822',
|
|
342
390
|
'825',
|
|
343
391
|
'826',
|
|
344
392
|
'828',
|
|
@@ -380,7 +428,17 @@ export const AREA_CODE_LIST = [
|
|
|
380
428
|
'876',
|
|
381
429
|
'877',
|
|
382
430
|
'878',
|
|
431
|
+
'880',
|
|
432
|
+
'881',
|
|
433
|
+
'882',
|
|
434
|
+
'883',
|
|
435
|
+
'884',
|
|
436
|
+
'885',
|
|
437
|
+
'886',
|
|
438
|
+
'887',
|
|
383
439
|
'888',
|
|
440
|
+
'889',
|
|
441
|
+
'900',
|
|
384
442
|
'901',
|
|
385
443
|
'902',
|
|
386
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 },
|
|
@@ -36,6 +218,7 @@ export const AREA_CODES = {
|
|
|
36
218
|
341: { name: 'California', code: 'CA', region: UNITED_STATES },
|
|
37
219
|
350: { name: 'California', code: 'CA', region: UNITED_STATES },
|
|
38
220
|
357: { name: 'California', code: 'CA', region: UNITED_STATES },
|
|
221
|
+
369: { name: 'California', code: 'CA', region: UNITED_STATES },
|
|
39
222
|
408: { name: 'California', code: 'CA', region: UNITED_STATES },
|
|
40
223
|
415: { name: 'California', code: 'CA', region: UNITED_STATES },
|
|
41
224
|
424: { name: 'California', code: 'CA', region: UNITED_STATES },
|
|
@@ -87,6 +270,7 @@ export const AREA_CODES = {
|
|
|
87
270
|
407: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
88
271
|
448: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
89
272
|
561: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
273
|
+
645: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
90
274
|
656: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
91
275
|
689: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
92
276
|
727: { name: 'Florida', code: 'FL', region: UNITED_STATES },
|
|
@@ -123,6 +307,7 @@ export const AREA_CODES = {
|
|
|
123
307
|
618: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
124
308
|
630: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
125
309
|
708: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
310
|
+
730: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
126
311
|
773: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
127
312
|
779: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
128
313
|
815: { name: 'Illinois', code: 'IL', region: UNITED_STATES },
|
|
@@ -226,6 +411,7 @@ export const AREA_CODES = {
|
|
|
226
411
|
575: { name: 'New Mexico', code: 'NM', region: UNITED_STATES },
|
|
227
412
|
212: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
228
413
|
315: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
414
|
+
329: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
229
415
|
332: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
230
416
|
347: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
231
417
|
363: { name: 'New York', code: 'NY', region: UNITED_STATES },
|
|
@@ -345,6 +531,7 @@ export const AREA_CODES = {
|
|
|
345
531
|
434: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
346
532
|
540: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
347
533
|
571: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
534
|
+
686: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
348
535
|
703: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
349
536
|
757: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|
|
350
537
|
804: { name: 'Virginia', code: 'VA', region: UNITED_STATES },
|