From d1f5d62251526c01b23e741ec363152cc21cc58c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Oct 2017 17:20:47 +0900 Subject: Refactor --- src/common/get-user-summary.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/common/get-user-summary.ts (limited to 'src/common/get-user-summary.ts') 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}」`; +} -- cgit v1.3.1-freya