diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-10-07 17:20:47 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-10-07 17:20:47 +0900 |
| commit | d1f5d62251526c01b23e741ec363152cc21cc58c (patch) | |
| tree | 62b8009b1891217f59522c32d0f846fcd67f3a0f /src/common | |
| parent | Merge pull request #819 from syuilo/greenkeeper/monk-6.0.5 (diff) | |
| download | misskey-d1f5d62251526c01b23e741ec363152cc21cc58c.tar.gz misskey-d1f5d62251526c01b23e741ec363152cc21cc58c.tar.bz2 misskey-d1f5d62251526c01b23e741ec363152cc21cc58c.zip | |
Refactor
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/get-user-summary.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/get-user-summary.ts b/src/common/get-user-summary.ts new file mode 100644 index 0000000000..1bec2f9a26 --- /dev/null +++ b/src/common/get-user-summary.ts @@ -0,0 +1,12 @@ +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.profile.location}、誕生日: ${user.profile.birthday}\n` + + `「${user.description}」`; +} |