(readme)
| 42 | } |
| 43 | |
| 44 | function extractCommunitySection(readme) { |
| 45 | const start = readme.indexOf(COMMUNITY_HEADER); |
| 46 | const end = readme.indexOf(COMMUNITY_END_HEADER); |
| 47 | |
| 48 | if (start === -1 || end === -1 || end <= start) { |
| 49 | throw new Error('Could not locate the Community Projects section boundaries in README.md'); |
| 50 | } |
| 51 | |
| 52 | return readme.slice(start, end); |
| 53 | } |
| 54 | |
| 55 | async function fetchRepo(slug) { |
| 56 | const response = await fetch(`https://api.github.com/repos/${slug}`, { |