Skip to content

Commit df36157

Browse files
committed
feat: Support short number handling
closes #112
1 parent 84ee203 commit df36157

File tree

6 files changed

+479
-120
lines changed

6 files changed

+479
-120
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ const pn = {
7878
possibility: 'is-possible',
7979
regionCode: 'SE',
8080
possible: true,
81+
shortPossible: false,
82+
shortValid: false,
8183
canBeInternationallyDialled: true,
8284
type: 'mobile',
8385
countryCode: 46,
@@ -105,6 +107,8 @@ interface ParsedPhoneNumberValid {
105107
possibility: PhoneNumberPossibility; // a string union, see below
106108
regionCode: string;
107109
possible: boolean;
110+
shortPossible: boolean;
111+
shortValid: boolean;
108112
canBeInternationallyDialled: boolean;
109113
type: PhoneNumberTypes; // a string union, see below
110114
countryCode: number;
@@ -121,10 +125,14 @@ interface ParsedPhoneNumberInvalid {
121125

122126
possible: false;
123127
possibility: 'invalid';
128+
shortPossible: boolean;
129+
shortValid: boolean;
124130
error?: unknown;
125131
};
126132
```
127133

134+
Note that an incorrect (invalid) phone number can still be a valid _short number_ for the given region.
135+
128136

129137
## API
130138

0 commit comments

Comments
 (0)