MCPcopy Create free account
hub / github.com/backnotprop/plannotator / generateSlug

Function generateSlug

packages/shared/storage.ts:49–56  ·  view source on GitHub ↗
(plan: string)

Source from the content-addressed store, hash-verified

47 * Format: {sanitized-heading}-YYYY-MM-DD
48 */
49export function generateSlug(plan: string): string {
50 const date = new Date().toISOString().split("T")[0]; // YYYY-MM-DD
51
52 const heading = extractFirstHeading(plan);
53 const slug = heading ? sanitizeTag(heading) : null;
54
55 return slug ? `${slug}-${date}` : `plan-${date}`;
56}
57
58/**
59 * Save the plan markdown to disk.

Callers 3

startPlannotatorServerFunction · 0.90
storage.test.tsFile · 0.90
startPlanReviewServerFunction · 0.85

Calls 2

sanitizeTagFunction · 0.90
extractFirstHeadingFunction · 0.85

Tested by

no test coverage detected