MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getRecentReleaseNotes

Function getRecentReleaseNotes

source code/utils/releaseNotes.ts:209–242  ·  view source on GitHub ↗
(
  currentVersion: string,
  previousVersion: string | null | undefined,
  changelogContent: string = getStoredChangelogFromMemory(),
)

Source from the content-addressed store, hash-verified

207 * @returns Array of release notes to display
208 */
209export function getRecentReleaseNotes(
210 currentVersion: string,
211 previousVersion: string | null | undefined,
212 changelogContent: string = getStoredChangelogFromMemory(),
213): string[] {
214 try {
215 const releaseNotes = parseChangelog(changelogContent)
216
217 // Strip SHA from both versions to compare only the base versions
218 const baseCurrentVersion = coerce(currentVersion)
219 const basePreviousVersion = previousVersion ? coerce(previousVersion) : null
220
221 if (
222 !basePreviousVersion ||
223 (baseCurrentVersion &&
224 gt(baseCurrentVersion.version, basePreviousVersion.version))
225 ) {
226 // Get all versions that are newer than the last seen version
227 return Object.entries(releaseNotes)
228 .filter(
229 ([version]) =>
230 !basePreviousVersion || gt(version, basePreviousVersion.version),
231 )
232 .sort(([versionA], [versionB]) => (gt(versionA, versionB) ? -1 : 1)) // Sort newest first
233 .flatMap(([_, notes]) => notes)
234 .filter(Boolean)
235 .slice(0, MAX_RELEASE_NOTES_SHOWN)
236 }
237 } catch (error) {
238 logError(toError(error))
239 return []
240 }
241 return []
242}
243
244/**
245 * Gets all release notes as an array of [version, notes] arrays.

Callers 2

checkForReleaseNotesFunction · 0.85
checkForReleaseNotesSyncFunction · 0.85

Calls 6

parseChangelogFunction · 0.85
gtFunction · 0.85
toErrorFunction · 0.85
entriesMethod · 0.80
logErrorFunction · 0.70

Tested by

no test coverage detected