maskText
Function | Source Code
maskText(text: string, mask: RegExp): string
Masks text on a per-character basis.
Returns
Section titled “Returns”The masked text.
Example
Section titled “Example”maskText('abc123', /\d/); // => '123'Parameters
Section titled “Parameters”text: string
Section titled “text: string”The text to mask.
mask: RegExp
Section titled “mask: RegExp”The mask to apply to the text. The mask will be applied on a per-character basis.