MCPcopy Index your code
hub / github.com/BingyanStudio/github-analyzer / parseUserData

Function parseUserData

api/src/services/generateReport.ts:358–405  ·  view source on GitHub ↗
(data: UserData)

Source from the content-addressed store, hash-verified

356}
357
358function parseUserData(data: UserData): string {
359 const {
360 username,
361 name,
362 bio,
363 location,
364 status,
365 pullRequests,
366 repositoriesContributedTo,
367 profileContent,
368 } = data;
369
370 return `用户名: ${username}
371昵称: ${name}
372简介: ${bio}
373位置: ${location}
374状态: ${status?.emoji || "无状态"} ${status?.message || "无状态信息"}
375PR 记录:
376<START_PULL_REQUESTS>
377${
378 pullRequests
379 ?.map(
380 (pr) =>
381 `- ${pr.title} (${pr.repository.nameWithOwner})\n ${pr.body}\n 创建于: ${pr.createdAt}`
382 )
383 .join("\n") || "无 PR 记录"
384}
385<END_PULL_REQUESTS>
386Commit 记录:
387<START_COMMITS>
388${
389 repositoriesContributedTo
390 ?.map(
391 (repo) =>
392 `- ${repo.nameWithOwner} (${repo.description})\n 提交记录:\n ${
393 repo?.commits
394 ?.map((commit) => `- ${commit.message} (${commit.committedDate})`)
395 .join("\n") || "无 Commit 记录"
396 }`
397 )
398 .join("\n") || "无 Commit 记录"
399}
400<END_COMMITS>
401个人资料内容:
402<START_PROFILE_CONTENT>
403${profileContent || "无个人资料页"}
404<END_PROFILE_CONTENT>`;
405}
406
407// Function to generate a hash key from commit data and preset
408function generateReportKey(login: string, presetKey: string): string {

Callers 2

fetchUserDataEndpointFunction · 0.85
startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected