(repoName: string, repoId: number)
| 94 | } |
| 95 | |
| 96 | function getOrCreateRepo(repoName: string, repoId: number): Repo { |
| 97 | if (!reposMap.has(repoName)) { |
| 98 | const [owner, name] = repoName.split('/'); |
| 99 | reposMap.set(repoName, { |
| 100 | id: repoId, |
| 101 | owner, |
| 102 | name, |
| 103 | fullName: repoName, |
| 104 | }); |
| 105 | } |
| 106 | return reposMap.get(repoName)!; |
| 107 | } |
| 108 | |
| 109 | function processEvent(event: GitHubEvent) { |
| 110 | const repo = getOrCreateRepo(event.repo.name, event.repo.id); |