renovate/lib/util/mask.ts

10 lines
198 B
TypeScript
Raw Normal View History

2019-08-15 06:26:21 +00:00
export function maskToken(str?: string): string {
return str
? [
str.substring(0, 2),
new Array(str.length - 3).join('*'),
str.slice(-2),
].join('')
: str;
}