libphonenumber-js 1.9.29 → 1.9.34

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/min/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  MetadataJson,
3
+ Examples,
3
4
  PhoneNumber,
4
5
  E164Number,
5
6
  CountryCallingCode,
@@ -20,6 +21,7 @@ import {
20
21
  // https://github.com/catamphetamine/libphonenumber-js/pull/290#issuecomment-453281180
21
22
  export {
22
23
  MetadataJson,
24
+ Examples,
23
25
  PhoneNumber,
24
26
  E164Number,
25
27
  CountryCallingCode,
@@ -71,7 +73,7 @@ export function getCountries(): CountryCode[];
71
73
  export function getCountryCallingCode(countryCode: CountryCode): CountryCallingCode;
72
74
  export function getExtPrefix(countryCode: CountryCode): string;
73
75
 
74
- export function getExampleNumber(country: CountryCode, examples: { [country in CountryCode]: NationalNumber }): PhoneNumber | undefined;
76
+ export function getExampleNumber(country: CountryCode, examples: Examples): PhoneNumber | undefined;
75
77
 
76
78
  export function formatIncompletePhoneNumber(number: string, countryCode?: CountryCode): string;
77
79
  export function parseIncompletePhoneNumber(text: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libphonenumber-js",
3
- "version": "1.9.29",
3
+ "version": "1.9.34",
4
4
  "description": "A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript",
5
5
  "main": "index.common.js",
6
6
  "module": "index.es6.js",
package/types.d.ts CHANGED
@@ -32,6 +32,13 @@ export type MetadataJson = {
32
32
  countries: Countries;
33
33
  };
34
34
 
35
+ export type Examples = {
36
+ // `in` operator docs:
37
+ // https://www.typescriptlang.org/docs/handbook/advanced-types.html#mapped-types
38
+ // `country in CountryCode` means "for each and every CountryCode".
39
+ [country in CountryCode]: NationalNumber;
40
+ };
41
+
35
42
  // 'National' and 'International' formats are deprecated.
36
43
  export type NumberFormat = 'NATIONAL' | 'National' | 'INTERNATIONAL' | 'International' | 'E.164' | 'RFC3966' | 'IDD';
37
44
  export type NumberType = undefined | 'PREMIUM_RATE' | 'TOLL_FREE' | 'SHARED_COST' | 'VOIP' | 'PERSONAL_NUMBER' | 'PAGER' | 'UAN' | 'VOICEMAIL' | 'FIXED_LINE_OR_MOBILE' | 'FIXED_LINE' | 'MOBILE';