libphonenumber-js 1.10.33 → 1.10.36
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.js +5 -1
- package/build/AsYouType.js.map +1 -1
- package/build/AsYouType.test.js +5 -1
- package/build/AsYouType.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.js +5 -1
- package/es6/AsYouType.js.map +1 -1
- package/es6/AsYouType.test.js +5 -1
- package/es6/AsYouType.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 +1 -1
- package/source/AsYouType.js +4 -1
- package/source/AsYouType.test.js +5 -0
package/package.json
CHANGED
package/source/AsYouType.js
CHANGED
|
@@ -383,11 +383,14 @@ export default class AsYouType {
|
|
|
383
383
|
const callingCode = metadata.numberingPlan.callingCode()
|
|
384
384
|
const ambiguousCountries = this.metadata.getCountryCodesForCallingCode(callingCode)
|
|
385
385
|
if (ambiguousCountries.length > 1) {
|
|
386
|
-
|
|
386
|
+
const exactCountry = getCountryByNationalNumber(nationalSignificantNumber, {
|
|
387
387
|
countries: ambiguousCountries,
|
|
388
388
|
defaultCountry: this.defaultCountry,
|
|
389
389
|
metadata: this.metadata.metadata
|
|
390
390
|
})
|
|
391
|
+
if (exactCountry) {
|
|
392
|
+
country = exactCountry
|
|
393
|
+
}
|
|
391
394
|
}
|
|
392
395
|
}
|
|
393
396
|
}
|
package/source/AsYouType.test.js
CHANGED
|
@@ -1373,6 +1373,11 @@ describe('AsYouType.getNumberValue()', () => {
|
|
|
1373
1373
|
const formatter2 = new AsYouType('US')
|
|
1374
1374
|
formatter2.input('4389999999')
|
|
1375
1375
|
formatter2.getNumber().country.should.equal('CA')
|
|
1376
|
+
|
|
1377
|
+
// No country matches the national number digits.
|
|
1378
|
+
const formatter3 = new AsYouType('US')
|
|
1379
|
+
formatter3.input('1111111111')
|
|
1380
|
+
formatter3.getNumber().country.should.equal('US')
|
|
1376
1381
|
})
|
|
1377
1382
|
})
|
|
1378
1383
|
|