1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-18 17:00:58 -05:00
Daggerbot-TS/src/helpers/UsernameHelper.ts
2023-10-09 09:03:17 +11:00

7 lines
268 B
TypeScript

export default class UsernameHelper {
static stripName(text: string){
const dirSlash = process.platform === 'linux' ? '\/' : '\\';
return text.replace(/(?<=\/Users\/|\/media\/)[^/]+/g, match=>'・'.repeat(match.length)).split(dirSlash).join(dirSlash);
}
}