summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-10-07 17:20:47 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-10-07 17:20:47 +0900
commitd1f5d62251526c01b23e741ec363152cc21cc58c (patch)
tree62b8009b1891217f59522c32d0f846fcd67f3a0f /src/common
parentMerge pull request #819 from syuilo/greenkeeper/monk-6.0.5 (diff)
downloadmisskey-d1f5d62251526c01b23e741ec363152cc21cc58c.tar.gz
misskey-d1f5d62251526c01b23e741ec363152cc21cc58c.tar.bz2
misskey-d1f5d62251526c01b23e741ec363152cc21cc58c.zip
Refactor
Diffstat (limited to 'src/common')
-rw-r--r--src/common/get-user-summary.ts12
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}」`;
+}