fullstack-phone 1.204.0 → 1.205.0
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/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/client/index.js +3 -3
- package/package.json +2 -2
- package/server/metadata/metadata.json +19 -45
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ fullstack-phone ☎️
|
|
|
3
3
|
|
|
4
4
|
| npm | Libphonenumber version |
|
|
5
5
|
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
|
6
|
-
| [](https://www.npmjs.com/package/fullstack-phone) | [v9.0.
|
|
6
|
+
| [](https://www.npmjs.com/package/fullstack-phone) | [v9.0.33](https://github.com/googlei18n/libphonenumber/blob/master/release_notes.txt) |
|
|
7
7
|
|
|
8
8
|
**fullstack-phone** provides formatting, validation, and parsing of phone numbers per-region. The system is optimized for use as two modules:
|
|
9
9
|
|
package/client/index.js
CHANGED
|
@@ -61,9 +61,9 @@ function Ya(){return";ext="+I("20")+"|[ \u00a0\\t,]*(?:e?xt(?:ensi(?:o\u0301?|\u
|
|
|
61
61
|
var Za=new RegExp("(?:"+Ya()+")$","i"),$a=new RegExp("^[0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]{2}$|^[+\uff0b]*(?:[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e*]*[0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]){3,}[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e*A-Za-z0-9\uff10-\uff19\u0660-\u0669\u06f0-\u06f9]*(?:"+Ya()+")?$","i"),ab=/(\$\d)/,
|
|
62
62
|
bb=/^\(?\$1\)?$/;function cb(a){return 2>a.length?!1:J($a,a)}function db(a){return J(Va,a)?eb(a,Pa):eb(a,Na)}function fb(a){var b=db(a.toString());n(a);a.g(b)}function gb(){return Object.keys(Ma).filter(function(a){return isNaN(a)})}function hb(a){return null!=a&&(1!=x(a,9)||-1!=u(a,9)[0])}function eb(a,b){for(var c=new l,d,e=a.length,f=0;f<e;++f)d=a.charAt(f),d=b[d.toUpperCase()],null!=d&&c.g(d);return c.toString()}function ib(a){return 0==a.length||bb.test(a)}
|
|
63
63
|
function K(a){return null!=a&&isNaN(a)&&a.toUpperCase()in Ma}
|
|
64
|
-
function jb(a,b){var c=L;if(0==r(a,2)&&q(a,5)){var d=w(a,5);if(0<d.length)return d}d=w(a,1);
|
|
65
|
-
2==b&&null!=g&&0<g.length?e.replace(f,c.replace(ab,g)):e.replace(f,c),3==b&&(e=e.replace(RegExp("^[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]+"),""),e=e.replace(RegExp("[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]+","g"),"-")));return kb(d,b,e,a)}
|
|
66
|
-
function N(a){if(!q(a,2))return"";var b=""+r(a,2);return q(a,4)&&r(a,4)&&0<w(a,8)?Array(w(a,8)+1).join("0")+b:b}function kb(a,b,c,d){switch(b){case 0:return"+"+a+c+d;case 1:return"+"+a+" "+c+d;case 3:return"tel:+"+a+"-"+c+d;default:return c+d}}
|
|
64
|
+
function jb(a,b){var c=L;if(0==r(a,2)&&q(a,5)){var d=w(a,5);if(0<d.length&&q(a,1)&&20==r(a,6)&&0==b){var e=w(a,1);return kb(e,b,d,"")}if(0<d.length||!q(a,1))return d}d=w(a,1);e=N(a);if(0==b)return kb(d,0,e,"");if(!(d in E))return e;c=O(c,d,P(d));a=q(a,3)&&0!=r(a,3).length?3==b?";ext="+r(a,3):q(c,13)?r(c,13)+w(a,3):" ext. "+w(a,3):"";a:{c=0==u(c,20).length||2==b?u(c,19):u(c,20);for(var f,g=c.length,k=0;k<g;++k){f=c[k];var m=x(f,3);if(0==m||0==e.search(r(f,3,m-1)))if(m=new RegExp(r(f,1)),J(m,e)){c=
|
|
65
|
+
f;break a}}c=null}null!=c&&(g=c,c=w(g,2),f=new RegExp(r(g,1)),w(g,5),g=w(g,4),e=2==b&&null!=g&&0<g.length?e.replace(f,c.replace(ab,g)):e.replace(f,c),3==b&&(e=e.replace(RegExp("^[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]+"),""),e=e.replace(RegExp("[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]+","g"),"-")));return kb(d,b,e,a)}
|
|
66
|
+
function O(a,b,c){return"001"==c?Q(a,""+b):Q(a,c)}function N(a){if(!q(a,2))return"";var b=""+r(a,2);return q(a,4)&&r(a,4)&&0<w(a,8)?Array(w(a,8)+1).join("0")+b:b}function kb(a,b,c,d){switch(b){case 0:return"+"+a+c+d;case 1:return"+"+a+" "+c+d;case 3:return"tel:+"+a+"-"+c+d;default:return c+d}}
|
|
67
67
|
function lb(a,b){switch(b){case 4:return r(a,5);case 3:return r(a,4);case 1:return r(a,3);case 0:case 2:return r(a,2);case 5:return r(a,6);case 6:return r(a,8);case 7:return r(a,7);case 8:return r(a,21);case 9:return r(a,25);case 10:return r(a,28);default:return r(a,1)}}function mb(a,b){return R(a,r(b,1))?R(a,r(b,5))?4:R(a,r(b,4))?3:R(a,r(b,6))?5:R(a,r(b,8))?6:R(a,r(b,7))?7:R(a,r(b,21))?8:R(a,r(b,25))?9:R(a,r(b,28))?10:R(a,r(b,2))?r(b,18)||R(a,r(b,3))?2:0:!r(b,18)&&R(a,r(b,3))?1:-1:-1}
|
|
68
68
|
function Q(a,b){if(null==b)return null;b=b.toUpperCase();var c=a.g[b];if(null==c){c=Ma[b];if(null==c)return null;c=(new C).g(B.m(),c);a.g[b]=c}return c}function R(a,b){var c=a.length;return 0<x(b,9)&&-1==u(b,9).indexOf(c)?!1:J(w(b,2),a)}function nb(a,b,c){var d=w(b,1),e=O(a,d,c);if(null==e||"001"!=c&&d!=S(a,c))return!1;a=N(b);return-1!=mb(a,e)}
|
|
69
69
|
function ob(a,b){if(null==b)return null;var c=w(b,1);c=E[c];if(null==c)a=null;else if(1==c.length)a=c[0];else a:{b=N(b);for(var d,e=c.length,f=0;f<e;f++){d=c[f];var g=Q(a,d);if(q(g,23)){if(0==b.search(r(g,23))){a=d;break a}}else if(-1!=mb(b,g)){a=d;break a}}a=null}return a}function P(a){a=E[a];return null==a?"ZZ":a[0]}function S(a,b){a=Q(a,b);if(null==a)throw Error("Invalid region code: "+b);return w(a,10)}
|
package/package.json
CHANGED
|
@@ -4898,7 +4898,7 @@
|
|
|
4898
4898
|
[
|
|
4899
4899
|
null,
|
|
4900
4900
|
null,
|
|
4901
|
-
"2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[0179])|5(?:[34]\\d|50|6[5-
|
|
4901
|
+
"2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[0179])|5(?:[34]\\d|50|6[5-8]))\\d{4}",
|
|
4902
4902
|
null,
|
|
4903
4903
|
null,
|
|
4904
4904
|
null,
|
|
@@ -26372,7 +26372,7 @@
|
|
|
26372
26372
|
[
|
|
26373
26373
|
null,
|
|
26374
26374
|
null,
|
|
26375
|
-
"(?:1(?:0[0-8]|1\\d|2[014]|30|4[0-
|
|
26375
|
+
"(?:1(?:0[0-8]|1\\d|2[014]|30|4[0-5])|7\\d\\d)\\d{6}",
|
|
26376
26376
|
null,
|
|
26377
26377
|
null,
|
|
26378
26378
|
null,
|
|
@@ -31490,7 +31490,7 @@
|
|
|
31490
31490
|
[
|
|
31491
31491
|
null,
|
|
31492
31492
|
null,
|
|
31493
|
-
"4(?:[
|
|
31493
|
+
"4(?:[46]\\d|5[1-9])\\d{5}|(?:3|[67]\\d)\\d{7}",
|
|
31494
31494
|
null,
|
|
31495
31495
|
null,
|
|
31496
31496
|
null,
|
|
@@ -35273,16 +35273,21 @@
|
|
|
35273
35273
|
[
|
|
35274
35274
|
null,
|
|
35275
35275
|
null,
|
|
35276
|
-
"
|
|
35276
|
+
"1[2-9]\\d{5}",
|
|
35277
35277
|
null,
|
|
35278
35278
|
null,
|
|
35279
35279
|
null,
|
|
35280
|
-
"1234567"
|
|
35280
|
+
"1234567",
|
|
35281
|
+
null,
|
|
35282
|
+
null,
|
|
35283
|
+
[
|
|
35284
|
+
7
|
|
35285
|
+
]
|
|
35281
35286
|
],
|
|
35282
35287
|
[
|
|
35283
35288
|
null,
|
|
35284
35289
|
null,
|
|
35285
|
-
"111\\d{6}|(?:31|77|[89][89])\\d{7}",
|
|
35290
|
+
"111\\d{6}|(?:2[12]|31|77|[89][89])\\d{7}",
|
|
35286
35291
|
null,
|
|
35287
35292
|
null,
|
|
35288
35293
|
null,
|
|
@@ -35383,21 +35388,12 @@
|
|
|
35383
35388
|
],
|
|
35384
35389
|
"0$1"
|
|
35385
35390
|
],
|
|
35386
|
-
[
|
|
35387
|
-
null,
|
|
35388
|
-
"(\\d{3})(\\d{3})(\\d{3})",
|
|
35389
|
-
"$1 $2 $3",
|
|
35390
|
-
[
|
|
35391
|
-
"2"
|
|
35392
|
-
],
|
|
35393
|
-
"0$1"
|
|
35394
|
-
],
|
|
35395
35391
|
[
|
|
35396
35392
|
null,
|
|
35397
35393
|
"(\\d{3})(\\d{2})(\\d{2})(\\d{2})",
|
|
35398
35394
|
"$1 $2 $3 $4",
|
|
35399
35395
|
[
|
|
35400
|
-
"[
|
|
35396
|
+
"[1-37-9]"
|
|
35401
35397
|
],
|
|
35402
35398
|
"0$1"
|
|
35403
35399
|
]
|
|
@@ -37846,7 +37842,7 @@
|
|
|
37846
37842
|
[
|
|
37847
37843
|
null,
|
|
37848
37844
|
null,
|
|
37849
|
-
"(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-
|
|
37845
|
+
"(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-46-9]|7[0-8])\\d{6}",
|
|
37850
37846
|
null,
|
|
37851
37847
|
null,
|
|
37852
37848
|
null,
|
|
@@ -45021,7 +45017,7 @@
|
|
|
45021
45017
|
[
|
|
45022
45018
|
null,
|
|
45023
45019
|
null,
|
|
45024
|
-
"
|
|
45020
|
+
"80[1-9]\\d{5}|(?:8[1-9]|9[0-8])\\d{6}",
|
|
45025
45021
|
null,
|
|
45026
45022
|
null,
|
|
45027
45023
|
null,
|
|
@@ -45497,7 +45493,7 @@
|
|
|
45497
45493
|
[
|
|
45498
45494
|
null,
|
|
45499
45495
|
null,
|
|
45500
|
-
"65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[
|
|
45496
|
+
"65(?:[178]\\d|5[56]|6[01])\\d{4}|(?:[37][01]|4[013]|51|6[489])\\d{6}",
|
|
45501
45497
|
null,
|
|
45502
45498
|
null,
|
|
45503
45499
|
null,
|
|
@@ -45609,7 +45605,7 @@
|
|
|
45609
45605
|
"(\\d{2})(\\d{3})(\\d{3})",
|
|
45610
45606
|
"$1 $2 $3",
|
|
45611
45607
|
[
|
|
45612
|
-
"[37][01]|4[
|
|
45608
|
+
"[37][01]|4[013]|51|6"
|
|
45613
45609
|
],
|
|
45614
45610
|
"0$1"
|
|
45615
45611
|
],
|
|
@@ -52331,7 +52327,7 @@
|
|
|
52331
52327
|
[
|
|
52332
52328
|
null,
|
|
52333
52329
|
null,
|
|
52334
|
-
"
|
|
52330
|
+
"7280\\d{5}|7(?:[014-8]\\d|2[01467]|3[016]|9[0-589])\\d{6}",
|
|
52335
52331
|
null,
|
|
52336
52332
|
null,
|
|
52337
52333
|
null,
|
|
@@ -54218,7 +54214,7 @@
|
|
|
54218
54214
|
[
|
|
54219
54215
|
null,
|
|
54220
54216
|
null,
|
|
54221
|
-
"[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|
|
|
54217
|
+
"[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",
|
|
54222
54218
|
null,
|
|
54223
54219
|
null,
|
|
54224
54220
|
null,
|
|
@@ -54356,17 +54352,6 @@
|
|
|
54356
54352
|
null,
|
|
54357
54353
|
1
|
|
54358
54354
|
],
|
|
54359
|
-
[
|
|
54360
|
-
null,
|
|
54361
|
-
"(\\d{2})(\\d{5})",
|
|
54362
|
-
"$1 $2",
|
|
54363
|
-
[
|
|
54364
|
-
"80"
|
|
54365
|
-
],
|
|
54366
|
-
"0$1",
|
|
54367
|
-
null,
|
|
54368
|
-
1
|
|
54369
|
-
],
|
|
54370
54355
|
[
|
|
54371
54356
|
null,
|
|
54372
54357
|
"(\\d{3})(\\d{4,5})",
|
|
@@ -54435,17 +54420,6 @@
|
|
|
54435
54420
|
]
|
|
54436
54421
|
],
|
|
54437
54422
|
[
|
|
54438
|
-
[
|
|
54439
|
-
null,
|
|
54440
|
-
"(\\d{2})(\\d{5})",
|
|
54441
|
-
"$1 $2",
|
|
54442
|
-
[
|
|
54443
|
-
"80"
|
|
54444
|
-
],
|
|
54445
|
-
"0$1",
|
|
54446
|
-
null,
|
|
54447
|
-
1
|
|
54448
|
-
],
|
|
54449
54423
|
[
|
|
54450
54424
|
null,
|
|
54451
54425
|
"(\\d{4})(\\d{4,6})",
|
|
@@ -54536,7 +54510,7 @@
|
|
|
54536
54510
|
[
|
|
54537
54511
|
null,
|
|
54538
54512
|
null,
|
|
54539
|
-
"
|
|
54513
|
+
"[17]99\\d{4}|69\\d{5,6}",
|
|
54540
54514
|
null,
|
|
54541
54515
|
null,
|
|
54542
54516
|
null,
|