( currentVersion: string, previousVersion: string | null | undefined, changelogContent: string = getStoredChangelogFromMemory(), )
| 205 | * @returns Array of release notes to display |
| 206 | */ |
| 207 | export function getRecentReleaseNotes( |
| 208 | currentVersion: string, |
| 209 | previousVersion: string | null | undefined, |
| 210 | changelogContent: string = getStoredChangelogFromMemory(), |
| 211 | ): string[] { |
| 212 | try { |
| 213 | return getRecentReleaseNoteGroups( |
| 214 | currentVersion, |
| 215 | previousVersion, |
| 216 | changelogContent, |
| 217 | ) |
| 218 | .flatMap(([, notes]) => notes) |
| 219 | .filter(Boolean) |
| 220 | .slice(0, MAX_RELEASE_NOTES_SHOWN) |
| 221 | } catch (error) { |
| 222 | logError(toError(error)) |
| 223 | return [] |
| 224 | } |
| 225 | return [] |
| 226 | } |
| 227 | |
| 228 | export function getRecentReleaseNoteGroups( |
| 229 | currentVersion: string, |
no test coverage detected