libphonenumber-js 1.12.27 → 1.12.29
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/CHANGELOG.md +12 -0
- package/README.md +70 -42
- 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/max/metadata/metadata.max.json +1 -1
- package/max/metadata/metadata.max.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/min/metadata/metadata.min.json +1 -1
- package/min/metadata/metadata.min.json.js +1 -1
- package/mobile/metadata/metadata.mobile.json +1 -1
- package/mobile/metadata/metadata.mobile.json.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -69,6 +69,18 @@ And edit the README:
|
|
|
69
69
|
|
|
70
70
|
<!-- CHANGELOG START -->
|
|
71
71
|
|
|
72
|
+
1.12.29 / 21.11.2025
|
|
73
|
+
===================
|
|
74
|
+
|
|
75
|
+
* Updated metadata to version 9.0.19:
|
|
76
|
+
- Updated phone metadata for region code(s):
|
|
77
|
+
CF, EE, EH, GE, IN, LB, MA, OM, SG, SN, SV, UG
|
|
78
|
+
- Updated geocoding data for country calling code(s):
|
|
79
|
+
61 (en), 91 (en), 212 (en)
|
|
80
|
+
- Updated carrier data for country calling code(s):
|
|
81
|
+
34 (en), 45 (en), 65 (en), 91 (en), 236 (en), 256 (en), 503 (en), 961 (en),
|
|
82
|
+
995 (en)
|
|
83
|
+
|
|
72
84
|
1.12.26 / 7.11.2025
|
|
73
85
|
===================
|
|
74
86
|
|
package/README.md
CHANGED
|
@@ -333,44 +333,23 @@ As for "custom" metadata, it could be used in those rare cases when not all coun
|
|
|
333
333
|
|
|
334
334
|
## Definitions
|
|
335
335
|
|
|
336
|
-
###
|
|
336
|
+
### National (Significant) Number
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
"National (significant) number" is all national phone number digits, excluding the "national prefix". Examples:
|
|
339
|
+
* International number: `+1 213 373 4253`. Country: `"US"`. National number: `(213) 373-4253`. National (significant) number: `213 373 4253`
|
|
340
|
+
* Inetrnational number: `+33 1 45 45 32 45`. Country: `"FR"`. National number: `01 45 45 32 45`. Notice the `0` at the start of the national number — it's because in France they [add](https://en.wikipedia.org/wiki/Telephone_numbers_in_France) `0` "national prefix" when writing phone numbers in national format. National (significant) number: `1 45 45 32 45` (doesn't include the "national prefix").
|
|
339
341
|
|
|
340
|
-
|
|
342
|
+
### Country Calling Code
|
|
341
343
|
|
|
342
|
-
|
|
343
|
-
* `
|
|
344
|
-
|
|
345
|
-
](https://en.wikipedia.org/wiki/Saint_Helena,_Ascension_and_Tristan_da_Cunha) (`SH`). Yet, it has been assigned its own country calling code of `+247` and has its own telephone numbering plan. An unofficial code of `AC` is used for it in Google's `libphonenumber`.
|
|
346
|
-
* `AC` is also an official ["exceptional reservation"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Reserved_code_elements) code for Ascension Island in the ISO-3166-1 standard.
|
|
347
|
-
* `TA` — [Tristan da Cunha](https://en.wikipedia.org/wiki/Tristan_da_Cunha)
|
|
348
|
-
* Tristan da Cunha is officially part of [Saint Helena, Ascension and Tristan da Cunha
|
|
349
|
-
](https://en.wikipedia.org/wiki/Saint_Helena,_Ascension_and_Tristan_da_Cunha) (`SH`). For the purpose of differentiating Tristan da Cunha phone numbers from [Saint Helena](https://en.wikipedia.org/wiki/Saint_Helena) phone numbers, an unofficial code of `TA` is used for it in Google's `libphonenumber`.
|
|
350
|
-
* `TA` is also an official ["exceptional reservation"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Reserved_code_elements) code for Tristan da Cunha in the ISO-3166-1 standard.
|
|
351
|
-
* `SH` — [Saint Helena](https://en.wikipedia.org/wiki/Saint_Helena)
|
|
352
|
-
* Saint Helena is officially part of [Saint Helena, Ascension and Tristan da Cunha
|
|
353
|
-
](https://en.wikipedia.org/wiki/Saint_Helena,_Ascension_and_Tristan_da_Cunha) (`SH`). For the purpose of differentiating Saint Helena phone numbers from [Tristan da Cunha](https://en.wikipedia.org/wiki/Tristan_da_Cunha) phone numbers, the official code of `SH` is only used for Saint Helena in Google's `libphonenumber`.
|
|
354
|
-
* `XK` — [Kosovo](https://en.wikipedia.org/wiki/Kosovo)
|
|
355
|
-
* History: Kosovo separated from Yugoslavia (present Serbia, `RS`) after a civil war in 1998-1999 and a follow-up NATO's bombing of Yugoslavia in 1999. Kosovo officially (unilaterally) declared its independence from Serbia in 2008. Due to the mixed opinions on the legitimacy of NATO's intervention, about half of the United Nations member states currently support Kosovo's independence while the rest of them don't, so Kosovo is currently not assigned any ISO alpha-2 country code.
|
|
356
|
-
* Kosovo has been assigned its own country calling code of `+383` and has its own telephone numbering plan. An unofficial code of `XK` is used for it in Google's `libphonenumber`.
|
|
357
|
-
* `XK` is not an ["exceptional reservation"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Reserved_code_elements) code in the ISO-3166-1 standard, but it's still being used by various international organizations as a temporary "country code" for Kosovo.
|
|
358
|
-
|
|
359
|
-
There're also other territories with a disputed status of an independent state, whose country calling code or telephone numbering plan is different from the one used by their "official" parent territory. These territories are currently not implemented in this library but they could potentially be implemented in some future:
|
|
360
|
-
* `XA` — [Abkhazia](https://en.wikipedia.org/wiki/Abkhazia)
|
|
361
|
-
* History: Abkhazia officially (unilaterally) declared its independence from [Georgia](https://en.wikipedia.org/wiki/Georgia_(country)) (`GE`) in 1994 after a 1992-1994 civil war. The first state to officially recognize Abkhazia's independence was Russia in 2008.
|
|
362
|
-
* Abkhazia currently shares a country calling code of `+7` with Russia but has [unique prefixes](https://en.wikipedia.org/wiki/Telephone_numbers_in_Russia#Codes_assigned_to_Abkhazia) of `840` and `940`.
|
|
363
|
-
* `XA` is not an ["exceptional reservation"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Reserved_code_elements) code in the ISO-3166-1 standard, but it's still being used by some organizations as a temporary "country code" for Abkhazia.
|
|
364
|
-
* `XO` — [South Ossetia](https://en.wikipedia.org/wiki/South_Ossetia)
|
|
365
|
-
* History: South Ossetia officially (unilaterally) declared its independence from [Georgia](https://en.wikipedia.org/wiki/Georgia_(country)) (`GE`) in 1992 after a 1991–1992 civil war. The first state to officially recognize South Ossetia's independence was Russia in 2008.
|
|
366
|
-
* South Ossetia currently shares a country calling code of `+7` with Russia but has [unique prefixes](https://en.wikipedia.org/wiki/Telephone_numbers_in_Russia#Codes_assigned_to_South_Ossetia) of `850` and `929`.
|
|
367
|
-
* `XO` is not an ["exceptional reservation"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Reserved_code_elements) code in the ISO-3166-1 standard, but it's still being used by some organizations as a temporary "country code" for South Ossetia.
|
|
344
|
+
"Country calling code" is all digits between the `+` and the [national (significant) number](#national-significant-number) in a number that is written in international format. Examples:
|
|
345
|
+
* International number: `+1 213 373 4253`. Country: `"US"`. National (significant) number: `213 373 4253`. Country calling code: `1`
|
|
346
|
+
* Inetrnational number: `+33 1 45 45 32 45`. Country: `"FR"`. National (significant) number: `1 45 45 32 45`. Country calling code: `33`
|
|
368
347
|
|
|
369
|
-
|
|
348
|
+
In some cases, multiple countries could share the same "country calling code". For example, USA, Canada and some Caribbean nations [share](https://en.wikipedia.org/wiki/North_American_Numbering_Plan) the same country calling code `1`.
|
|
370
349
|
|
|
371
|
-
### Non-
|
|
350
|
+
### Non-Geographic
|
|
372
351
|
|
|
373
|
-
|
|
352
|
+
The following "calling codes" don't belong to any given country or territory and are inherently international:
|
|
374
353
|
|
|
375
354
|
* `+800` — [Universal International Toll Free Number](https://en.wikipedia.org/wiki/Toll-free_telephone_number)
|
|
376
355
|
* `+808` — [Universal International Shared Cost Number](https://en.wikipedia.org/wiki/Shared-cost_service)
|
|
@@ -381,21 +360,70 @@ There're several calling codes that don't belong to any country:
|
|
|
381
360
|
* `+888` — [United Nations Office for the Coordination of Humanitarian Affairs](https://en.wikipedia.org/wiki/United_Nations_Office_for_the_Coordination_of_Humanitarian_Affairs#International_Dialing_Code)
|
|
382
361
|
* `+979` — [International Premium Rate Service](https://en.wikipedia.org/wiki/International_Premium_Rate_Service)
|
|
383
362
|
|
|
384
|
-
Such phone
|
|
363
|
+
Such phone numbers are called "non-geographic", and their `country` is `undefined`.
|
|
385
364
|
|
|
386
|
-
###
|
|
365
|
+
### Country Code
|
|
387
366
|
|
|
388
|
-
"
|
|
389
|
-
* International number: `+1 213 373 4253`. Country: `"US"`. National number: `(213) 373-4253`. National (significant) number: `213 373 4253`
|
|
390
|
-
* Inetrnational number: `+33 1 45 45 32 45`. Country: `"FR"`. National number: `01 45 45 32 45`. Notice the `0` at the start of the national number — it's because in France they [add](https://en.wikipedia.org/wiki/Telephone_numbers_in_France) `0` "national prefix" when writing phone numbers in national format. National (significant) number: `1 45 45 32 45` (doesn't include the "national prefix").
|
|
367
|
+
A "country code" is a two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) like `"US"`, `"CA"`, etc. <!-- or a special `001` country code used for ["non-geographic entities"](#non-geographic) (as per [Google's libphonenumber library](https://github.com/googlei18n/libphonenumber/blob/0068d861a68d3d4612f7bf8646ab844dd3cefce5/java/libphonenumber/test/com/google/i18n/phonenumbers/RegionCode.java#L23-L24)). -->
|
|
391
368
|
|
|
392
|
-
|
|
369
|
+
However, this library uses the term "country code" rather broadly and it includes both the [official](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) ISO country codes and a few of [unofficial](#country-code-additions) "country codes" that do not "officially" exist.
|
|
393
370
|
|
|
394
|
-
"
|
|
395
|
-
|
|
396
|
-
|
|
371
|
+
For that reason, a developer should use a "country code" returned from this library with caution in an application that only expects the official ISO "country codes" to exist. For example, such application will likely not have a label or a flag for such an unofficial "country code".
|
|
372
|
+
|
|
373
|
+
A developer could manually transform any unofficial "country code" returned from this library to a most-suitable official one. For example, it could be the ISO country code of the most suitable "parent" territory.
|
|
374
|
+
|
|
375
|
+
To get a list of all supported "country codes", both official and unofficial, use [`getCountries()`](#getcountries-string) function.
|
|
376
|
+
|
|
377
|
+
To check if a certain two-letter "country code" is supported by this library, use [`isSupportedCountry()`](#issupportedcountrycountry-string-boolean) function.
|
|
378
|
+
|
|
379
|
+
### Country Code (additions)
|
|
380
|
+
|
|
381
|
+
Here's a list of the unofficial "country codes" — these codes are used for certain "regions" that're usually a subject of a [territorial dispute](https://en.wikipedia.org/wiki/Territorial_dispute).
|
|
397
382
|
|
|
398
|
-
|
|
383
|
+
* `AC` — [Ascension Island](https://en.wikipedia.org/wiki/Ascension_Island)
|
|
384
|
+
* (history) The region of Ascension Island is officially part of [Saint Helena, Ascension and Tristan da Cunha
|
|
385
|
+
](https://en.wikipedia.org/wiki/Saint_Helena,_Ascension_and_Tristan_da_Cunha) (`SH`), which used to be called "Saint Helena and Dependencies" until 2009 when the dependencies were raised to equal status with Saint Helena.
|
|
386
|
+
* Ascension Island has been assigned its own country calling code of `+247`.
|
|
387
|
+
* An unofficial code `AC` is used for Ascension Island region in Google's `libphonenumber`.
|
|
388
|
+
* `AC` is also an official ["exceptional reservation"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Reserved_code_elements) code for Ascension Island in the ISO-3166-1 standard.
|
|
389
|
+
* The last official ISO-3166-2 ["subdivision code"](https://en.wikipedia.org/wiki/ISO_3166-2) assigned to Ascension Island region [is](https://en.wikipedia.org/wiki/ISO_3166-2:SH) `SH-AC`.
|
|
390
|
+
* `TA` — [Tristan da Cunha](https://en.wikipedia.org/wiki/Tristan_da_Cunha)
|
|
391
|
+
* (history) The region of Tristan da Cunha is officially part of [Saint Helena, Ascension and Tristan da Cunha
|
|
392
|
+
](https://en.wikipedia.org/wiki/Saint_Helena,_Ascension_and_Tristan_da_Cunha) (`SH`), which used to be called "Saint Helena and Dependencies" until 2009 when the dependencies were raised to equal status with Saint Helena.
|
|
393
|
+
* Tristan da Cunha shares a country calling code of `+290` with [Saint Helena](https://en.wikipedia.org/wiki/Saint_Helena) where it has a unique prefix of `8`.
|
|
394
|
+
* For the purpose of differentiating Tristan da Cunha phone numbers from [Saint Helena](https://en.wikipedia.org/wiki/Saint_Helena) phone numbers, an unofficial code `TA` is used for it in Google's `libphonenumber`.
|
|
395
|
+
* `TA` is also an official ["exceptional reservation"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Reserved_code_elements) code for Tristan da Cunha in the ISO-3166-1 standard.
|
|
396
|
+
* The last official ISO-3166-2 ["subdivision code"](https://en.wikipedia.org/wiki/ISO_3166-2) assigned to Tristan da Cunha region [is](https://en.wikipedia.org/wiki/ISO_3166-2:SH) `SH-TA`.
|
|
397
|
+
* `SH` — [Saint Helena](https://en.wikipedia.org/wiki/Saint_Helena)
|
|
398
|
+
* (history) The region of Saint Helena is officially part of [Saint Helena, Ascension and Tristan da Cunha
|
|
399
|
+
](https://en.wikipedia.org/wiki/Saint_Helena,_Ascension_and_Tristan_da_Cunha) (`SH`), which used to be called "Saint Helena and Dependencies" until 2009 when the dependencies were raised to equal status with Saint Helena.
|
|
400
|
+
* For the purpose of differentiating Saint Helena phone numbers from [Tristan da Cunha](https://en.wikipedia.org/wiki/Tristan_da_Cunha) phone numbers, the official ISO country code of `SH` is only used for Saint Helena region in Google's `libphonenumber`.
|
|
401
|
+
* The last official ISO-3166-2 ["subdivision code"](https://en.wikipedia.org/wiki/ISO_3166-2) assigned to Saint Helena region [is](https://en.wikipedia.org/wiki/ISO_3166-2:SH) `SH-HL`.
|
|
402
|
+
* `XK` — [Kosovo](https://en.wikipedia.org/wiki/Kosovo)
|
|
403
|
+
* (history) The region of Kosovo separated from Yugoslavia (present [Serbia](https://en.wikipedia.org/wiki/Serbia), `RS`) after a 1998-1999 civil war that was put to an end by NATO's bombing of Yugoslavia in 1999. The government of Kosovo officially (unilaterally) declared independence from Serbia in 2008. Due to the mixed opinions on the legitimacy of NATO's intervention, about half of the United Nations member states currently support Kosovo's independence while the rest of them don't, so Kosovo is currently not assigned any "official" country code.
|
|
404
|
+
* Kosovo has been assigned its own country calling code of `+383`.
|
|
405
|
+
* An unofficial code `XK` is used for Kosovo region in Google's `libphonenumber`.
|
|
406
|
+
* `XK` is a ["user-assigned"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#User-assigned_code_elements) code in the ISO-3166-1 standard meaning that it can be freely assigned to any region by any application or organization for its own purposes.
|
|
407
|
+
* The last official ISO-3166-2 ["subdivision code"](https://en.wikipedia.org/wiki/ISO_3166-2) assigned to Kosovo region [is](https://en.wikipedia.org/wiki/Autonomous_Province_of_Kosovo_and_Metohija) `RS-KM`.
|
|
408
|
+
|
|
409
|
+
There're also other territories having a disputed status of an independent state, whose country calling code or telephone numbering plan is different from the one used by their "official" parent territory. These territories are currently not implemented in this library but they could potentially be implemented in some future:
|
|
410
|
+
* `XA` — [Abkhazia](https://en.wikipedia.org/wiki/Abkhazia)
|
|
411
|
+
* (history) The region of Abkhazia separated from [Georgia](https://en.wikipedia.org/wiki/Georgia_(country)) (`GE`) during a civil war in 1992-1994. The government of Abkhazia officially (unilaterally) declared independence from Georgia in 1994 when the civil war was put to an end. The first state to officially recognize Abkhazia's independence was Russia in 2008.
|
|
412
|
+
* Abkhazia currently shares a country calling code of `+7` with [Russia](https://en.wikipedia.org/wiki/Russia) (`RU`) where it has [unique prefixes](https://en.wikipedia.org/wiki/Telephone_numbers_in_Russia#Codes_assigned_to_Abkhazia) of `840` and `940`, so the "country code" is currently parsed as `RU`.
|
|
413
|
+
* For the purpose of differentiating Abkhazia phone numbers from Russia phone numbers, an unofficial code like `XA` could be used for it in Google's `libphonenumber`.
|
|
414
|
+
* `XA` is a ["user-assigned"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#User-assigned_code_elements) code in the ISO-3166-1 standard meaning that it can be freely assigned to any region by any application or organization for its own purposes.
|
|
415
|
+
* The last official ISO-3166-2 ["subdivision code"](https://en.wikipedia.org/wiki/ISO_3166-2) assigned to Abkhazia region [is](https://en.wikipedia.org/wiki/ISO_3166-2:GE) `GE-AB`.
|
|
416
|
+
* `XO` — [South Ossetia](https://en.wikipedia.org/wiki/South_Ossetia)
|
|
417
|
+
* (history) The region of South Ossetia separated from [Georgia](https://en.wikipedia.org/wiki/Georgia_(country)) (`GE`) during a civil war 1991–1992. The government of South Ossetia officially (unilaterally) declared independence from Georgia in 1992 when the civil war was put to an end. The first state to officially recognize South Ossetia's independence was Russia in 2008.
|
|
418
|
+
* South Ossetia currently shares a country calling code of `+7` with [Russia](https://en.wikipedia.org/wiki/Russia) (`RU`) where it has [unique prefixes](https://en.wikipedia.org/wiki/Telephone_numbers_in_Russia#Codes_assigned_to_South_Ossetia) of `850` and `929`, so the "country code" is currently parsed as `RU`.
|
|
419
|
+
* For the purpose of differentiating South Ossetia phone numbers from Russia phone numbers, an unofficial code like `XO` could be used for it in Google's `libphonenumber`.
|
|
420
|
+
* `XO` is a ["user-assigned"](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#User-assigned_code_elements) code in the ISO-3166-1 standard meaning that it can be freely assigned to any region by any application or organization for its own purposes.
|
|
421
|
+
* South Ossetia region has [not](https://en.wikipedia.org/wiki/ISO_3166-2:GE) ever been assigned any official ISO-3166-2 ["subdivision code"](https://en.wikipedia.org/wiki/ISO_3166-2).
|
|
422
|
+
* `XC` — [Northern Cyprus](https://en.wikipedia.org/wiki/Northern_Cyprus)
|
|
423
|
+
* (history) The region of Northern Cyprus separated from [Cyprus](https://en.wikipedia.org/wiki/Cyprus) (`CY`) during [Turkey](https://en.wikipedia.org/wiki/Turkey)'s military invasion in 1974. The government of Northern Cyprus officially (unilaterally) declared independence from Cyprus in 1983. The first state to officially recognize Northern Cyprus' independence was Turkey in 1983.
|
|
424
|
+
* Northern Cyprus currently shares a country calling code of `+90` with Turkey (`TR`) where it has [unique prefixes](https://en.wikipedia.org/wiki/Telephone_numbers_in_Northern_Cyprus) of `392`, `533` and `542`, so the "country code" is currently parsed as `TR`.
|
|
425
|
+
* For the purpose of differentiating Northern Cyprus phone numbers from Turkey phone numbers, some unofficial code like `XC` could be used for it in Google's `libphonenumber`.
|
|
426
|
+
* Northern Cyprus region has [not](https://en.wikipedia.org/wiki/ISO_3166-2:CY) ever been assigned any official ISO-3166-2 ["subdivision code"](https://en.wikipedia.org/wiki/ISO_3166-2).
|
|
399
427
|
|
|
400
428
|
## API
|
|
401
429
|
|