libphonenumber-js
Advanced tools
Comparing version 0.2.13 to 0.2.14
@@ -583,2 +583,8 @@ 'use strict'; | ||
if (number_pattern) { | ||
// A phone number format matches, | ||
// so this is the country. | ||
if (!this.country) { | ||
this.country = this.default_country; | ||
} | ||
this.create_formatting_template(format, number_pattern); | ||
@@ -596,3 +602,4 @@ this.chosen_format = format; | ||
// No format matches the phone number, | ||
// therefore set `country` to `undefined`. | ||
// therefore set `country` to `undefined` | ||
// (or to the default country). | ||
} catch (err) { | ||
@@ -613,3 +620,7 @@ _didIteratorError2 = true; | ||
this.country = this.default_country; | ||
if (this.default_country && this.parsed_input && this.parsed_input[0] !== '+') { | ||
this.country = this.default_country; | ||
} else { | ||
this.country = undefined; | ||
} | ||
@@ -616,0 +627,0 @@ // No format matches the national phone number entered |
{ | ||
"name": "libphonenumber-js", | ||
"version": "0.2.13", | ||
"version": "0.2.14", | ||
"description": "A simpler (and smaller) rewrite of Google Android's popular libphonenumber library", | ||
@@ -5,0 +5,0 @@ "main": "index.common.js", |
@@ -616,2 +616,9 @@ // This is an enhanced port of Google Android `libphonenumber`'s | ||
{ | ||
// A phone number format matches, | ||
// so this is the country. | ||
if (!this.country) | ||
{ | ||
this.country = this.default_country | ||
} | ||
this.create_formatting_template(format, number_pattern) | ||
@@ -629,4 +636,12 @@ this.chosen_format = format | ||
// No format matches the phone number, | ||
// therefore set `country` to `undefined`. | ||
this.country = this.default_country | ||
// therefore set `country` to `undefined` | ||
// (or to the default country). | ||
if (this.default_country && this.parsed_input && this.parsed_input[0] !== '+') | ||
{ | ||
this.country = this.default_country | ||
} | ||
else | ||
{ | ||
this.country = undefined | ||
} | ||
@@ -633,0 +648,0 @@ // No format matches the national phone number entered |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1100976
4612