Refactorng
This commit is contained in:
parent
865fd25af1
commit
aa4ef6745a
132 changed files with 180 additions and 212 deletions
4
src/misc/acct/parse.ts
Normal file
4
src/misc/acct/parse.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export default (acct: string) => {
|
||||
const splitted = acct.split('@', 2);
|
||||
return { username: splitted[0], host: splitted[1] || null };
|
||||
};
|
5
src/misc/acct/render.ts
Normal file
5
src/misc/acct/render.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { IUser } from '../../models/user';
|
||||
|
||||
export default (user: IUser) => {
|
||||
return user.host === null ? user.username : `${user.username}@${user.host}`;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue