libphonenumber-js 1.11.10 → 1.11.11
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/build/AsYouType.test.js +8 -3
- package/build/AsYouType.test.js.map +1 -1
- package/build/helpers/getCountryByNationalNumber.js +17 -17
- package/build/helpers/getCountryByNationalNumber.js.map +1 -1
- package/build/parse.test.js +7 -3
- package/build/parse.test.js.map +1 -1
- package/bundle/libphonenumber-js.min.js +1 -1
- package/bundle/libphonenumber-js.min.js.map +1 -1
- package/bundle/libphonenumber-max.js +1 -1
- package/bundle/libphonenumber-max.js.map +1 -1
- package/bundle/libphonenumber-min.js +1 -1
- package/bundle/libphonenumber-min.js.map +1 -1
- package/bundle/libphonenumber-mobile.js +1 -1
- package/bundle/libphonenumber-mobile.js.map +1 -1
- package/es6/AsYouType.test.js +8 -3
- package/es6/AsYouType.test.js.map +1 -1
- package/es6/helpers/getCountryByNationalNumber.js +17 -17
- package/es6/helpers/getCountryByNationalNumber.js.map +1 -1
- package/es6/parse.test.js +7 -3
- package/es6/parse.test.js.map +1 -1
- package/package.json +1 -1
- package/source/AsYouType.test.js +8 -3
- package/source/helpers/getCountryByNationalNumber.js +18 -14
- package/source/parse.test.js +7 -3
package/es6/AsYouType.test.js
CHANGED
|
@@ -1250,14 +1250,19 @@ describe('AsYouType.getNumberValue()', function () {
|
|
|
1250
1250
|
formatter.input('421901222333').should.equal('421 901 222 333');
|
|
1251
1251
|
formatter.getTemplate().should.equal('xxx xxx xxx xxx');
|
|
1252
1252
|
});
|
|
1253
|
-
it('should choose `defaultCountry`
|
|
1253
|
+
it('should not choose `defaultCountry` over the "main" one when both the `defaultCountry` and the "main" one match the phone number', function () {
|
|
1254
|
+
// This phone number matches both US and CA because they have the same
|
|
1255
|
+
// regular expression for some weird reason.
|
|
1254
1256
|
// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103
|
|
1255
1257
|
var formatter = new AsYouType('CA');
|
|
1256
1258
|
formatter.input('8004001000');
|
|
1257
|
-
formatter.getNumber().country.should.equal('CA');
|
|
1259
|
+
formatter.getNumber().country.should.not.equal('CA');
|
|
1260
|
+
formatter.getNumber().country.should.equal('US'); // This phone number is specific to CA.
|
|
1261
|
+
|
|
1258
1262
|
var formatter2 = new AsYouType('US');
|
|
1259
1263
|
formatter2.input('4389999999');
|
|
1260
|
-
formatter2.getNumber().country.should.equal('CA'); //
|
|
1264
|
+
formatter2.getNumber().country.should.equal('CA'); // This phone number doesn't belong neither to CA nor to US.
|
|
1265
|
+
// In fact, it doesn't belong to any country from the "NANPA" zone.
|
|
1261
1266
|
|
|
1262
1267
|
var formatter3 = new AsYouType('US');
|
|
1263
1268
|
formatter3.input('1111111111');
|