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

Add home dir

This commit is contained in:
Toast 2024-01-07 02:19:17 +11:00 committed by GitHub
parent 73a8471f4b
commit 839fb4b163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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