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.
@@ -11,8 +11,7 @@ export default function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
11
11
  defaultCountry = _ref.defaultCountry,
12
12
  metadata = _ref.metadata;
13
13
  // Re-create `metadata` because it will be selecting a `country`.
14
- metadata = new Metadata(metadata);
15
- var matchingCountries = [];
14
+ metadata = new Metadata(metadata); // const matchingCountries = []
16
15
 
17
16
  for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done;) {
18
17
  var country = _step.value;
@@ -34,22 +33,23 @@ export default function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
34
33
  phone: nationalPhoneNumber,
35
34
  country: country
36
35
  }, undefined, metadata.metadata)) {
37
- // If the `defaultCountry` is among the `matchingCountries` then return it.
38
- if (defaultCountry) {
39
- if (country === defaultCountry) {
40
- return country;
41
- }
42
-
43
- matchingCountries.push(country);
44
- } else {
45
- return country;
46
- }
36
+ // If both the `defaultCountry` and the "main" one match the phone number,
37
+ // don't prefer the `defaultCountry` over the "main" one.
38
+ // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154
39
+ return country; // // If the `defaultCountry` is among the `matchingCountries` then return it.
40
+ // if (defaultCountry) {
41
+ // if (country === defaultCountry) {
42
+ // return country
43
+ // }
44
+ // matchingCountries.push(country)
45
+ // } else {
46
+ // return country
47
+ // }
47
48
  }
48
- } // Return the first ("main") one of the `matchingCountries`.
49
-
49
+ } // // Return the first ("main") one of the `matchingCountries`.
50
+ // if (matchingCountries.length > 0) {
51
+ // return matchingCountries[0]
52
+ // }
50
53
 
51
- if (matchingCountries.length > 0) {
52
- return matchingCountries[0];
53
- }
54
54
  }
55
55
  //# sourceMappingURL=getCountryByNationalNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCountryByNationalNumber.js","names":["Metadata","getNumberType","getCountryByNationalNumber","nationalPhoneNumber","countries","defaultCountry","metadata","matchingCountries","country","leadingDigits","search","phone","undefined","push","length"],"sources":["../../source/helpers/getCountryByNationalNumber.js"],"sourcesContent":["import Metadata from '../metadata.js'\r\nimport getNumberType from './getNumberType.js'\r\n\r\nexport default function getCountryByNationalNumber(nationalPhoneNumber, {\r\n\tcountries,\r\n\tdefaultCountry,\r\n\tmetadata\r\n}) {\r\n\t// Re-create `metadata` because it will be selecting a `country`.\r\n\tmetadata = new Metadata(metadata)\r\n\r\n\tconst matchingCountries = []\r\n\r\n\tfor (const country of countries) {\r\n\t\tmetadata.country(country)\r\n\t\t// \"Leading digits\" patterns are only defined for about 20% of all countries.\r\n\t\t// By definition, matching \"leading digits\" is a sufficient but not a necessary\r\n\t\t// condition for a phone number to belong to a country.\r\n\t\t// The point of \"leading digits\" check is that it's the fastest one to get a match.\r\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\r\n\t\t// I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\r\n\t\t// because of the intended use of that feature.\r\n\t\tif (metadata.leadingDigits()) {\r\n\t\t\tif (nationalPhoneNumber &&\r\n\t\t\t\tnationalPhoneNumber.search(metadata.leadingDigits()) === 0) {\r\n\t\t\t\treturn country\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Else perform full validation with all of those\r\n\t\t// fixed-line/mobile/etc regular expressions.\r\n\t\telse if (getNumberType({ phone: nationalPhoneNumber, country }, undefined, metadata.metadata)) {\r\n\t\t\t// If the `defaultCountry` is among the `matchingCountries` then return it.\r\n\t\t\tif (defaultCountry) {\r\n\t\t\t\tif (country === defaultCountry) {\r\n\t\t\t\t\treturn country\r\n\t\t\t\t}\r\n\t\t\t\tmatchingCountries.push(country)\r\n\t\t\t} else {\r\n\t\t\t\treturn country\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Return the first (\"main\") one of the `matchingCountries`.\r\n\tif (matchingCountries.length > 0) {\r\n\t\treturn matchingCountries[0]\r\n\t}\r\n}"],"mappings":";;;;;;AAAA,OAAOA,QAAP,MAAqB,gBAArB;AACA,OAAOC,aAAP,MAA0B,oBAA1B;AAEA,eAAe,SAASC,0BAAT,CAAoCC,mBAApC,QAIZ;EAAA,IAHFC,SAGE,QAHFA,SAGE;EAAA,IAFFC,cAEE,QAFFA,cAEE;EAAA,IADFC,QACE,QADFA,QACE;EACF;EACAA,QAAQ,GAAG,IAAIN,QAAJ,CAAaM,QAAb,CAAX;EAEA,IAAMC,iBAAiB,GAAG,EAA1B;;EAEA,qDAAsBH,SAAtB,wCAAiC;IAAA,IAAtBI,OAAsB;IAChCF,QAAQ,CAACE,OAAT,CAAiBA,OAAjB,EADgC,CAEhC;IACA;IACA;IACA;IACA;IACA;IACA;;IACA,IAAIF,QAAQ,CAACG,aAAT,EAAJ,EAA8B;MAC7B,IAAIN,mBAAmB,IACtBA,mBAAmB,CAACO,MAApB,CAA2BJ,QAAQ,CAACG,aAAT,EAA3B,MAAyD,CAD1D,EAC6D;QAC5D,OAAOD,OAAP;MACA;IACD,CALD,CAMA;IACA;IAPA,KAQK,IAAIP,aAAa,CAAC;MAAEU,KAAK,EAAER,mBAAT;MAA8BK,OAAO,EAAPA;IAA9B,CAAD,EAA0CI,SAA1C,EAAqDN,QAAQ,CAACA,QAA9D,CAAjB,EAA0F;MAC9F;MACA,IAAID,cAAJ,EAAoB;QACnB,IAAIG,OAAO,KAAKH,cAAhB,EAAgC;UAC/B,OAAOG,OAAP;QACA;;QACDD,iBAAiB,CAACM,IAAlB,CAAuBL,OAAvB;MACA,CALD,MAKO;QACN,OAAOA,OAAP;MACA;IACD;EACD,CAlCC,CAoCF;;;EACA,IAAID,iBAAiB,CAACO,MAAlB,GAA2B,CAA/B,EAAkC;IACjC,OAAOP,iBAAiB,CAAC,CAAD,CAAxB;EACA;AACD"}
