An account document is attached to a user document if an account of the user is on the server. It may be missing if the user is on a remote server.
13 lines
471 B
TypeScript
13 lines
471 B
TypeScript
import { IUser } from '../api/models/user';
|
|
|
|
/**
|
|
* ユーザーを表す文字列を取得します。
|
|
* @param user ユーザー
|
|
*/
|
|
export default function(user: IUser): string {
|
|
return `${user.name} (@${user.username})\n` +
|
|
`${user.posts_count}投稿、${user.following_count}フォロー、${user.followers_count}フォロワー\n` +
|
|
`場所: ${user.account.profile.location}、誕生日: ${user.account.profile.birthday}\n` +
|
|
`「${user.description}」`;
|
|
}
|