Skip to content

Commit

Permalink
Add AsYouType formatting for nationalNumber and formatNational
Browse files Browse the repository at this point in the history
  • Loading branch information
autumn-canfield committed Sep 18, 2024
1 parent 39eced3 commit 015a1fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/svelte-tel-input/src/lib/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ export const normalizeTelInput = (input?: PhoneNumber) => {
phoneNumber: input ? input.number : null,
countryCallingCode: input ? input.countryCallingCode : null,
formattedNumber: input ? input.formatInternational() : null,
nationalNumber: input ? input.nationalNumber : null,
nationalNumber: input ? (new AsYouType(input.country)).input(input.nationalNumber) : null,
formatInternational: input ? (new AsYouType()).input(input.number) : null,
formatOriginal: input
? input
.formatInternational()
? (new AsYouType())
.input(input.number)
.slice(input.countryCallingCode.length + 1)
.trim()
: null,
formatNational: input ? input.formatNational() : null,
formatNational: input ? (new AsYouType(input.country)).input(input.number) : null,
uri: input ? input.getURI() : null,
e164: input ? input.number : null
}).filter(([, value]) => value !== null)
Expand Down

0 comments on commit 015a1fc

Please sign in to comment.