desensitize
desensitize(value, options?): string | null | undefined
数据脱敏
Parameters
| Name | Type | Description |
|---|---|---|
value | string | 需要脱敏的值 |
options? | Object | 脱敏配置项 |
options.start? | number | 起始保留长度 |
options.end? | number | 结尾保留长度 |
options.mask? | string | 掩码字符 |
options.count? | number | - |
options.type? | "phone" | "email" | "name" | "idcard" | 脱敏类型 |
Returns
string | null | undefined
- 返回脱敏后的字符串