MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getAllReleaseNotes

Function getAllReleaseNotes

src/utils/releaseNotes.ts:274–301  ·  view source on GitHub ↗
(
  changelogContent: string = getStoredChangelogFromMemory(),
)

Source from the content-addressed store, hash-verified

272 * @returns Array of [version, notes[]] arrays
273 */
274export function getAllReleaseNotes(
275 changelogContent: string = getStoredChangelogFromMemory(),
276): Array<[string, string[]]> {
277 try {
278 const releaseNotes = parseChangelog(changelogContent)
279
280 // Sort versions with oldest first
281 const sortedVersions = Object.keys(releaseNotes).sort((a, b) =>
282 gt(a, b) ? 1 : -1,
283 )
284
285 // Return array of [version, notes] arrays
286 return sortedVersions
287 .map(version => {
288 const versionNotes = releaseNotes[version]
289 if (!versionNotes || versionNotes.length === 0) return null
290
291 const notes = versionNotes.filter(Boolean)
292 if (notes.length === 0) return null
293
294 return [version, notes] as [string, string[]]
295 })
296 .filter((item): item is [string, string[]] => item !== null)
297 } catch (error) {
298 logError(toError(error))
299 return []
300 }
301}
302
303/**
304 * Checks if there are release notes to show based on the last seen version.

Callers 1

callFunction · 0.85

Calls 6

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

Tested by

no test coverage detected