libphonenumber-js 1.12.31 → 1.12.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/CHANGELOG.md +28 -0
- package/README.md +3 -1
- package/build/format.js +18 -2
- package/build/format.js.map +1 -1
- package/build/format.test.js +3 -6
- package/build/format.test.js.map +1 -1
- package/build/helpers/getIddPrefix.js +2 -2
- package/build/helpers/getIddPrefix.js.map +1 -1
- package/build/legacy/format.test.js +3 -6
- package/build/legacy/format.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/core/index.d.cts +12 -4
- package/core/index.d.ts +12 -4
- package/custom.d.ts +7 -6
- package/es6/format.js +18 -2
- package/es6/format.js.map +1 -1
- package/es6/format.test.js +3 -6
- package/es6/format.test.js.map +1 -1
- package/es6/helpers/getIddPrefix.js +2 -2
- package/es6/helpers/getIddPrefix.js.map +1 -1
- package/es6/legacy/format.test.js +3 -6
- package/es6/legacy/format.test.js.map +1 -1
- package/index.d.cts +6 -4
- package/index.d.ts +6 -4
- package/max/index.d.cts +12 -4
- package/max/index.d.ts +12 -4
- 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/index.d.cts +12 -4
- package/min/index.d.ts +12 -4
- package/min/metadata/metadata.min.json +1 -1
- package/min/metadata/metadata.min.json.js +1 -1
- package/mobile/index.d.cts +12 -4
- package/mobile/index.d.ts +12 -4
- package/mobile/metadata/metadata.mobile.json +1 -1
- package/mobile/metadata/metadata.mobile.json.js +1 -1
- package/package.json +1 -1
- package/source/format.js +17 -2
- package/source/format.test.js +3 -3
- package/source/helpers/getIddPrefix.js +2 -2
- package/source/legacy/format.test.js +3 -3
- package/types.d.cts +21 -10
- package/types.d.ts +21 -10
package/min/index.d.cts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
NumberFormat,
|
|
14
14
|
NumberingPlan,
|
|
15
15
|
FormatNumberOptions,
|
|
16
|
-
|
|
16
|
+
FormatNumberOptionsForNationalOrInternational,
|
|
17
17
|
ValidatePhoneNumberLengthResult
|
|
18
18
|
} from '../types.d.cjs';
|
|
19
19
|
|
|
@@ -50,9 +50,9 @@ export class PhoneNumber {
|
|
|
50
50
|
isValid(): boolean;
|
|
51
51
|
getType(): NumberType;
|
|
52
52
|
format(format: NumberFormat, options?: FormatNumberOptions): string;
|
|
53
|
-
formatNational(options?:
|
|
54
|
-
formatInternational(options?:
|
|
55
|
-
getURI(
|
|
53
|
+
formatNational(options?: FormatNumberOptionsForNationalOrInternational): string;
|
|
54
|
+
formatInternational(options?: FormatNumberOptionsForNationalOrInternational): string;
|
|
55
|
+
getURI(): string;
|
|
56
56
|
isNonGeographic(): boolean;
|
|
57
57
|
isEqual(phoneNumber: PhoneNumber): boolean;
|
|
58
58
|
}
|
|
@@ -78,9 +78,15 @@ export function isValidPhoneNumber(text: string, defaultCountry?: CountryCode |
|
|
|
78
78
|
export function isPossiblePhoneNumber(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): boolean;
|
|
79
79
|
export function validatePhoneNumberLength(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): ValidatePhoneNumberLengthResult | undefined;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated
|
|
83
|
+
*/
|
|
81
84
|
export function findNumbers(text: string, options?: CountryCode): NumberFoundLegacy[];
|
|
82
85
|
export function searchNumbers(text: string, options?: CountryCode): IterableIterator<NumberFoundLegacy>;
|
|
83
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated
|
|
89
|
+
*/
|
|
84
90
|
export function findNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): NumberFound[];
|
|
85
91
|
export function searchNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): IterableIterator<NumberFound>;
|
|
86
92
|
|
|
@@ -88,6 +94,8 @@ export function findPhoneNumbersInText(text: string, options?: CountryCode | { d
|
|
|
88
94
|
export function searchPhoneNumbersInText(text: string, options?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extended?: boolean }): IterableIterator<NumberFound>;
|
|
89
95
|
|
|
90
96
|
export class PhoneNumberMatcher {
|
|
97
|
+
// The `v2: true` parameter only exists for legacy reasons and should always be specified.
|
|
98
|
+
// It tells it to include the parsed E.164 `number` property in the result.
|
|
91
99
|
constructor(text: string, options?: { defaultCountry?: CountryCode, v2: true });
|
|
92
100
|
hasNext(): boolean;
|
|
93
101
|
next(): NumberFound | undefined;
|
package/min/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
NumberFormat,
|
|
14
14
|
NumberingPlan,
|
|
15
15
|
FormatNumberOptions,
|
|
16
|
-
|
|
16
|
+
FormatNumberOptionsForNationalOrInternational,
|
|
17
17
|
ValidatePhoneNumberLengthResult
|
|
18
18
|
} from '../types.d.js';
|
|
19
19
|
|
|
@@ -50,9 +50,9 @@ export class PhoneNumber {
|
|
|
50
50
|
isValid(): boolean;
|
|
51
51
|
getType(): NumberType;
|
|
52
52
|
format(format: NumberFormat, options?: FormatNumberOptions): string;
|
|
53
|
-
formatNational(options?:
|
|
54
|
-
formatInternational(options?:
|
|
55
|
-
getURI(
|
|
53
|
+
formatNational(options?: FormatNumberOptionsForNationalOrInternational): string;
|
|
54
|
+
formatInternational(options?: FormatNumberOptionsForNationalOrInternational): string;
|
|
55
|
+
getURI(): string;
|
|
56
56
|
isNonGeographic(): boolean;
|
|
57
57
|
isEqual(phoneNumber: PhoneNumber): boolean;
|
|
58
58
|
}
|
|
@@ -78,9 +78,15 @@ export function isValidPhoneNumber(text: string, defaultCountry?: CountryCode |
|
|
|
78
78
|
export function isPossiblePhoneNumber(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): boolean;
|
|
79
79
|
export function validatePhoneNumberLength(text: string, defaultCountry?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string }): ValidatePhoneNumberLengthResult | undefined;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated
|
|
83
|
+
*/
|
|
81
84
|
export function findNumbers(text: string, options?: CountryCode): NumberFoundLegacy[];
|
|
82
85
|
export function searchNumbers(text: string, options?: CountryCode): IterableIterator<NumberFoundLegacy>;
|
|
83
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated
|
|
89
|
+
*/
|
|
84
90
|
export function findNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): NumberFound[];
|
|
85
91
|
export function searchNumbers(text: string, options?: { defaultCountry?: CountryCode, v2: true }): IterableIterator<NumberFound>;
|
|
86
92
|
|
|
@@ -88,6 +94,8 @@ export function findPhoneNumbersInText(text: string, options?: CountryCode | { d
|
|
|
88
94
|
export function searchPhoneNumbersInText(text: string, options?: CountryCode | { defaultCountry?: CountryCode, defaultCallingCode?: string, extended?: boolean }): IterableIterator<NumberFound>;
|
|
89
95
|
|
|
90
96
|
export class PhoneNumberMatcher {
|
|
97
|
+
// The `v2: true` parameter only exists for legacy reasons and should always be specified.
|
|
98
|
+
// It tells it to include the parsed E.164 `number` property in the result.
|
|
91
99
|
constructor(text: string, options?: { defaultCountry?: CountryCode, v2: true });
|
|
92
100
|
hasNext(): boolean;
|
|
93
101
|
next(): NumberFound | undefined;
|