Skip to content

Commit

Permalink
feat: Support short number handling
Browse files Browse the repository at this point in the history
closes #112
  • Loading branch information
grantila committed Aug 25, 2024
1 parent 84ee203 commit df36157
Show file tree
Hide file tree
Showing 6 changed files with 479 additions and 120 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ const pn = {
possibility: 'is-possible',
regionCode: 'SE',
possible: true,
shortPossible: false,
shortValid: false,
canBeInternationallyDialled: true,
type: 'mobile',
countryCode: 46,
Expand Down Expand Up @@ -105,6 +107,8 @@ interface ParsedPhoneNumberValid {
possibility: PhoneNumberPossibility; // a string union, see below
regionCode: string;
possible: boolean;
shortPossible: boolean;
shortValid: boolean;
canBeInternationallyDialled: boolean;
type: PhoneNumberTypes; // a string union, see below
countryCode: number;
Expand All @@ -121,10 +125,14 @@ interface ParsedPhoneNumberInvalid {

possible: false;
possibility: 'invalid';
shortPossible: boolean;
shortValid: boolean;
error?: unknown;
};
```

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


## API

Expand Down
Loading

0 comments on commit df36157

Please sign in to comment.