Abolish common and misc directories
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export default user => {
|
||||
return user.host === null ? user.username : `${user.username}@${user.host}`;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import { IUser, isLocalUser } from '../models/user';
|
||||
import getAcct from './get-acct';
|
||||
|
||||
/**
|
||||
* ユーザーを表す文字列を取得します。
|
||||
* @param user ユーザー
|
||||
*/
|
||||
export default function(user: IUser): string {
|
||||
let string = `${user.name} (@${getAcct(user)})\n` +
|
||||
`${user.postsCount}投稿、${user.followingCount}フォロー、${user.followersCount}フォロワー\n`;
|
||||
|
||||
if (isLocalUser(user)) {
|
||||
const account = user.account;
|
||||
string += `場所: ${account.profile.location}、誕生日: ${account.profile.birthday}\n`;
|
||||
}
|
||||
|
||||
return string + `「${user.description}」`;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export default acct => {
|
||||
const splitted = acct.split('@', 2);
|
||||
return { username: splitted[0], host: splitted[1] || null };
|
||||
};
|
||||
Reference in New Issue
Block a user