libphonenumber-js 1.9.47 → 1.9.50

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libphonenumber-js",
3
- "version": "1.9.47",
3
+ "version": "1.9.50",
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
@@ -43,13 +43,13 @@ export type Examples = {
43
43
  export type NumberFormat = 'NATIONAL' | 'National' | 'INTERNATIONAL' | 'International' | 'E.164' | 'RFC3966' | 'IDD';
44
44
  export type NumberType = undefined | 'PREMIUM_RATE' | 'TOLL_FREE' | 'SHARED_COST' | 'VOIP' | 'PERSONAL_NUMBER' | 'PAGER' | 'UAN' | 'VOICEMAIL' | 'FIXED_LINE_OR_MOBILE' | 'FIXED_LINE' | 'MOBILE';
45
45
 
46
- // The rationale for the specific data types instead of just using `string`.
47
- // https://github.com/catamphetamine/libphonenumber-js/issues/170#issuecomment-363156068
48
- export interface E164Number extends String { }
49
- export interface NationalNumber extends String { }
50
- export interface Extension extends String { }
51
- export interface CarrierCode extends String { }
52
- export interface CountryCallingCode extends String { }
46
+ type Tagged<A, T> = A & { __tag?: T };
47
+
48
+ type E164Number = Tagged<string, "E164Number">;
49
+ type NationalNumber = Tagged<string, "NationalNumber">;
50
+ type Extension = Tagged<string, "Extension">;
51
+ type CarrierCode = Tagged<string, "CarrierCode">;
52
+ type CountryCallingCode = Tagged<string, "CountryCallingCode">;
53
53
 
54
54
  type FormatExtension = (formattedNumber: string, extension: Extension, metadata: MetadataJson) => string
55
55