1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 04:10:59 -05:00

Add home dir

This commit is contained in:
toast-ts 2024-01-07 02:19:17 +11:00 committed by GitHub
parent e3a55e6210
commit 9827320eee

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);
} }