MCPcopy Create free account
hub / github.com/chokcoco/iCSS / transformIssueToArticle

Method transformIssueToArticle

website/app/lib/github.ts:100–115  ·  view source on GitHub ↗
(issue: GitHubIssue)

Source from the content-addressed store, hash-verified

98
99 // 转换 GitHub issue 为文章格式
100 private static transformIssueToArticle(issue: GitHubIssue): Article {
101 const image = this.extractImageFromBody(issue.body);
102 const category = this.extractCategoryFromBody(issue.body);
103
104 return {
105 id: issue.number,
106 title: issue.title,
107 url: `https://github.com/${this.REPO_OWNER}/${this.REPO_NAME}/issues/${issue.number}`,
108 image,
109 category,
110 created_at: issue.created_at,
111 author: issue.user.login,
112 comments: issue.comments,
113 reactions: issue.reactions.total_count
114 };
115 }
116
117 // 获取所有 issues
118 static async getIssues(page: number = 1, perPage: number = 30): Promise<Article[]> {

Callers 1

getIssuesMethod · 0.95

Calls 2

extractImageFromBodyMethod · 0.95

Tested by

no test coverage detected