1
+ {"version":3,"file":"getCountryByNationalNumber.js","names":["Metadata","getNumberType","getCountryByNationalNumber","nationalPhoneNumber","countries","defaultCountry","metadata","country","leadingDigits","search","phone","undefined"],"sources":["../../source/helpers/getCountryByNationalNumber.js"],"sourcesContent":["import Metadata from '../metadata.js'\r\nimport getNumberType from './getNumberType.js'\r\n\r\nexport default function getCountryByNationalNumber(nationalPhoneNumber, {\r\n\tcountries,\r\n\tdefaultCountry,\r\n\tmetadata\r\n}) {\r\n\t// Re-create `metadata` because it will be selecting a `country`.\r\n\tmetadata = new Metadata(metadata)\r\n\r\n\t// const matchingCountries = []\r\n\r\n\tfor (const country of countries) {\r\n\t\tmetadata.country(country)\r\n\t\t// \"Leading digits\" patterns are only defined for about 20% of all countries.\r\n\t\t// By definition, matching \"leading digits\" is a sufficient but not a necessary\r\n\t\t// condition for a phone number to belong to a country.\r\n\t\t// The point of \"leading digits\" check is that it's the fastest one to get a match.\r\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\r\n\t\t// I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\r\n\t\t// because of the intended use of that feature.\r\n\t\tif (metadata.leadingDigits()) {\r\n\t\t\tif (nationalPhoneNumber &&\r\n\t\t\t\tnationalPhoneNumber.search(metadata.leadingDigits()) === 0) {\r\n\t\t\t\treturn country\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Else perform full validation with all of those\r\n\t\t// fixed-line/mobile/etc regular expressions.\r\n\t\telse if (getNumberType({ phone: nationalPhoneNumber, country }, undefined, metadata.metadata)) {\r\n\t\t\t// If both the `defaultCountry` and the \"main\" one match the phone number,\r\n\t\t\t// don't prefer the `defaultCountry` over the \"main\" one.\r\n\t\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154\r\n\t\t\treturn country\r\n\t\t\t// // If the `defaultCountry` is among the `matchingCountries` then return it.\r\n\t\t\t// if (defaultCountry) {\r\n\t\t\t// \tif (country === defaultCountry) {\r\n\t\t\t// \t\treturn country\r\n\t\t\t// \t}\r\n\t\t\t// \tmatchingCountries.push(country)\r\n\t\t\t// } else {\r\n\t\t\t// \treturn country\r\n\t\t\t// }\r\n\t\t}\r\n\t}\r\n\r\n\t// // Return the first (\"main\") one of the `matchingCountries`.\r\n\t// if (matchingCountries.length > 0) {\r\n\t// \treturn matchingCountries[0]\r\n\t// }\r\n}"],"mappings":";;;;;;AAAA,OAAOA,QAAP,MAAqB,gBAArB;AACA,OAAOC,aAAP,MAA0B,oBAA1B;AAEA,eAAe,SAASC,0BAAT,CAAoCC,mBAApC,QAIZ;EAAA,IAHFC,SAGE,QAHFA,SAGE;EAAA,IAFFC,cAEE,QAFFA,cAEE;EAAA,IADFC,QACE,QADFA,QACE;EACF;EACAA,QAAQ,GAAG,IAAIN,QAAJ,CAAaM,QAAb,CAAX,CAFE,CAIF;;EAEA,qDAAsBF,SAAtB,wCAAiC;IAAA,IAAtBG,OAAsB;IAChCD,QAAQ,CAACC,OAAT,CAAiBA,OAAjB,EADgC,CAEhC;IACA;IACA;IACA;IACA;IACA;IACA;;IACA,IAAID,QAAQ,CAACE,aAAT,EAAJ,EAA8B;MAC7B,IAAIL,mBAAmB,IACtBA,mBAAmB,CAACM,MAApB,CAA2BH,QAAQ,CAACE,aAAT,EAA3B,MAAyD,CAD1D,EAC6D;QAC5D,OAAOD,OAAP;MACA;IACD,CALD,CAMA;IACA;IAPA,KAQK,IAAIN,aAAa,CAAC;MAAES,KAAK,EAAEP,mBAAT;MAA8BI,OAAO,EAAPA;IAA9B,CAAD,EAA0CI,SAA1C,EAAqDL,QAAQ,CAACA,QAA9D,CAAjB,EAA0F;MAC9F;MACA;MACA;MACA,OAAOC,OAAP,CAJ8F,CAK9F;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;IACA;EACD,CAtCC,CAwCF;EACA;EACA;EACA;;AACA"}
package/es6/parse.test.js CHANGED
@@ -586,18 +586,22 @@ describe('parse', function () {
586
586
  });
587
587
  }).to["throw"]('NOT_A_NUMBER');
588
588
  });
589
- it('should choose `defaultCountry` (non-"main" one) when multiple countries match the number', function () {
589
+ it('should not choose `defaultCountry` over the "main" one when both the `defaultCountry` and the "main" one match the phone number', function () {
590
+ // This phone number matches both US and CA because they have the same
591
+ // regular expression for some weird reason.
590
592
  // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103
591
593
  var phoneNumber = parseNumber('8004001000', {
592
594
  defaultCountry: 'CA',
593
595
  v2: true
594
596
  });
595
- phoneNumber.country.should.equal('CA');
597
+ phoneNumber.country.should.not.equal('CA');
598
+ phoneNumber.country.should.equal('US'); // This phone number is specific to CA.
599
+
596
600
  var phoneNumber2 = parseNumber('4389999999', {
597
601
  defaultCountry: 'US',
598
602
  v2: true
599
603
  });
600
- phoneNumber.country.should.equal('CA');
604
+ phoneNumber2.country.should.equal('CA');
601
605
  });
602
606
  });
