(title: string)
| 82 | |
| 83 | /** Turn a human title into a stable, filesystem-safe kebab id. */ |
| 84 | export function slugifyArtifactId(title: string): string { |
| 85 | const base = title |
| 86 | .toLowerCase() |
| 87 | .normalize('NFKD') |
| 88 | .replace(/[^\p{Letter}\p{Number}]+/gu, '-') // keep letters/numbers (incl. Persian), rest → '-' |
| 89 | .replace(/^-+|-+$/g, '') |
| 90 | .replace(/-{2,}/g, '-') |
| 91 | .slice(0, 60); |
| 92 | return base || 'artifact'; |
| 93 | } |
| 94 | |
| 95 | /** Next version number for a manifest (max existing + 1). */ |
| 96 | export function nextVersionNumber(manifest: ArtifactManifest): number { |
no outgoing calls
no test coverage detected