1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 08:20:58 -05:00
Daggerbot-TS/src/helpers/UsernameHelper.ts

7 lines
268 B
TypeScript
Raw Normal View History

2023-08-30 04:34:59 -04:00
export default class UsernameHelper {
static stripName(text: string){
const dirSlash = process.platform === 'linux' ? '\/' : '\\';
2023-10-08 18:03:17 -04:00
return text.replace(/(?<=\/Users\/|\/media\/)[^/]+/g, match=>'・'.repeat(match.length)).split(dirSlash).join(dirSlash);
2023-08-30 04:34:59 -04:00
}
}