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