misskey/src/common/get-user-summary.ts
Akihiko Odaki 19b9cb105d Introduce account document to user document
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.
2018-03-26 14:07:16 +09:00

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