Skip to main content

maskPhoneNumbers

Stentor API Reference


Stentor API Reference / stentor-utils/src / maskPhoneNumbers

Function: maskPhoneNumbers()

maskPhoneNumbers(str, partial): string

Defined in: packages/stentor-utils/src/number.ts:108

Detects the phone numbers within a string and masks the numbers with #s, preserving the formatting.

Parameters​

str​

string

The string containing phone numbers.

partial​

boolean = false

Defaults to false. When true it keeps the last four digits of the number

Returns​

string

String with phone numbers masked.