libphonenumber-js
Advanced tools
Comparing version 0.4.39 to 0.4.40
@@ -160,7 +160,7 @@ 'use strict'; | ||
'\u06F9': '9' // Eastern-Arabic digit 9 | ||
}; | ||
// The maximum length of the country calling code. | ||
var MAX_LENGTH_COUNTRY_CODE = 3; | ||
// The maximum length of the country calling code. | ||
};var MAX_LENGTH_COUNTRY_CODE = 3; | ||
// The minimum length of the national significant number. | ||
@@ -179,31 +179,30 @@ var MIN_LENGTH_FOR_NSN = 2; | ||
country: {} | ||
}; | ||
// `options`: | ||
// { | ||
// country: | ||
// { | ||
// restrict - (a two-letter country code) | ||
// the phone number must be in this country | ||
// | ||
// default - (a two-letter country code) | ||
// default country to use for phone number parsing and validation | ||
// (if no country code could be derived from the phone number) | ||
// } | ||
// } | ||
// | ||
// Returns `{ country, number }` | ||
// | ||
// Example use cases: | ||
// | ||
// ```js | ||
// parse('8 (800) 555-35-35', 'RU') | ||
// parse('8 (800) 555-35-35', 'RU', metadata) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata) | ||
// parse('+7 800 555 35 35') | ||
// parse('+7 800 555 35 35', metadata) | ||
// ``` | ||
// | ||
function parse(first_argument, second_argument, third_argument) { | ||
// `options`: | ||
// { | ||
// country: | ||
// { | ||
// restrict - (a two-letter country code) | ||
// the phone number must be in this country | ||
// | ||
// default - (a two-letter country code) | ||
// default country to use for phone number parsing and validation | ||
// (if no country code could be derived from the phone number) | ||
// } | ||
// } | ||
// | ||
// Returns `{ country, number }` | ||
// | ||
// Example use cases: | ||
// | ||
// ```js | ||
// parse('8 (800) 555-35-35', 'RU') | ||
// parse('8 (800) 555-35-35', 'RU', metadata) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata) | ||
// parse('+7 800 555 35 35') | ||
// parse('+7 800 555 35 35', metadata) | ||
// ``` | ||
// | ||
};function parse(first_argument, second_argument, third_argument) { | ||
var _sort_out_arguments = sort_out_arguments(first_argument, second_argument, third_argument), | ||
@@ -210,0 +209,0 @@ text = _sort_out_arguments.text, |
@@ -174,7 +174,6 @@ 'use strict'; | ||
} | ||
}; | ||
// Check that national (significant) phone number pattern | ||
// is set for this country (no "default" value here) | ||
if (!country.national_number_pattern) { | ||
// Check that national (significant) phone number pattern | ||
// is set for this country (no "default" value here) | ||
};if (!country.national_number_pattern) { | ||
throw new Error('"generalDesc.nationalNumberPattern" is missing for country ' + country_code + ' metadata'); | ||
@@ -181,0 +180,0 @@ } |
@@ -135,7 +135,7 @@ import _getIterator from 'babel-runtime/core-js/get-iterator'; | ||
'\u06F9': '9' // Eastern-Arabic digit 9 | ||
}; | ||
// The maximum length of the country calling code. | ||
var MAX_LENGTH_COUNTRY_CODE = 3; | ||
// The maximum length of the country calling code. | ||
};var MAX_LENGTH_COUNTRY_CODE = 3; | ||
// The minimum length of the national significant number. | ||
@@ -154,31 +154,30 @@ var MIN_LENGTH_FOR_NSN = 2; | ||
country: {} | ||
}; | ||
// `options`: | ||
// { | ||
// country: | ||
// { | ||
// restrict - (a two-letter country code) | ||
// the phone number must be in this country | ||
// | ||
// default - (a two-letter country code) | ||
// default country to use for phone number parsing and validation | ||
// (if no country code could be derived from the phone number) | ||
// } | ||
// } | ||
// | ||
// Returns `{ country, number }` | ||
// | ||
// Example use cases: | ||
// | ||
// ```js | ||
// parse('8 (800) 555-35-35', 'RU') | ||
// parse('8 (800) 555-35-35', 'RU', metadata) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata) | ||
// parse('+7 800 555 35 35') | ||
// parse('+7 800 555 35 35', metadata) | ||
// ``` | ||
// | ||
export default function parse(first_argument, second_argument, third_argument) { | ||
// `options`: | ||
// { | ||
// country: | ||
// { | ||
// restrict - (a two-letter country code) | ||
// the phone number must be in this country | ||
// | ||
// default - (a two-letter country code) | ||
// default country to use for phone number parsing and validation | ||
// (if no country code could be derived from the phone number) | ||
// } | ||
// } | ||
// | ||
// Returns `{ country, number }` | ||
// | ||
// Example use cases: | ||
// | ||
// ```js | ||
// parse('8 (800) 555-35-35', 'RU') | ||
// parse('8 (800) 555-35-35', 'RU', metadata) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }) | ||
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata) | ||
// parse('+7 800 555 35 35') | ||
// parse('+7 800 555 35 35', metadata) | ||
// ``` | ||
// | ||
};export default function parse(first_argument, second_argument, third_argument) { | ||
var _sort_out_arguments = sort_out_arguments(first_argument, second_argument, third_argument), | ||
@@ -185,0 +184,0 @@ text = _sort_out_arguments.text, |
@@ -231,7 +231,6 @@ import _Object$keys from 'babel-runtime/core-js/object/keys'; | ||
} | ||
}; | ||
// Check that national (significant) phone number pattern | ||
// is set for this country (no "default" value here) | ||
if (!country.national_number_pattern) { | ||
// Check that national (significant) phone number pattern | ||
// is set for this country (no "default" value here) | ||
};if (!country.national_number_pattern) { | ||
throw new Error('"generalDesc.nationalNumberPattern" is missing for country ' + country_code + ' metadata'); | ||
@@ -238,0 +237,0 @@ } |
{ | ||
"name": "libphonenumber-js", | ||
"version": "0.4.39", | ||
"version": "0.4.40", | ||
"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
1452100
5769