INNER CODE UNIT · TypeScript
diff
cyanheads/pubmed-mcp-server · scripts/build-changelog.ts:71
const diff = (bParts[i] ?? 0) - (aParts[i] ?? 0);
if (diff !== 0) return diff;
}
if (aPre === bPre) return 0;
if (aPre === null) return -1;
if (bPre === null) return 1;
return bPre.localeCompare(aPre);
}
/**
* Parse minimal YAML frontmatter. Only recognizes `summary`, `breaking`, and
* `security` — other keys are ignored, so the format stays extensible without
* touching the parser. Throws on malformed values we actually care about.
*/
function parseFrontmatter(content: string, fileLabel: string): Frontmatter {
const match = content.match(/^---\n([\s\S]*?)\n---\n?/);
if (!match) return { summary: null, breaking: false, security: false };