Skip to content

Function: maskCustom() ​

ts
function maskCustom(
   text, 
   start, 
   end, 
   char?): string;

Masks characters between start and end index. 自定义区间脱敏。

Parameters ​

ParameterTypeDefault value
textstringundefined
startnumberundefined
endnumberundefined
charstring'*'

Returns ​

string

Example ​

ts
maskCustom('abcdef', 2, 5) // => 'ab***f'

Since ​

1.0.0

Released under the MIT License.