libphonenumber-js
Advanced tools
Comparing version 1.4.5 to 1.4.6
@@ -126,3 +126,3 @@ 'use strict'; | ||
} | ||
number = format_national_number(number, 'National', false, metadata); | ||
number = format_national_number(number, 'National', true, metadata); | ||
return add_extension(number, input.ext, metadata, options.formatExtension); | ||
@@ -129,0 +129,0 @@ } |
@@ -380,2 +380,6 @@ 'use strict'; | ||
populate_possible_lengths(countries[_country_code2]); | ||
if (countries[_country_code2].possible_lengths.length === 0) { | ||
throw new Error('No "possibleLengths" set for country "' + _country_code2 + '". "react-phone-number-input" relies on "possibleLengths" being always present.'); | ||
} | ||
} | ||
@@ -382,0 +386,0 @@ |
@@ -11,2 +11,7 @@ <!-- (breaking change) `parseNumber()` is now `extended: true` by default (and the `extended` flag is no longer supported) meaning that by default it will parse all even remotely hypothetical phone numbers (this was decided to be the primary use case for this function, and it's how Google's libphonenumber does it). Pass `strict: true` flag for the old "only parse valid numbers" behaviour. --> | ||
1.4.6 / 12.09.2018 | ||
================== | ||
* Fixed `formatNumber('NATIONAL')` not formatting national phone numbers with a national prefix when it's marked as optional (e.g. Russia). Before it didn't add national prefix when formatting national numbers if national prefix was marked as optional. Now it always adds national prefix when formatting national numbers even when national prefix is marked as optional. | ||
1.4.5 / 07.09.2018 | ||
@@ -13,0 +18,0 @@ ================== |
@@ -111,3 +111,3 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
} | ||
number = format_national_number(number, 'National', false, metadata); | ||
number = format_national_number(number, 'National', true, metadata); | ||
return add_extension(number, input.ext, metadata, options.formatExtension); | ||
@@ -114,0 +114,0 @@ } |
@@ -511,2 +511,6 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
populate_possible_lengths(countries[_country_code2]); | ||
if (countries[_country_code2].possible_lengths.length === 0) { | ||
throw new Error('No "possibleLengths" set for country "' + _country_code2 + '". "react-phone-number-input" relies on "possibleLengths" being always present.'); | ||
} | ||
} | ||
@@ -513,0 +517,0 @@ |
{ | ||
"name": "libphonenumber-js", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"description": "A simpler (and smaller) rewrite of Google Android's popular libphonenumber library", | ||
@@ -5,0 +5,0 @@ "main": "index.common.js", |
Sorry, the diff of this file is not supported yet
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
Sorry, the diff of this file is not supported yet
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 too big to display
Sorry, the diff of this file is too big to display
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
1757112
10183