603
607
  //# sourceMappingURL=parse.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse.test.js","names":["metadata","type","_parseNumber","Metadata","parseNumber","parameters","length","push","undefined","defaultCountry","apply","USE_NON_GEOGRAPHIC_COUNTRY_CODE","describe","it","should","deep","equal","country","phone","extended","countryCallingCode","carrierCode","ext","valid","possible","thrower","defaultCallingCode","expect","to","be","v2","phoneNumber","phoneNumber2"],"sources":["../source/parse.test.js"],"sourcesContent":["import metadata from '../metadata.min.json' assert { type: 'json' }\r\nimport _parseNumber from './parse.js'\r\nimport Metadata from './metadata.js'\r\n\r\nfunction parseNumber(...parameters) {\r\n\tif (parameters.length < 2) {\r\n\t\t// `options` parameter.\r\n\t\tparameters.push(undefined)\r\n\t}\r\n\t// Convert default country argument to an `options` object.\r\n\tif (typeof parameters[1] === 'string') {\r\n\t\tparameters[1] = {\r\n\t\t\t...parameters[2],\r\n\t\t\tdefaultCountry: parameters[1]\r\n\t\t}\r\n\t}\r\n\tif (parameters[2]) {\r\n\t\tparameters[2] = metadata\r\n\t} else {\r\n\t\tparameters.push(metadata)\r\n\t}\r\n\treturn _parseNumber.apply(this, parameters)\r\n}\r\n\r\nconst USE_NON_GEOGRAPHIC_COUNTRY_CODE = false\r\n\r\ndescribe('parse', () => {\r\n\tit('should not parse invalid phone numbers', () => {\r\n\t\t// Too short.\r\n\t\tparseNumber('+7 (800) 55-35-35').should.deep.equal({})\r\n\t\t// Too long.\r\n\t\tparseNumber('+7 (800) 55-35-35-55').should.deep.equal({})\r\n\r\n\t\tparseNumber('+7 (800) 55-35-35', 'US').should.deep.equal({})\r\n\t\tparseNumber('(800) 55 35 35', { defaultCountry: 'RU' }).should.deep.equal({})\r\n\t\tparseNumber('+1 187 215 5230', 'US').should.deep.equal({})\r\n\r\n\t\tparseNumber('911231231', 'BE').should.deep.equal({})\r\n\t})\r\n\r\n\tit('should parse valid phone numbers', () => {\r\n\t\t// Instant loans\r\n\t\t// https://www.youtube.com/watch?v=6e1pMrYH5jI\r\n\t\t//\r\n\t\t// Restrict to RU\r\n\t\tparseNumber('Phone: 8 (800) 555 35 35.', 'RU').should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\t\t// International format\r\n\t\tparseNumber('Phone: +7 (800) 555-35-35.').should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\t\t// // Restrict to US, but not a US country phone code supplied\r\n\t\t// parseNumber('+7 (800) 555-35-35', 'US').should.deep.equal({})\r\n\t\t// Restrict to RU\r\n\t\tparseNumber('(800) 555 35 35', 'RU').should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\t\t// Default to RU\r\n\t\tparseNumber('8 (800) 555 35 35', { defaultCountry: 'RU' }).should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\r\n\t\t// Gangster partyline\r\n\t\tparseNumber('+1-213-373-4253').should.deep.equal({ country: 'US', phone: '2133734253' })\r\n\r\n\t\t// Switzerland (just in case)\r\n\t\tparseNumber('044 668 18 00', 'CH').should.deep.equal({ country: 'CH', phone: '446681800' })\r\n\r\n\t\t// China, Beijing\r\n\t\tparseNumber('010-852644821', 'CN').should.deep.equal({ country: 'CN', phone: '10852644821' })\r\n\r\n\t\t// France\r\n\t\tparseNumber('+33169454850').should.deep.equal({ country: 'FR', phone: '169454850' })\r\n\r\n\t\t// UK (Jersey)\r\n\t\tparseNumber('+44 7700 300000').should.deep.equal({ country: 'JE', phone: '7700300000' })\r\n\r\n\t\t// KZ\r\n\t\tparseNumber('+7 702 211 1111').should.deep.equal({ country: 'KZ', phone: '7022111111' })\r\n\r\n\t\t// Brazil\r\n\t\tparseNumber('11987654321', 'BR').should.deep.equal({ country: 'BR', phone: '11987654321' })\r\n\r\n\t\t// Long country phone code.\r\n\t\tparseNumber('+212659777777').should.deep.equal({ country: 'MA', phone: '659777777' })\r\n\r\n\t\t// No country could be derived.\r\n\t\t// parseNumber('+212569887076').should.deep.equal({ countryPhoneCode: '212', phone: '569887076' })\r\n\r\n\t\t// GB. Moible numbers starting 07624* are Isle of Man.\r\n\t\tparseNumber('07624369230', 'GB').should.deep.equal({ country: 'IM', phone: '7624369230' })\r\n\t})\r\n\r\n\tit('should parse possible numbers', () => {\r\n\t\t// Invalid phone number for a given country.\r\n\t\tparseNumber('1112223344', 'RU', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '1112223344',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// International phone number.\r\n\t\t// Several countries with the same country phone code.\r\n\t\tparseNumber('+71112223344').should.deep.equal({})\r\n\t\tparseNumber('+71112223344', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : undefined,\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '1112223344',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// International phone number.\r\n\t\t// Single country with the given country phone code.\r\n\t\tparseNumber('+33011222333', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'FR',\r\n\t\t\tcountryCallingCode : '33',\r\n\t\t\tphone : '011222333',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// Too short.\r\n\t\t// Won't strip national prefix `8` because otherwise the number would be too short.\r\n\t\tparseNumber('+7 (800) 55-35-35', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '800553535',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : false\r\n\t\t})\r\n\r\n\t\t// Too long.\r\n\t\tparseNumber('+1 213 37342530', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : undefined,\r\n\t\t\tcountryCallingCode : '1',\r\n\t\t\tphone : '21337342530',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : false\r\n\t\t})\r\n\r\n\t\t// No national number to be parsed.\r\n\t\tparseNumber('+996', { extended: true }).should.deep.equal({\r\n\t\t\t// countryCallingCode : '996'\r\n\t\t})\r\n\r\n\t\t// Valid number.\r\n\t\tparseNumber('+78005553535', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '8005553535',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : true,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/211\r\n\t\tparseNumber('+966', { extended: true }).should.deep.equal({})\r\n\t\tparseNumber('+9664', { extended: true }).should.deep.equal({})\r\n\t\tparseNumber('+96645', { extended: true }).should.deep.equal({\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\tphone : '45',\r\n\t\t\text : undefined,\r\n\t\t\tcountry : 'SA',\r\n\t\t\tcountryCallingCode : '966',\r\n\t\t\tpossible : false,\r\n\t\t\tvalid : false\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse non-European digits', () => {\r\n\t\tparseNumber('+١٢١٢٢٣٢٣٢٣٢').should.deep.equal({ country: 'US', phone: '2122323232' })\r\n\t})\r\n\r\n\tit('should work in edge cases', () => {\r\n\t\tlet thrower\r\n\r\n\t\t// No input\r\n\t\tparseNumber('').should.deep.equal({})\r\n\r\n\t\t// No country phone code\r\n\t\tparseNumber('+').should.deep.equal({})\r\n\r\n\t\t// No country at all (non international number and no explicit country code)\r\n\t\tparseNumber('123').should.deep.equal({})\r\n\r\n\t\t// No country metadata for this `require` country code\r\n\t\tthrower = () => parseNumber('123', 'ZZ')\r\n\t\tthrower.should.throw('Unknown country')\r\n\r\n\t\t// No country metadata for this `default` country code\r\n\t\tthrower = () => parseNumber('123', { defaultCountry: 'ZZ' })\r\n\t\tthrower.should.throw('Unknown country')\r\n\r\n\t\t// Invalid country phone code\r\n\t\tparseNumber('+210').should.deep.equal({})\r\n\r\n\t\t// Invalid country phone code (extended parsing mode)\r\n\t\tparseNumber('+210', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Too short of a number.\r\n\t\tparseNumber('1', 'US', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Too long of a number.\r\n\t\tparseNumber('1111111111111111111', 'RU', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Not a number.\r\n\t\tparseNumber('abcdefg', 'US', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Country phone code beginning with a '0'\r\n\t\tparseNumber('+0123').should.deep.equal({})\r\n\r\n\t\t// Barbados NANPA phone number\r\n\t\tparseNumber('+12460000000').should.deep.equal({ country: 'BB', phone: '2460000000' })\r\n\r\n\t\t// // A case when country (restricted to) is not equal\r\n\t\t// // to the one parsed out of an international number.\r\n\t\t// parseNumber('+1-213-373-4253', 'RU').should.deep.equal({})\r\n\r\n\t\t// National (significant) number too short\r\n\t\tparseNumber('2', 'US').should.deep.equal({})\r\n\r\n\t\t// National (significant) number too long\r\n\t\tparseNumber('222222222222222222', 'US').should.deep.equal({})\r\n\r\n\t\t// No `national_prefix_for_parsing`\r\n\t\tparseNumber('41111', 'AC').should.deep.equal({ country: 'AC', phone: '41111'})\r\n\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/235\r\n\t\t// `matchesEntirely()` bug fix.\r\n\t\tparseNumber('+4915784846111‬').should.deep.equal({ country: 'DE', phone: '15784846111' })\r\n\r\n\t\t// No metadata\r\n\t\tthrower = () => _parseNumber('')\r\n\t\tthrower.should.throw('`metadata` argument not passed')\r\n\r\n\t\t// // Numerical `value`\r\n\t\t// thrower = () => parseNumber(2141111111, 'US')\r\n\t\t// thrower.should.throw('A text for parsing must be a string.')\r\n\r\n\t\t// Input string too long.\r\n\t\tparseNumber('8005553535 ', 'RU').should.deep.equal({})\r\n\t})\r\n\r\n\tit('should parse phone number extensions', () => {\r\n\t\t// \"ext\"\r\n\t\tparseNumber('2134567890 ext 123', 'US').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890',\r\n\t\t\text : '123'\r\n\t\t})\r\n\r\n\t\t// \"ext.\"\r\n\t\tparseNumber('+12134567890 ext. 12345', 'US').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890',\r\n\t\t\text : '12345'\r\n\t\t})\r\n\r\n\t\t// \"доб.\"\r\n\t\tparseNumber('+78005553535 доб. 1234', 'RU').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '1234'\r\n\t\t})\r\n\r\n\t\t// \"#\"\r\n\t\tparseNumber('+12134567890#1234').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890',\r\n\t\t\text : '1234'\r\n\t\t})\r\n\r\n\t\t// \"x\"\r\n\t\tparseNumber('+78005553535 x1234').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '1234'\r\n\t\t})\r\n\r\n\t\t// Not a valid extension\r\n\t\tparseNumber('2134567890 ext. abc', 'US').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse RFC 3966 phone numbers', () => {\r\n\t\tparseNumber('tel:+78005553535;ext=123').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '123'\r\n\t\t})\r\n\r\n\t\t// Should parse \"visual separators\".\r\n\t\tparseNumber('tel:+7(800)555-35.35;ext=123').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '123'\r\n\t\t})\r\n\r\n\t\t// Invalid number.\r\n\t\tparseNumber('tel:+7x8005553535;ext=123').should.deep.equal({})\r\n\t})\r\n\r\n\tit('should parse invalid international numbers even if they are invalid', () => {\r\n\t\tparseNumber('+7(8)8005553535', 'RU').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse carrier codes', () => {\r\n\t\tparseNumber('0 15 21 5555-5555', 'BR', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'BR',\r\n\t\t\tcountryCallingCode : '55',\r\n\t\t\tphone : '2155555555',\r\n\t\t\tcarrierCode : '15',\r\n\t\t\text : undefined,\r\n\t\t\tvalid : true,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse IDD prefixes', () => {\r\n\t\tparseNumber('011 61 2 3456 7890', 'US').should.deep.equal({\r\n\t\t\tphone : '234567890',\r\n\t\t\tcountry : 'AU'\r\n\t\t})\r\n\r\n\t\tparseNumber('011 61 2 3456 7890', 'FR').should.deep.equal({})\r\n\r\n\t\tparseNumber('00 61 2 3456 7890', 'US').should.deep.equal({})\r\n\r\n\t\tparseNumber('810 61 2 3456 7890', 'RU').should.deep.equal({\r\n\t\t\tphone : '234567890',\r\n\t\t\tcountry : 'AU'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should work with v2 API', () => {\r\n\t\tparseNumber('+99989160151539')\r\n\t})\r\n\r\n\tit('should work with Argentina numbers', () => {\r\n\t\t// The same mobile number is written differently\r\n\t\t// in different formats in Argentina:\r\n\t\t// `9` gets prepended in international format.\r\n\t\tparseNumber('+54 9 3435 55 1212').should.deep.equal({\r\n\t\t\tcountry: 'AR',\r\n\t\t\tphone: '93435551212'\r\n\t\t})\r\n\t\tparseNumber('0343 15-555-1212', 'AR').should.deep.equal({\r\n\t\t\tcountry: 'AR',\r\n\t\t\tphone: '93435551212'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should work with Mexico numbers', () => {\r\n\t\t// Fixed line.\r\n\t\tparseNumber('+52 449 978 0001').should.deep.equal({\r\n\t\t\tcountry: 'MX',\r\n\t\t\tphone: '4499780001'\r\n\t\t})\r\n\t\t// \"Dialling tokens 01, 02, 044, 045 and 1 are removed as they are\r\n\t\t// no longer valid since August 2019.\"\r\n\t\t//\r\n\t\t// parseNumber('01 (449)978-0001', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '4499780001'\r\n\t\t// })\r\n\t\tparseNumber('(449)978-0001', 'MX').should.deep.equal({\r\n\t\t\tcountry: 'MX',\r\n\t\t\tphone: '4499780001'\r\n\t\t})\r\n\t\t// \"Dialling tokens 01, 02, 044, 045 and 1 are removed as they are\r\n\t\t// no longer valid since August 2019.\"\r\n\t\t//\r\n\t\t// // Mobile.\r\n\t\t// // `1` is prepended before area code to mobile numbers in international format.\r\n\t\t// parseNumber('+52 1 33 1234-5678', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '3312345678'\r\n\t\t// })\r\n\t\tparseNumber('+52 33 1234-5678', 'MX').should.deep.equal({\r\n\t\t\tcountry: 'MX',\r\n\t\t\tphone: '3312345678'\r\n\t\t})\r\n\t\t// \"Dialling tokens 01, 02, 044, 045 and 1 are removed as they are\r\n\t\t// no longer valid since August 2019.\"\r\n\t\t//\r\n\t\t// parseNumber('044 (33) 1234-5678', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '3312345678'\r\n\t\t// })\r\n\t\t// parseNumber('045 33 1234-5678', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '3312345678'\r\n\t\t// })\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers', () => {\r\n\t\tparseNumber('+870773111632').should.deep.equal(\r\n\t\t\tUSE_NON_GEOGRAPHIC_COUNTRY_CODE ?\r\n\t\t\t{\r\n\t\t\t\tcountry: '001',\r\n\t\t\t\tphone: '773111632'\r\n\t\t\t} :\r\n\t\t\t{}\r\n\t\t)\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers (default country code)', () => {\r\n\t\tparseNumber('773111632', { defaultCallingCode: '870' }).should.deep.equal(\r\n\t\t\tUSE_NON_GEOGRAPHIC_COUNTRY_CODE ?\r\n\t\t\t{\r\n\t\t\t\tcountry: '001',\r\n\t\t\t\tphone: '773111632'\r\n\t\t\t} :\r\n\t\t\t{}\r\n\t\t)\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers (extended)', () => {\r\n\t\tparseNumber('+870773111632', { extended: true }).should.deep.equal({\r\n\t\t\tcountry: USE_NON_GEOGRAPHIC_COUNTRY_CODE ? '001' : undefined,\r\n\t\t\tcountryCallingCode: '870',\r\n\t\t\tphone: '773111632',\r\n\t\t\tcarrierCode: undefined,\r\n\t\t\text: undefined,\r\n\t\t\tpossible: true,\r\n\t\t\tvalid: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers (default country code) (extended)', () => {\r\n\t\tparseNumber('773111632', { defaultCallingCode: '870', extended: true }).should.deep.equal({\r\n\t\t\tcountry: USE_NON_GEOGRAPHIC_COUNTRY_CODE ? '001' : undefined,\r\n\t\t\tcountryCallingCode: '870',\r\n\t\t\tphone: '773111632',\r\n\t\t\tcarrierCode: undefined,\r\n\t\t\text: undefined,\r\n\t\t\tpossible: true,\r\n\t\t\tvalid: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('shouldn\\'t crash when invalid `defaultCallingCode` is passed', () => {\r\n\t\texpect(() => parseNumber('773111632', { defaultCallingCode: '999' }))\r\n\t\t\t.to.throw('Unknown calling code')\r\n\t})\r\n\r\n\tit('shouldn\\'t set `country` when there\\'s no `defaultCountry` and `defaultCallingCode` is not of a \"non-geographic entity\"', () => {\r\n\t\tparseNumber('88005553535', { defaultCallingCode: '7' }).should.deep.equal({\r\n\t\t\tcountry: 'RU',\r\n\t\t\tphone: '8005553535'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should correctly parse numbers starting with the same digit as the national prefix', () => {\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/373\r\n\t\t// `BY`'s `national_prefix` is `8`.\r\n\t\tparseNumber('+37582004910060').should.deep.equal({\r\n\t\t\tcountry: 'BY',\r\n\t\t\tphone: '82004910060'\r\n\t\t});\r\n\t})\r\n\r\n\tit('should autocorrect numbers without a leading +', () => {\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/376\r\n\t\tparseNumber('375447521111', 'BY').should.deep.equal({\r\n\t\t\tcountry: 'BY',\r\n\t\t\tphone: '447521111'\r\n\t\t});\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/316\r\n\t\tparseNumber('33612902554', 'FR').should.deep.equal({\r\n\t\t\tcountry: 'FR',\r\n\t\t\tphone: '612902554'\r\n\t\t});\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/375\r\n\t\tparseNumber('61438331999', 'AU').should.deep.equal({\r\n\t\t\tcountry: 'AU',\r\n\t\t\tphone: '438331999'\r\n\t\t});\r\n\t\t// A case when `49` is a country calling code of a number without a leading `+`.\r\n\t\tparseNumber('4930123456', 'DE').should.deep.equal({\r\n\t\t\tcountry: 'DE',\r\n\t\t\tphone: '30123456'\r\n\t\t});\r\n\t\t// A case when `49` is a valid area code.\r\n\t\tparseNumber('4951234567890', 'DE').should.deep.equal({\r\n\t\t\tcountry: 'DE',\r\n\t\t\tphone: '4951234567890'\r\n\t\t});\r\n\t})\r\n\r\n\tit('should parse extensions (long extensions with explicitl abels)', () => {\r\n\t\t// Test lower and upper limits of extension lengths for each type of label.\r\n\r\n\t\t// Firstly, when in RFC format: PhoneNumberUtil.extLimitAfterExplicitLabel\r\n\t\tparseNumber('33316005 ext 0', 'NZ').ext.should.equal('0')\r\n\t\tparseNumber('33316005 ext 01234567890123456789', 'NZ').ext.should.equal('01234567890123456789')\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('33316005 ext 012345678901234567890', 'NZ').ext).to.be.undefined\r\n\r\n\t\t// Explicit extension label.\r\n\t\tparseNumber('03 3316005ext:1', 'NZ').ext.should.equal('1')\r\n\t\tparseNumber('03 3316005 xtn:12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 extension\\t12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 xtensio:12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 xtensión, 12345678901234567890#', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005extension.12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 доб:12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('03 3316005 extension 123456789012345678901', 'NZ').ext).to.be.undefined\r\n\t})\r\n\r\n\tit('should parse extensions (long extensions with auto dialling labels)', () => {\r\n\t\tparseNumber('+12679000000,,123456789012345#').ext.should.equal('123456789012345')\r\n\t\tparseNumber('+12679000000;123456789012345#').ext.should.equal('123456789012345')\r\n\t\tparseNumber('+442034000000,,123456789#').ext.should.equal('123456789')\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('+12679000000,,1234567890123456#').ext).to.be.undefined\r\n\t})\r\n\r\n\tit('should parse extensions (short extensions with ambiguous characters)', () => {\r\n\t\tparseNumber('03 3316005 x 123456789', 'NZ').ext.should.equal('123456789')\r\n\t\tparseNumber('03 3316005 x. 123456789', 'NZ').ext.should.equal('123456789')\r\n\t\tparseNumber('03 3316005 #123456789#', 'NZ').ext.should.equal('123456789')\r\n\t\tparseNumber('03 3316005 ~ 123456789', 'NZ').ext.should.equal('123456789')\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('03 3316005 ~ 1234567890', 'NZ').ext).to.be.undefined\r\n\t})\r\n\r\n\tit('should parse extensions (short extensions when not sure of label)', () => {\r\n\t\tparseNumber('+1123-456-7890 666666#', { v2: true }).ext.should.equal('666666')\r\n\t\tparseNumber('+11234567890-6#', { v2: true }).ext.should.equal('6')\r\n\t\t// Extension too long.\r\n\t\texpect(() => parseNumber('+1123-456-7890 7777777#', { v2: true })).to.throw('NOT_A_NUMBER')\r\n\t})\r\n\r\n\tit('should choose `defaultCountry` (non-\"main\" one) when multiple countries match the number', () => {\r\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103\r\n\t\tconst phoneNumber = parseNumber('8004001000', { defaultCountry: 'CA', v2: true })\r\n\t\tphoneNumber.country.should.equal('CA')\r\n\r\n\t\tconst phoneNumber2 = parseNumber('4389999999', { defaultCountry: 'US', v2: true })\r\n\t\tphoneNumber.country.should.equal('CA')\r\n\t})\r\n})"],"mappings":";;;;;;AAAA,OAAOA,QAAP,MAAqB,sBAArB,UAAqDC,IAAI,EAAE,MAA3D;AACA,OAAOC,YAAP,MAAyB,YAAzB;AACA,OAAOC,QAAP,MAAqB,eAArB;;AAEA,SAASC,WAAT,GAAoC;EAAA,kCAAZC,UAAY;IAAZA,UAAY;EAAA;;EACnC,IAAIA,UAAU,CAACC,MAAX,GAAoB,CAAxB,EAA2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IAEA,IAAMgB,YAAY,GAAG5B,WAAW,CAAC,YAAD,EAAe;MAAEK,cAAc,EAAE,IAAlB;MAAwBqB,EAAE,EAAE;IAA5B,CAAf,CAAhC;IACAC,WAAW,CAACd,OAAZ,CAAoBH,MAApB,CAA2BE,KAA3B,CAAiC,IAAjC;EACA,CAPC,CAAF;AAQA,CAlhBO,CAAR"}
