libphonenumber-js 1.9.11 → 1.9.15
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/README.md +7 -3
- 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.ts +5 -0
- package/core/index.js +1 -1
- package/custom.d.ts +5 -0
- package/index.d.ts +5 -0
- package/index.es6.js +1 -1
- package/max/index.js +1 -1
- package/metadata.full.json +1 -1
- package/metadata.full.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.ts +5 -0
- package/min/index.js +1 -1
- package/mobile/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -514,7 +514,7 @@ Checks if `input` can be parsed as a "possible" phone number. A phone number is
|
|
|
514
514
|
|
|
515
515
|
```js
|
|
516
516
|
isPossiblePhoneNumber('8 (888) 888-88-88', 'RU') === true
|
|
517
|
-
isPossiblePhoneNumber('+
|
|
517
|
+
isPossiblePhoneNumber('+12223333333') === true
|
|
518
518
|
```
|
|
519
519
|
|
|
520
520
|
This function is just a shortcut for a two-step process of ["strictly"](#strictness) parsing a phone number and then calling `.isPossible()`.
|
|
@@ -524,12 +524,16 @@ This function is just a shortcut for a two-step process of ["strictly"](#strictn
|
|
|
524
524
|
Checks if `input` can be parsed as a "valid" phone number. A phone number is "valid" when it has valid length, and the actual phone number digits match the regular expressions for that country.
|
|
525
525
|
|
|
526
526
|
```js
|
|
527
|
+
isValidPhoneNumber('8 (888) 888-88-88', 'RU') === false
|
|
527
528
|
isValidPhoneNumber('8 (800) 555-35-35', 'RU') === true
|
|
529
|
+
isValidPhoneNumber('+12223333333') === false
|
|
528
530
|
isValidPhoneNumber('+12133734253') === true
|
|
529
531
|
```
|
|
530
532
|
|
|
531
533
|
This function is just a shortcut for a two-step process of ["strictly"](#strictness) parsing a phone number and then calling `.isValid()`.
|
|
532
534
|
|
|
535
|
+
See ["Using phone number validation feature"](#using-phone-number-validation-feature) for choosing between `isPossible()` and `isValid()`.
|
|
536
|
+
|
|
533
537
|
### `class` AsYouType([options or defaultCountry])
|
|
534
538
|
|
|
535
539
|
Creates a formatter for a partially entered phone number.
|
|
@@ -596,9 +600,9 @@ asYouType.getTemplate() === 'xx xxx xxx xxxx'
|
|
|
596
600
|
|
|
597
601
|
* `isInternational(): boolean` — Returns `true` if the phone number is being input in international format. In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
|
598
602
|
|
|
599
|
-
* `getCallingCode(): string
|
|
603
|
+
* `getCallingCode(): string?` — Returns the ["country calling code"](#country-calling-code) part of the phone number. Returns `undefined` if the number is not being input in international format. Returns "country calling code" for ["non-geographic"](#non-geographic) phone numbering plans too.
|
|
600
604
|
|
|
601
|
-
* `getCountry(): string
|
|
605
|
+
* `getCountry(): string?` — Returns a two-letter [country code](#country-code) of the phone number. Returns `undefined` for ["non-geographic"](#non-geographic) phone numbering plans. Returns `undefined` if no phone number has been input yet.
|
|
602
606
|
|
|
603
607
|
* `isPossible(): boolean` — Returns `true` if the phone number is "possible". Is just a shortcut for [`PhoneNumber.isPossible()`](#ispossible-boolean).
|
|
604
608
|
|