Text to mask.
OptionalmaskChar?: stringCharacter(s) to use for masked positions. Default is '*'.
OptionalvisibleEnd?: numberNumber of characters to leave visible at the end.
OptionalvisibleStart?: numberNumber of characters to leave visible at the start.
The masked string, or the original string unchanged if the requested visible portions cover the whole string.
Partially masks a string for display purposes (e.g. showing a masked email or card number in a UI without exposing the full value).
If neither
visibleStartnorvisibleEndis given, the first 2 characters are shown by default. Specifying either one turns off that implicit default for the side you didn't specify — e.g. passing onlyvisibleEndhides the start entirely, rather than also showing the first 2 characters.