(releaseLines: string[])
| 69 | } |
| 70 | |
| 71 | function parseCategories(releaseLines: string[]): Map<string, string[]> { |
| 72 | const categories = new Map<string, string[]>() |
| 73 | let currentCategory: string | null = null |
| 74 | |
| 75 | for (let i = 1; i < releaseLines.length; i++) { |
| 76 | const line = releaseLines[i] |
| 77 | if (versionHeaderRe.test(line)) { |
| 78 | currentCategory = null |
| 79 | continue |
| 80 | } |
| 81 | if (line.startsWith('### ')) { |
| 82 | currentCategory = line.trim() |
| 83 | if (!categories.has(currentCategory)) { |
| 84 | categories.set(currentCategory, []) |
| 85 | } |
| 86 | continue |
| 87 | } |
| 88 | |
| 89 | if (currentCategory && line.trim() !== '') { |
| 90 | categories.get(currentCategory)!.push(line) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | return categories |
| 95 | } |
| 96 | |
| 97 | function findPreviousStableVersion(lines: string[], startIdx: number): string { |
| 98 | for (let i = startIdx; i < lines.length; i++) { |
no test coverage detected