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