libphonenumber-js 1.11.1 → 1.11.3
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 +33 -23
- package/build/AsYouType.test.js.map +1 -1
- package/build/PhoneNumberMatcher.test.js +6 -5
- package/build/PhoneNumberMatcher.test.js.map +1 -1
- package/build/format.test.js +1 -1
- package/build/format.test.js.map +1 -1
- package/build/legacy/format.test.js +1 -1
- package/build/legacy/format.test.js.map +1 -1
- package/build/legacy/parse.test.js +28 -20
- package/build/legacy/parse.test.js.map +1 -1
- package/build/parse.test.js +28 -20
- 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 +33 -23
- package/es6/AsYouType.test.js.map +1 -1
- package/es6/PhoneNumberMatcher.test.js +6 -5
- package/es6/PhoneNumberMatcher.test.js.map +1 -1
- package/es6/format.test.js +1 -1
- package/es6/format.test.js.map +1 -1
- package/es6/legacy/format.test.js +1 -1
- package/es6/legacy/format.test.js.map +1 -1
- package/es6/legacy/parse.test.js +28 -20
- package/es6/legacy/parse.test.js.map +1 -1
- package/es6/parse.test.js +28 -20
- package/es6/parse.test.js.map +1 -1
- package/examples.mobile.json +1 -1
- package/examples.mobile.json.js +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.test.js +36 -20
- package/source/PhoneNumberMatcher.test.js +7 -4
- package/source/format.test.js +1 -1
- package/source/legacy/format.test.js +1 -1
- package/source/legacy/parse.test.js +27 -18
- package/source/parse.test.js +27 -18
- package/types.d.cts +9 -14
- package/types.d.ts +9 -14
package/build/AsYouType.test.js
CHANGED
|
@@ -651,38 +651,48 @@ describe('AsYouType', function () {
|
|
|
651
651
|
formatter.state.complexPrefixBeforeNationalSignificantNumber.should.equal('1831');
|
|
652
652
|
});
|
|
653
653
|
it('should work with Mexico numbers', function () {
|
|
654
|
-
var asYouType = new AsYouType('MX'); // Fixed line.
|
|
654
|
+
var asYouType = new AsYouType('MX'); // Fixed line. International.
|
|
655
655
|
|
|
656
656
|
asYouType.input('+52(449)978-000').should.equal('+52 449 978 000');
|
|
657
657
|
asYouType.input('1').should.equal('+52 449 978 0001');
|
|
658
|
-
asYouType.reset();
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
asYouType.input('
|
|
662
|
-
asYouType.getTemplate().should.equal('xxxxx xxx
|
|
663
|
-
asYouType.
|
|
658
|
+
asYouType.reset(); // "Dialling tokens 01, 02, 044, 045 and 1 are removed as they are
|
|
659
|
+
// no longer valid since August 2019."
|
|
660
|
+
// // Fixed line. National. With national prefix "01".
|
|
661
|
+
// asYouType.input('01449978000').should.equal('01449 978 000')
|
|
662
|
+
// asYouType.getTemplate().should.equal('xxxxx xxx xxx')
|
|
663
|
+
// asYouType.input('1').should.equal('01449 978 0001')
|
|
664
|
+
// asYouType.getTemplate().should.equal('xxxxx xxx xxxx')
|
|
665
|
+
// asYouType.reset()
|
|
666
|
+
// Fixed line. National. Without national prefix.
|
|
667
|
+
|
|
664
668
|
asYouType.input('(449)978-000').should.equal('449 978 000');
|
|
665
669
|
asYouType.getTemplate().should.equal('xxx xxx xxx');
|
|
666
670
|
asYouType.input('1').should.equal('449 978 0001');
|
|
667
|
-
asYouType.getTemplate().should.equal('xxx xxx xxxx');
|
|
668
|
-
//
|
|
669
|
-
|
|
670
|
-
asYouType.reset();
|
|
671
|
-
asYouType.input('+521331234567').should.equal('+52 133 1234 567');
|
|
672
|
-
asYouType.getTemplate().should.equal('xxx xxx xxxx xxx'); // Google's `libphonenumber` seems to not able to format this type of number.
|
|
673
|
-
// https://issuetracker.google.com/issues/147938979
|
|
671
|
+
asYouType.getTemplate().should.equal('xxx xxx xxxx');
|
|
672
|
+
asYouType.reset(); // Mobile.
|
|
674
673
|
|
|
675
|
-
asYouType.input('8').should.equal('+52 133 1234 5678');
|
|
676
|
-
asYouType.getTemplate().should.equal('xxx xxx xxxx xxxx');
|
|
677
|
-
asYouType.reset();
|
|
678
674
|
asYouType.input('+52331234567').should.equal('+52 33 1234 567');
|
|
679
675
|
asYouType.input('8').should.equal('+52 33 1234 5678');
|
|
680
|
-
asYouType.reset();
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
asYouType.input('
|
|
685
|
-
asYouType.
|
|
676
|
+
asYouType.reset(); // "Dialling tokens 01, 02, 044, 045 and 1 are removed as they are
|
|
677
|
+
// no longer valid since August 2019."
|
|
678
|
+
// // Mobile.
|
|
679
|
+
// // With `1` prepended before area code to mobile numbers in international format.
|
|
680
|
+
// asYouType.input('+521331234567').should.equal('+52 133 1234 567')
|
|
681
|
+
// asYouType.getTemplate().should.equal('xxx xxx xxxx xxx')
|
|
682
|
+
// // Google's `libphonenumber` seems to not able to format this type of number.
|
|
683
|
+
// // https://issuetracker.google.com/issues/147938979
|
|
684
|
+
// asYouType.input('8').should.equal('+52 133 1234 5678')
|
|
685
|
+
// asYouType.getTemplate().should.equal('xxx xxx xxxx xxxx')
|
|
686
|
+
// asYouType.reset()
|
|
687
|
+
//
|
|
688
|
+
// // Mobile. National. With "044" prefix.
|
|
689
|
+
// asYouType.input('044331234567').should.equal('04433 1234 567')
|
|
690
|
+
// asYouType.input('8').should.equal('04433 1234 5678')
|
|
691
|
+
// asYouType.reset()
|
|
692
|
+
//
|
|
693
|
+
// // Mobile. National. With "045" prefix.
|
|
694
|
+
// asYouType.input('045331234567').should.equal('04533 1234 567')
|
|
695
|
+
// asYouType.input('8').should.equal('04533 1234 5678')
|
|
686
696
|
});
|
|
687
697
|
it('should just prepend national prefix if national_prefix_formatting_rule does not produce a suitable number', function () {
|
|
688
698
|
// "national_prefix": "8"
|