INNER CODE UNIT · TypeScript

match

cyanheads/pubmed-mcp-server · scripts/build-changelog.ts:126

  const match = body.match(/^#\s+\S+\s+[—–-]\s+(\d{4}-\d{2}-\d{2})/m);
  if (!match) {
    throw new Error(
      `${fileLabel}: H1 heading missing or malformed. Expected '# <version> — YYYY-MM-DD'.`,
    );
  }
  return match[1] as string;
}

function renderEntry(entry: VersionEntry, fm: Frontmatter, date: string): string {
  const link = `changelog/${entry.series}/${entry.version}.md`;
  const badges = [fm.breaking ? '⚠️ Breaking' : null, fm.security ? '🛡️ Security' : null].filter(
    (b): b is string => b !== null,
  );
  const badgeSuffix = badges.length > 0 ? ` · ${badges.join(' · ')}` : '';
  const header = `## [${entry.version}](${link}) — ${date}${badgeSuffix}`;
  if (fm.summary) {
    return `${header}\n\n${fm.summary}\n`;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…