fullstack-phone 1.168.0 → 1.170.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 +10 -0
- package/README.md +1 -1
- package/client/index.js +1 -1
- package/package.json +2 -2
- package/server/metadata/metadata.json +17 -17
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) | [v8.13.
|
|
6
|
+
| [](https://www.npmjs.com/package/fullstack-phone) | [v8.13.54](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
|
@@ -76,7 +76,7 @@ function ub(a,b,c){if(null==b)throw Error("The string supplied did not seem to b
|
|
|
76
76
|
null!=e?("+"===e.charAt(0)&&d.g(e),e=b.indexOf("tel:"),d.g(b.substring(0<=e?e+4:0,b.indexOf(";phone-context=")))):(e=d.g,b=null!=b?b:"",f=b.search(Sa),0<=f?(b=b.substring(f),b=b.replace(Ua,""),f=b.search(Ta),0<=f&&(b=b.substring(0,f))):b="",e.call(d,b));b=d.toString();e=b.indexOf(";isub=");0<e&&(n(d),d.g(b.substring(0,e)));if(!cb(d.toString()))throw Error("The string supplied did not seem to be a phone number");b=d.toString();if(!(K(c)||null!=b&&0<b.length&&H.test(b)))throw Error("Invalid country calling code");
|
|
77
77
|
b=new D;a:{e=d.toString();f=e.search(Za);if(0<=f&&cb(e.substring(0,f))){g=e.match(Za);for(var k=g.length,m=1;m<k;++m)if(null!=g[m]&&0<g[m].length){n(d);d.g(e.substring(0,f));e=g[m];break a}}e=""}0<e.length&&t(b,3,e);f=Q(a,c);e=new l;g=0;k=d.toString();try{g=sb(a,k,f,e,b)}catch(M){if("Invalid country calling code"==M.message&&H.test(k)){if(k=k.replace(H,""),g=sb(a,k,f,e,b),0==g)throw M;}else throw M;}0!=g?(d=P(g),d!=c&&(f=O(a,g,d))):(fb(d),e.g(d.toString()),null!=c&&(g=w(f,10),t(b,1,g)));if(2>e.h.length)throw Error("The string supplied is too short to be a phone number");
|
|
78
78
|
null!=f&&(c=new l(e.toString()),tb(c,f,new l),a=pb(a,c.toString(),f,-1),2!=a&&4!=a&&5!=a&&(e=c));a=e.toString();c=a.length;if(2>c)throw Error("The string supplied is too short to be a phone number");if(17<c)throw Error("The string supplied is too long to be a phone number");if(1<a.length&&"0"==a.charAt(0)){t(b,4,!0);for(c=1;c<a.length-1&&"0"==a.charAt(c);)c++;1!=c&&t(b,8,c)}t(b,2,parseInt(a,10));return b}
|
|
79
|
-
function J(a,b){return(a=
|
|
79
|
+
function J(a,b){return(a=b.match(new RegExp("^(?:"+("string"==typeof a?a:a.source)+")$","i")))&&a[0].length==b.length?!0:!1};function vb(a){this.ia=RegExp("\u2008");this.da="";this.aa=new l;this.ea="";this.o=new l;this.$=new l;this.v=!0;this.fa=this.ba=this.la=!1;this.na=G.h();this.oa=this.ma=this.ca=0;this.h=new l;this.ha=!1;this.s="";this.g=new l;this.j=[];this.ja=a;this.pa=this.l=wb(this,this.ja)}var xb=new B;t(xb,11,"NA");
|
|
80
80
|
var yb=RegExp("^[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]*\\$1[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]*(\\$\\d[-x\u2010-\u2015\u2212\u30fc\uff0d-\uff0f \u00a0\u00ad\u200b\u2060\u3000()\uff08\uff09\uff3b\uff3d.\\[\\]/~\u2053\u223c\uff5e]*)*$"),zb=/[- ]/;function wb(a,b){b=K(b)?S(a.na,b):0;a=Q(a.na,P(b));return null!=a?a:xb}
|
|
81
81
|
function Ab(a){for(var b=a.j.length,c=0;c<b;++c){var d=a.j[c],e=w(d,1);if(a.ea==e)return!1;var f=a;var g=d,k=w(g,1);n(f.aa);var m=f;g=w(g,2);var M="999999999999999".match(k)[0];M.length<m.g.h.length?m="":(m=M.replace(new RegExp(k,"g"),g),m=m.replace(RegExp("9","g"),"\u2008"));0<m.length?(f.aa.g(m),f=!0):f=!1;if(f)return a.ea=e,a.ha=zb.test(r(d,4)),a.ca=0,!0}return a.v=!1}
|
|
82
82
|
function Bb(a,b){for(var c=[],d=b.length-3,e=a.j.length,f=0;f<e;++f){var g=a.j[f];0==x(g,3)?c.push(a.j[f]):(g=r(g,3,Math.min(d,x(g,3)-1)),0==b.search(g)&&c.push(a.j[f]))}a.j=c}
|
package/package.json
CHANGED
|
@@ -15203,7 +15203,7 @@
|
|
|
15203
15203
|
[
|
|
15204
15204
|
null,
|
|
15205
15205
|
null,
|
|
15206
|
-
"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-
|
|
15206
|
+
"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[0-5]))\\d{6}",
|
|
15207
15207
|
null,
|
|
15208
15208
|
null,
|
|
15209
15209
|
null,
|
|
@@ -21141,7 +21141,7 @@
|
|
|
21141
21141
|
[
|
|
21142
21142
|
null,
|
|
21143
21143
|
null,
|
|
21144
|
-
"(?:4(?:44[0-25-9]|6(?:1[0-7]|4[0-57-9]|6[0-4])|7(?:4[0-2]|6[0-5]))|5(?:73[0-6]|95[0-8])|6(?:26[013-8]|66[0-3])|70(?:7[1-8]|8[0-4])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-4]|899))\\d{4}|(?:4(?:4[0-35-9]|6[02357-9]|7[
|
|
21144
|
+
"(?:4(?:44[0-25-9]|6(?:1[0-7]|4[0-57-9]|6[0-4])|7(?:4[0-2]|6[0-5]))|5(?:73[0-6]|95[0-8])|6(?:26[013-8]|66[0-3])|70(?:7[1-8]|8[0-4])|84(?:4[0-2]|8[0-35-9])|9(?:29[013-9]|39[014-9]|59[0-4]|899))\\d{4}|(?:4(?:4[0-35-9]|6[02357-9]|7[015])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|70[1-59]|84[0-39]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",
|
|
21145
21145
|
null,
|
|
21146
21146
|
null,
|
|
21147
21147
|
null,
|
|
@@ -23090,7 +23090,7 @@
|
|
|
23090
23090
|
[
|
|
23091
23091
|
null,
|
|
23092
23092
|
null,
|
|
23093
|
-
"7(?:38(?:0\\d|5[0-
|
|
23093
|
+
"7(?:38(?:0\\d|5[0-3569]|88)|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",
|
|
23094
23094
|
null,
|
|
23095
23095
|
null,
|
|
23096
23096
|
null,
|
|
@@ -30722,7 +30722,7 @@
|
|
|
30722
30722
|
[
|
|
30723
30723
|
null,
|
|
30724
30724
|
null,
|
|
30725
|
-
"
|
|
30725
|
+
"2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}",
|
|
30726
30726
|
null,
|
|
30727
30727
|
null,
|
|
30728
30728
|
null,
|
|
@@ -31113,7 +31113,7 @@
|
|
|
31113
31113
|
[
|
|
31114
31114
|
null,
|
|
31115
31115
|
null,
|
|
31116
|
-
"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-
|
|
31116
|
+
"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[0-5]))\\d{6}",
|
|
31117
31117
|
null,
|
|
31118
31118
|
null,
|
|
31119
31119
|
null,
|
|
@@ -32570,7 +32570,7 @@
|
|
|
32570
32570
|
[
|
|
32571
32571
|
null,
|
|
32572
32572
|
null,
|
|
32573
|
-
"7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-
|
|
32573
|
+
"7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}",
|
|
32574
32574
|
null,
|
|
32575
32575
|
null,
|
|
32576
32576
|
null,
|
|
@@ -32763,7 +32763,7 @@
|
|
|
32763
32763
|
[
|
|
32764
32764
|
null,
|
|
32765
32765
|
null,
|
|
32766
|
-
"2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-
|
|
32766
|
+
"2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-59]))\\d{5}",
|
|
32767
32767
|
null,
|
|
32768
32768
|
null,
|
|
32769
32769
|
null,
|
|
@@ -32772,7 +32772,7 @@
|
|
|
32772
32772
|
[
|
|
32773
32773
|
null,
|
|
32774
32774
|
null,
|
|
32775
|
-
"2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[01]|[679]\\d|8[2-
|
|
32775
|
+
"2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[01]|[679]\\d|8[2-59])\\d{6}",
|
|
32776
32776
|
null,
|
|
32777
32777
|
null,
|
|
32778
32778
|
null,
|
|
@@ -33065,7 +33065,7 @@
|
|
|
33065
33065
|
[
|
|
33066
33066
|
null,
|
|
33067
33067
|
null,
|
|
33068
|
-
"1333\\d{4}
|
|
33068
|
+
"1333\\d{4}",
|
|
33069
33069
|
null,
|
|
33070
33070
|
null,
|
|
33071
33071
|
null,
|
|
@@ -34674,7 +34674,7 @@
|
|
|
34674
34674
|
[
|
|
34675
34675
|
null,
|
|
34676
34676
|
null,
|
|
34677
|
-
"(?:2(?:[0346-8]\\d|1[0-7])|4(?:[013568]\\d|2[4-8]|71)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}",
|
|
34677
|
+
"(?:2(?:[0346-8]\\d|1[0-7])|4(?:[013568]\\d|2[4-8]|71|90)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}",
|
|
34678
34678
|
null,
|
|
34679
34679
|
null,
|
|
34680
34680
|
null,
|
|
@@ -36288,7 +36288,7 @@
|
|
|
36288
36288
|
[
|
|
36289
36289
|
null,
|
|
36290
36290
|
null,
|
|
36291
|
-
"(?:
|
|
36291
|
+
"(?:[579]\\d|8[0-79])\\d{4}",
|
|
36292
36292
|
null,
|
|
36293
36293
|
null,
|
|
36294
36294
|
null,
|
|
@@ -40602,7 +40602,7 @@
|
|
|
40602
40602
|
[
|
|
40603
40603
|
null,
|
|
40604
40604
|
null,
|
|
40605
|
-
"21(?:1[013-5]|2\\d|3[
|
|
40605
|
+
"2131[89]\\d{4}|21(?:1[013-5]|2\\d|3[2-9])\\d{5}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",
|
|
40606
40606
|
null,
|
|
40607
40607
|
null,
|
|
40608
40608
|
null,
|
|
@@ -41664,7 +41664,7 @@
|
|
|
41664
41664
|
[
|
|
41665
41665
|
null,
|
|
41666
41666
|
null,
|
|
41667
|
-
"(?:(?:46|83)[0-5]|6[2-4689]0)\\d{4}|(?:45|77|88)\\d{5}",
|
|
41667
|
+
"(?:(?:46|83)[0-5]|(?:6[2-4689]|78)0)\\d{4}|(?:45|77|88)\\d{5}",
|
|
41668
41668
|
null,
|
|
41669
41669
|
null,
|
|
41670
41670
|
null,
|
|
@@ -46676,7 +46676,7 @@
|
|
|
46676
46676
|
[
|
|
46677
46677
|
null,
|
|
46678
46678
|
null,
|
|
46679
|
-
"(?:(?:15|(?:3[59]|4[89]|6\\d|7[
|
|
46679
|
+
"(?:(?:15|(?:3[59]|4[89]|6\\d|7[679]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}",
|
|
46680
46680
|
null,
|
|
46681
46681
|
null,
|
|
46682
46682
|
null,
|
|
@@ -46815,7 +46815,7 @@
|
|
|
46815
46815
|
"(\\d{2})(\\d{5,7})",
|
|
46816
46816
|
"$1 $2",
|
|
46817
46817
|
[
|
|
46818
|
-
"1|28|6[0-35-9]|
|
|
46818
|
+
"1|28|6[0-35-9]|7[67]|9[2-9]"
|
|
46819
46819
|
]
|
|
46820
46820
|
]
|
|
46821
46821
|
],
|
|
@@ -52314,7 +52314,7 @@
|
|
|
52314
52314
|
[
|
|
52315
52315
|
null,
|
|
52316
52316
|
null,
|
|
52317
|
-
"(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468]))\\d{4}|(?:305[3-9]|472[
|
|
52317
|
+
"(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468]))\\d{4}|(?:2742|305[3-9]|472[247-9]|505[2-57-9]|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",
|
|
52318
52318
|
null,
|
|
52319
52319
|
null,
|
|
52320
52320
|
null,
|
|
@@ -52329,7 +52329,7 @@
|
|
|
52329
52329
|
[
|
|
52330
52330
|
null,
|
|
52331
52331
|
null,
|
|
52332
|
-
"(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468]))\\d{4}|(?:305[3-9]|472[
|
|
52332
|
+
"(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468]))\\d{4}|(?:2742|305[3-9]|472[247-9]|505[2-57-9]|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",
|
|
52333
52333
|
null,
|
|
52334
52334
|
null,
|
|
52335
52335
|
null,
|