e164num
Version:
**Light validation and manipulation of E.164 phone numbers.**
15 lines (14 loc) • 464 B
TypeScript
/**
* Masks a phone number that is assumed to be a full valid E164 format. The
* result will have only the plus sign, the first digit right after it, and the
* last 3 digits visible. All others will be masked with an asterisk.
*
* @param e164PhoneNumber The E164 phone number to mask.
*
* @example
* ```ts
* maskPhoneNumber('+17871234567')
* // returns '+1*******567'
* ```
*/
export declare const maskPhoneNumber: (e164PhoneNumber: string) => string;