1
+ {"version":3,"file":"parse.test.js","names":["metadata","type","_parseNumber","Metadata","parseNumber","parameters","length","push","undefined","defaultCountry","apply","USE_NON_GEOGRAPHIC_COUNTRY_CODE","describe","it","should","deep","equal","country","phone","extended","countryCallingCode","carrierCode","ext","valid","possible","thrower","defaultCallingCode","expect","to","be","v2","phoneNumber","not","phoneNumber2"],"sources":["../source/parse.test.js"],"sourcesContent":["import metadata from '../metadata.min.json' assert { type: 'json' }\r\nimport _parseNumber from './parse.js'\r\nimport Metadata from './metadata.js'\r\n\r\nfunction parseNumber(...parameters) {\r\n\tif (parameters.length < 2) {\r\n\t\t// `options` parameter.\r\n\t\tparameters.push(undefined)\r\n\t}\r\n\t// Convert default country argument to an `options` object.\r\n\tif (typeof parameters[1] === 'string') {\r\n\t\tparameters[1] = {\r\n\t\t\t...parameters[2],\r\n\t\t\tdefaultCountry: parameters[1]\r\n\t\t}\r\n\t}\r\n\tif (parameters[2]) {\r\n\t\tparameters[2] = metadata\r\n\t} else {\r\n\t\tparameters.push(metadata)\r\n\t}\r\n\treturn _parseNumber.apply(this, parameters)\r\n}\r\n\r\nconst USE_NON_GEOGRAPHIC_COUNTRY_CODE = false\r\n\r\ndescribe('parse', () => {\r\n\tit('should not parse invalid phone numbers', () => {\r\n\t\t// Too short.\r\n\t\tparseNumber('+7 (800) 55-35-35').should.deep.equal({})\r\n\t\t// Too long.\r\n\t\tparseNumber('+7 (800) 55-35-35-55').should.deep.equal({})\r\n\r\n\t\tparseNumber('+7 (800) 55-35-35', 'US').should.deep.equal({})\r\n\t\tparseNumber('(800) 55 35 35', { defaultCountry: 'RU' }).should.deep.equal({})\r\n\t\tparseNumber('+1 187 215 5230', 'US').should.deep.equal({})\r\n\r\n\t\tparseNumber('911231231', 'BE').should.deep.equal({})\r\n\t})\r\n\r\n\tit('should parse valid phone numbers', () => {\r\n\t\t// Instant loans\r\n\t\t// https://www.youtube.com/watch?v=6e1pMrYH5jI\r\n\t\t//\r\n\t\t// Restrict to RU\r\n\t\tparseNumber('Phone: 8 (800) 555 35 35.', 'RU').should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\t\t// International format\r\n\t\tparseNumber('Phone: +7 (800) 555-35-35.').should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\t\t// // Restrict to US, but not a US country phone code supplied\r\n\t\t// parseNumber('+7 (800) 555-35-35', 'US').should.deep.equal({})\r\n\t\t// Restrict to RU\r\n\t\tparseNumber('(800) 555 35 35', 'RU').should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\t\t// Default to RU\r\n\t\tparseNumber('8 (800) 555 35 35', { defaultCountry: 'RU' }).should.deep.equal({ country: 'RU', phone: '8005553535' })\r\n\r\n\t\t// Gangster partyline\r\n\t\tparseNumber('+1-213-373-4253').should.deep.equal({ country: 'US', phone: '2133734253' })\r\n\r\n\t\t// Switzerland (just in case)\r\n\t\tparseNumber('044 668 18 00', 'CH').should.deep.equal({ country: 'CH', phone: '446681800' })\r\n\r\n\t\t// China, Beijing\r\n\t\tparseNumber('010-852644821', 'CN').should.deep.equal({ country: 'CN', phone: '10852644821' })\r\n\r\n\t\t// France\r\n\t\tparseNumber('+33169454850').should.deep.equal({ country: 'FR', phone: '169454850' })\r\n\r\n\t\t// UK (Jersey)\r\n\t\tparseNumber('+44 7700 300000').should.deep.equal({ country: 'JE', phone: '7700300000' })\r\n\r\n\t\t// KZ\r\n\t\tparseNumber('+7 702 211 1111').should.deep.equal({ country: 'KZ', phone: '7022111111' })\r\n\r\n\t\t// Brazil\r\n\t\tparseNumber('11987654321', 'BR').should.deep.equal({ country: 'BR', phone: '11987654321' })\r\n\r\n\t\t// Long country phone code.\r\n\t\tparseNumber('+212659777777').should.deep.equal({ country: 'MA', phone: '659777777' })\r\n\r\n\t\t// No country could be derived.\r\n\t\t// parseNumber('+212569887076').should.deep.equal({ countryPhoneCode: '212', phone: '569887076' })\r\n\r\n\t\t// GB. Moible numbers starting 07624* are Isle of Man.\r\n\t\tparseNumber('07624369230', 'GB').should.deep.equal({ country: 'IM', phone: '7624369230' })\r\n\t})\r\n\r\n\tit('should parse possible numbers', () => {\r\n\t\t// Invalid phone number for a given country.\r\n\t\tparseNumber('1112223344', 'RU', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '1112223344',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// International phone number.\r\n\t\t// Several countries with the same country phone code.\r\n\t\tparseNumber('+71112223344').should.deep.equal({})\r\n\t\tparseNumber('+71112223344', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : undefined,\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '1112223344',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// International phone number.\r\n\t\t// Single country with the given country phone code.\r\n\t\tparseNumber('+33011222333', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'FR',\r\n\t\t\tcountryCallingCode : '33',\r\n\t\t\tphone : '011222333',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// Too short.\r\n\t\t// Won't strip national prefix `8` because otherwise the number would be too short.\r\n\t\tparseNumber('+7 (800) 55-35-35', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '800553535',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : false\r\n\t\t})\r\n\r\n\t\t// Too long.\r\n\t\tparseNumber('+1 213 37342530', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : undefined,\r\n\t\t\tcountryCallingCode : '1',\r\n\t\t\tphone : '21337342530',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : false,\r\n\t\t\tpossible : false\r\n\t\t})\r\n\r\n\t\t// No national number to be parsed.\r\n\t\tparseNumber('+996', { extended: true }).should.deep.equal({\r\n\t\t\t// countryCallingCode : '996'\r\n\t\t})\r\n\r\n\t\t// Valid number.\r\n\t\tparseNumber('+78005553535', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tcountryCallingCode : '7',\r\n\t\t\tphone : '8005553535',\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\text : undefined,\r\n\t\t\tvalid : true,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/211\r\n\t\tparseNumber('+966', { extended: true }).should.deep.equal({})\r\n\t\tparseNumber('+9664', { extended: true }).should.deep.equal({})\r\n\t\tparseNumber('+96645', { extended: true }).should.deep.equal({\r\n\t\t\tcarrierCode : undefined,\r\n\t\t\tphone : '45',\r\n\t\t\text : undefined,\r\n\t\t\tcountry : 'SA',\r\n\t\t\tcountryCallingCode : '966',\r\n\t\t\tpossible : false,\r\n\t\t\tvalid : false\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse non-European digits', () => {\r\n\t\tparseNumber('+١٢١٢٢٣٢٣٢٣٢').should.deep.equal({ country: 'US', phone: '2122323232' })\r\n\t})\r\n\r\n\tit('should work in edge cases', () => {\r\n\t\tlet thrower\r\n\r\n\t\t// No input\r\n\t\tparseNumber('').should.deep.equal({})\r\n\r\n\t\t// No country phone code\r\n\t\tparseNumber('+').should.deep.equal({})\r\n\r\n\t\t// No country at all (non international number and no explicit country code)\r\n\t\tparseNumber('123').should.deep.equal({})\r\n\r\n\t\t// No country metadata for this `require` country code\r\n\t\tthrower = () => parseNumber('123', 'ZZ')\r\n\t\tthrower.should.throw('Unknown country')\r\n\r\n\t\t// No country metadata for this `default` country code\r\n\t\tthrower = () => parseNumber('123', { defaultCountry: 'ZZ' })\r\n\t\tthrower.should.throw('Unknown country')\r\n\r\n\t\t// Invalid country phone code\r\n\t\tparseNumber('+210').should.deep.equal({})\r\n\r\n\t\t// Invalid country phone code (extended parsing mode)\r\n\t\tparseNumber('+210', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Too short of a number.\r\n\t\tparseNumber('1', 'US', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Too long of a number.\r\n\t\tparseNumber('1111111111111111111', 'RU', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Not a number.\r\n\t\tparseNumber('abcdefg', 'US', { extended: true }).should.deep.equal({})\r\n\r\n\t\t// Country phone code beginning with a '0'\r\n\t\tparseNumber('+0123').should.deep.equal({})\r\n\r\n\t\t// Barbados NANPA phone number\r\n\t\tparseNumber('+12460000000').should.deep.equal({ country: 'BB', phone: '2460000000' })\r\n\r\n\t\t// // A case when country (restricted to) is not equal\r\n\t\t// // to the one parsed out of an international number.\r\n\t\t// parseNumber('+1-213-373-4253', 'RU').should.deep.equal({})\r\n\r\n\t\t// National (significant) number too short\r\n\t\tparseNumber('2', 'US').should.deep.equal({})\r\n\r\n\t\t// National (significant) number too long\r\n\t\tparseNumber('222222222222222222', 'US').should.deep.equal({})\r\n\r\n\t\t// No `national_prefix_for_parsing`\r\n\t\tparseNumber('41111', 'AC').should.deep.equal({ country: 'AC', phone: '41111'})\r\n\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/235\r\n\t\t// `matchesEntirely()` bug fix.\r\n\t\tparseNumber('+4915784846111‬').should.deep.equal({ country: 'DE', phone: '15784846111' })\r\n\r\n\t\t// No metadata\r\n\t\tthrower = () => _parseNumber('')\r\n\t\tthrower.should.throw('`metadata` argument not passed')\r\n\r\n\t\t// // Numerical `value`\r\n\t\t// thrower = () => parseNumber(2141111111, 'US')\r\n\t\t// thrower.should.throw('A text for parsing must be a string.')\r\n\r\n\t\t// Input string too long.\r\n\t\tparseNumber('8005553535 ', 'RU').should.deep.equal({})\r\n\t})\r\n\r\n\tit('should parse phone number extensions', () => {\r\n\t\t// \"ext\"\r\n\t\tparseNumber('2134567890 ext 123', 'US').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890',\r\n\t\t\text : '123'\r\n\t\t})\r\n\r\n\t\t// \"ext.\"\r\n\t\tparseNumber('+12134567890 ext. 12345', 'US').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890',\r\n\t\t\text : '12345'\r\n\t\t})\r\n\r\n\t\t// \"доб.\"\r\n\t\tparseNumber('+78005553535 доб. 1234', 'RU').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '1234'\r\n\t\t})\r\n\r\n\t\t// \"#\"\r\n\t\tparseNumber('+12134567890#1234').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890',\r\n\t\t\text : '1234'\r\n\t\t})\r\n\r\n\t\t// \"x\"\r\n\t\tparseNumber('+78005553535 x1234').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '1234'\r\n\t\t})\r\n\r\n\t\t// Not a valid extension\r\n\t\tparseNumber('2134567890 ext. abc', 'US').should.deep.equal({\r\n\t\t\tcountry : 'US',\r\n\t\t\tphone : '2134567890'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse RFC 3966 phone numbers', () => {\r\n\t\tparseNumber('tel:+78005553535;ext=123').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '123'\r\n\t\t})\r\n\r\n\t\t// Should parse \"visual separators\".\r\n\t\tparseNumber('tel:+7(800)555-35.35;ext=123').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535',\r\n\t\t\text : '123'\r\n\t\t})\r\n\r\n\t\t// Invalid number.\r\n\t\tparseNumber('tel:+7x8005553535;ext=123').should.deep.equal({})\r\n\t})\r\n\r\n\tit('should parse invalid international numbers even if they are invalid', () => {\r\n\t\tparseNumber('+7(8)8005553535', 'RU').should.deep.equal({\r\n\t\t\tcountry : 'RU',\r\n\t\t\tphone : '8005553535'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse carrier codes', () => {\r\n\t\tparseNumber('0 15 21 5555-5555', 'BR', { extended: true }).should.deep.equal({\r\n\t\t\tcountry : 'BR',\r\n\t\t\tcountryCallingCode : '55',\r\n\t\t\tphone : '2155555555',\r\n\t\t\tcarrierCode : '15',\r\n\t\t\text : undefined,\r\n\t\t\tvalid : true,\r\n\t\t\tpossible : true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse IDD prefixes', () => {\r\n\t\tparseNumber('011 61 2 3456 7890', 'US').should.deep.equal({\r\n\t\t\tphone : '234567890',\r\n\t\t\tcountry : 'AU'\r\n\t\t})\r\n\r\n\t\tparseNumber('011 61 2 3456 7890', 'FR').should.deep.equal({})\r\n\r\n\t\tparseNumber('00 61 2 3456 7890', 'US').should.deep.equal({})\r\n\r\n\t\tparseNumber('810 61 2 3456 7890', 'RU').should.deep.equal({\r\n\t\t\tphone : '234567890',\r\n\t\t\tcountry : 'AU'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should work with v2 API', () => {\r\n\t\tparseNumber('+99989160151539')\r\n\t})\r\n\r\n\tit('should work with Argentina numbers', () => {\r\n\t\t// The same mobile number is written differently\r\n\t\t// in different formats in Argentina:\r\n\t\t// `9` gets prepended in international format.\r\n\t\tparseNumber('+54 9 3435 55 1212').should.deep.equal({\r\n\t\t\tcountry: 'AR',\r\n\t\t\tphone: '93435551212'\r\n\t\t})\r\n\t\tparseNumber('0343 15-555-1212', 'AR').should.deep.equal({\r\n\t\t\tcountry: 'AR',\r\n\t\t\tphone: '93435551212'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should work with Mexico numbers', () => {\r\n\t\t// Fixed line.\r\n\t\tparseNumber('+52 449 978 0001').should.deep.equal({\r\n\t\t\tcountry: 'MX',\r\n\t\t\tphone: '4499780001'\r\n\t\t})\r\n\t\t// \"Dialling tokens 01, 02, 044, 045 and 1 are removed as they are\r\n\t\t// no longer valid since August 2019.\"\r\n\t\t//\r\n\t\t// parseNumber('01 (449)978-0001', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '4499780001'\r\n\t\t// })\r\n\t\tparseNumber('(449)978-0001', 'MX').should.deep.equal({\r\n\t\t\tcountry: 'MX',\r\n\t\t\tphone: '4499780001'\r\n\t\t})\r\n\t\t// \"Dialling tokens 01, 02, 044, 045 and 1 are removed as they are\r\n\t\t// no longer valid since August 2019.\"\r\n\t\t//\r\n\t\t// // Mobile.\r\n\t\t// // `1` is prepended before area code to mobile numbers in international format.\r\n\t\t// parseNumber('+52 1 33 1234-5678', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '3312345678'\r\n\t\t// })\r\n\t\tparseNumber('+52 33 1234-5678', 'MX').should.deep.equal({\r\n\t\t\tcountry: 'MX',\r\n\t\t\tphone: '3312345678'\r\n\t\t})\r\n\t\t// \"Dialling tokens 01, 02, 044, 045 and 1 are removed as they are\r\n\t\t// no longer valid since August 2019.\"\r\n\t\t//\r\n\t\t// parseNumber('044 (33) 1234-5678', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '3312345678'\r\n\t\t// })\r\n\t\t// parseNumber('045 33 1234-5678', 'MX').should.deep.equal({\r\n\t\t// \tcountry: 'MX',\r\n\t\t// \tphone: '3312345678'\r\n\t\t// })\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers', () => {\r\n\t\tparseNumber('+870773111632').should.deep.equal(\r\n\t\t\tUSE_NON_GEOGRAPHIC_COUNTRY_CODE ?\r\n\t\t\t{\r\n\t\t\t\tcountry: '001',\r\n\t\t\t\tphone: '773111632'\r\n\t\t\t} :\r\n\t\t\t{}\r\n\t\t)\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers (default country code)', () => {\r\n\t\tparseNumber('773111632', { defaultCallingCode: '870' }).should.deep.equal(\r\n\t\t\tUSE_NON_GEOGRAPHIC_COUNTRY_CODE ?\r\n\t\t\t{\r\n\t\t\t\tcountry: '001',\r\n\t\t\t\tphone: '773111632'\r\n\t\t\t} :\r\n\t\t\t{}\r\n\t\t)\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers (extended)', () => {\r\n\t\tparseNumber('+870773111632', { extended: true }).should.deep.equal({\r\n\t\t\tcountry: USE_NON_GEOGRAPHIC_COUNTRY_CODE ? '001' : undefined,\r\n\t\t\tcountryCallingCode: '870',\r\n\t\t\tphone: '773111632',\r\n\t\t\tcarrierCode: undefined,\r\n\t\t\text: undefined,\r\n\t\t\tpossible: true,\r\n\t\t\tvalid: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('should parse non-geographic numbering plan phone numbers (default country code) (extended)', () => {\r\n\t\tparseNumber('773111632', { defaultCallingCode: '870', extended: true }).should.deep.equal({\r\n\t\t\tcountry: USE_NON_GEOGRAPHIC_COUNTRY_CODE ? '001' : undefined,\r\n\t\t\tcountryCallingCode: '870',\r\n\t\t\tphone: '773111632',\r\n\t\t\tcarrierCode: undefined,\r\n\t\t\text: undefined,\r\n\t\t\tpossible: true,\r\n\t\t\tvalid: true\r\n\t\t})\r\n\t})\r\n\r\n\tit('shouldn\\'t crash when invalid `defaultCallingCode` is passed', () => {\r\n\t\texpect(() => parseNumber('773111632', { defaultCallingCode: '999' }))\r\n\t\t\t.to.throw('Unknown calling code')\r\n\t})\r\n\r\n\tit('shouldn\\'t set `country` when there\\'s no `defaultCountry` and `defaultCallingCode` is not of a \"non-geographic entity\"', () => {\r\n\t\tparseNumber('88005553535', { defaultCallingCode: '7' }).should.deep.equal({\r\n\t\t\tcountry: 'RU',\r\n\t\t\tphone: '8005553535'\r\n\t\t})\r\n\t})\r\n\r\n\tit('should correctly parse numbers starting with the same digit as the national prefix', () => {\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/373\r\n\t\t// `BY`'s `national_prefix` is `8`.\r\n\t\tparseNumber('+37582004910060').should.deep.equal({\r\n\t\t\tcountry: 'BY',\r\n\t\t\tphone: '82004910060'\r\n\t\t});\r\n\t})\r\n\r\n\tit('should autocorrect numbers without a leading +', () => {\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/376\r\n\t\tparseNumber('375447521111', 'BY').should.deep.equal({\r\n\t\t\tcountry: 'BY',\r\n\t\t\tphone: '447521111'\r\n\t\t});\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/316\r\n\t\tparseNumber('33612902554', 'FR').should.deep.equal({\r\n\t\t\tcountry: 'FR',\r\n\t\t\tphone: '612902554'\r\n\t\t});\r\n\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/375\r\n\t\tparseNumber('61438331999', 'AU').should.deep.equal({\r\n\t\t\tcountry: 'AU',\r\n\t\t\tphone: '438331999'\r\n\t\t});\r\n\t\t// A case when `49` is a country calling code of a number without a leading `+`.\r\n\t\tparseNumber('4930123456', 'DE').should.deep.equal({\r\n\t\t\tcountry: 'DE',\r\n\t\t\tphone: '30123456'\r\n\t\t});\r\n\t\t// A case when `49` is a valid area code.\r\n\t\tparseNumber('4951234567890', 'DE').should.deep.equal({\r\n\t\t\tcountry: 'DE',\r\n\t\t\tphone: '4951234567890'\r\n\t\t});\r\n\t})\r\n\r\n\tit('should parse extensions (long extensions with explicitl abels)', () => {\r\n\t\t// Test lower and upper limits of extension lengths for each type of label.\r\n\r\n\t\t// Firstly, when in RFC format: PhoneNumberUtil.extLimitAfterExplicitLabel\r\n\t\tparseNumber('33316005 ext 0', 'NZ').ext.should.equal('0')\r\n\t\tparseNumber('33316005 ext 01234567890123456789', 'NZ').ext.should.equal('01234567890123456789')\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('33316005 ext 012345678901234567890', 'NZ').ext).to.be.undefined\r\n\r\n\t\t// Explicit extension label.\r\n\t\tparseNumber('03 3316005ext:1', 'NZ').ext.should.equal('1')\r\n\t\tparseNumber('03 3316005 xtn:12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 extension\\t12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 xtensio:12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 xtensión, 12345678901234567890#', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005extension.12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\t\tparseNumber('03 3316005 доб:12345678901234567890', 'NZ').ext.should.equal('12345678901234567890')\r\n\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('03 3316005 extension 123456789012345678901', 'NZ').ext).to.be.undefined\r\n\t})\r\n\r\n\tit('should parse extensions (long extensions with auto dialling labels)', () => {\r\n\t\tparseNumber('+12679000000,,123456789012345#').ext.should.equal('123456789012345')\r\n\t\tparseNumber('+12679000000;123456789012345#').ext.should.equal('123456789012345')\r\n\t\tparseNumber('+442034000000,,123456789#').ext.should.equal('123456789')\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('+12679000000,,1234567890123456#').ext).to.be.undefined\r\n\t})\r\n\r\n\tit('should parse extensions (short extensions with ambiguous characters)', () => {\r\n\t\tparseNumber('03 3316005 x 123456789', 'NZ').ext.should.equal('123456789')\r\n\t\tparseNumber('03 3316005 x. 123456789', 'NZ').ext.should.equal('123456789')\r\n\t\tparseNumber('03 3316005 #123456789#', 'NZ').ext.should.equal('123456789')\r\n\t\tparseNumber('03 3316005 ~ 123456789', 'NZ').ext.should.equal('123456789')\r\n\t\t// Extension too long.\r\n\t\texpect(parseNumber('03 3316005 ~ 1234567890', 'NZ').ext).to.be.undefined\r\n\t})\r\n\r\n\tit('should parse extensions (short extensions when not sure of label)', () => {\r\n\t\tparseNumber('+1123-456-7890 666666#', { v2: true }).ext.should.equal('666666')\r\n\t\tparseNumber('+11234567890-6#', { v2: true }).ext.should.equal('6')\r\n\t\t// Extension too long.\r\n\t\texpect(() => parseNumber('+1123-456-7890 7777777#', { v2: true })).to.throw('NOT_A_NUMBER')\r\n\t})\r\n\r\n\tit('should not choose `defaultCountry` over the \"main\" one when both the `defaultCountry` and the \"main\" one match the phone number', function() {\r\n\t\t// This phone number matches both US and CA because they have the same\r\n\t\t// regular expression for some weird reason.\r\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103\r\n\t\tconst phoneNumber = parseNumber('8004001000', { defaultCountry: 'CA', v2: true })\r\n\t\tphoneNumber.country.should.not.equal('CA')\r\n\t\tphoneNumber.country.should.equal('US')\r\n\r\n\t\t// This phone number is specific to CA.\r\n\t\tconst phoneNumber2 = parseNumber('4389999999', { defaultCountry: 'US', v2: true })\r\n\t\tphoneNumber2.country.should.equal('CA')\r\n\t})\r\n})"],"mappings":";;;;;;AAAA,OAAOA,QAAP,MAAqB,sBAArB,UAAqDC,IAAI,EAAE,MAA3D;AACA,OAAOC,YAAP,MAAyB,YAAzB;AACA,OAAOC,QAAP,MAAqB,eAArB;;AAEA,SAASC,WAAT,GAAoC;EAAA,kCAAZC,UAAY;IAAZA,UAAY;EAAA;;EACnC,IAAIA,UAAU,CAACC,MAAX,GAAoB,CAAxB,EAA2B;IAC1B;IACAD,UAAU,CAACE,IAAX,CAAgBC,SAAhB;EACA,CAJkC,CAKnC;;;EACA,IAAI,OAAOH,UAAU,CAAC,CAAD,CAAjB,KAAyB,QAA7B,EAAuC;IACtC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,WAAW,CAAC,YAAD,EAAe;MAAEK,cAAc,EAAE,IAAlB;MAAwBqB,EAAE,EAAE;IAA5B,CAAf,CAAhC;IACAG,YAAY,CAAChB,OAAb,CAAqBH,MAArB,CAA4BE,KAA5B,CAAkC,IAAlC;EACA,CAXC,CAAF;AAYA,CAthBO,CAAR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libphonenumber-js",
3
- "version": "1.11.10",
3
+ "version": "1.11.11",
4
4
  "description": "A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript",
5
5
  "main": "index.cjs",
6
6
  "module": "index.js",
@@ -1380,17 +1380,22 @@ describe('AsYouType.getNumberValue()', () => {
1380
1380
  formatter.getTemplate().should.equal('xxx xxx xxx xxx')
1381
1381
  })
1382
1382
 
1383
- it('should choose `defaultCountry` (non-"main" one) when multiple countries match the number', function() {
1383
+ it('should not choose `defaultCountry` over the "main" one when both the `defaultCountry` and the "main" one match the phone number', function() {
1384
+ // This phone number matches both US and CA because they have the same
1385
+ // regular expression for some weird reason.
1384
1386
  // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103
1385
1387
  const formatter = new AsYouType('CA')
1386
1388
  formatter.input('8004001000')
1387
- formatter.getNumber().country.should.equal('CA')
1389
+ formatter.getNumber().country.should.not.equal('CA')
1390
+ formatter.getNumber().country.should.equal('US')
1388
1391
 
1392
+ // This phone number is specific to CA.
1389
1393
  const formatter2 = new AsYouType('US')
1390
1394
  formatter2.input('4389999999')
1391
1395
  formatter2.getNumber().country.should.equal('CA')
1392
1396
 
1393
- // No country matches the national number digits.
1397
+ // This phone number doesn't belong neither to CA nor to US.
1398
+ // In fact, it doesn't belong to any country from the "NANPA" zone.
1394
1399
  const formatter3 = new AsYouType('US')
1395
1400
  formatter3.input('1111111111')
1396
1401
  formatter3.getNumber().country.should.equal('US')
@@ -9,7 +9,7 @@ export default function getCountryByNationalNumber(nationalPhoneNumber, {
9
9
  // Re-create `metadata` because it will be selecting a `country`.
10
10
  metadata = new Metadata(metadata)
11
11
 
12
- const matchingCountries = []
12
+ // const matchingCountries = []
13
13
 
14
14
  for (const country of countries) {
15
15
  metadata.country(country)
@@ -29,20 +29,24 @@ export default function getCountryByNationalNumber(nationalPhoneNumber, {
29
29
  // Else perform full validation with all of those
30
30
  // fixed-line/mobile/etc regular expressions.
31
31
  else if (getNumberType({ phone: nationalPhoneNumber, country }, undefined, metadata.metadata)) {
32
- // If the `defaultCountry` is among the `matchingCountries` then return it.
33
- if (defaultCountry) {
34
- if (country === defaultCountry) {
35
- return country
36
- }
37
- matchingCountries.push(country)
38
- } else {
39
- return country
40
- }
32
+ // If both the `defaultCountry` and the "main" one match the phone number,
33
+ // don't prefer the `defaultCountry` over the "main" one.
34
+ // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154
35
+ return country
36
+ // // If the `defaultCountry` is among the `matchingCountries` then return it.
37
+ // if (defaultCountry) {
38
+ // if (country === defaultCountry) {
39
+ // return country
40
+ // }
41
+ // matchingCountries.push(country)
42
+ // } else {
43
+ // return country
44
+ // }
41
45
  }
42
46
  }
43
47
 
44
- // Return the first ("main") one of the `matchingCountries`.
45
- if (matchingCountries.length > 0) {
46
- return matchingCountries[0]
47
- }
48
+ // // Return the first ("main") one of the `matchingCountries`.
49
+ // if (matchingCountries.length > 0) {
50
+ // return matchingCountries[0]
51
+ // }
48
52
  }
@@ -546,12 +546,16 @@ describe('parse', () => {
546
546
  expect(() => parseNumber('+1123-456-7890 7777777#', { v2: true })).to.throw('NOT_A_NUMBER')
547
547
  })
548
548
 
549
- it('should choose `defaultCountry` (non-"main" one) when multiple countries match the number', () => {
549
+ it('should not choose `defaultCountry` over the "main" one when both the `defaultCountry` and the "main" one match the phone number', function() {
550
+ // This phone number matches both US and CA because they have the same
551
+ // regular expression for some weird reason.
550
552
  // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103
551
553
  const phoneNumber = parseNumber('8004001000', { defaultCountry: 'CA', v2: true })
552
- phoneNumber.country.should.equal('CA')
554
+ phoneNumber.country.should.not.equal('CA')
555
+ phoneNumber.country.should.equal('US')
553
556
 
557
+ // This phone number is specific to CA.
554
558
  const phoneNumber2 = parseNumber('4389999999', { defaultCountry: 'US', v2: true })
555
- phoneNumber.country.should.equal('CA')
559
+ phoneNumber2.country.should.equal('CA')
556
560
  })
557
561
  })