MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / slugifyArtifactId

Function slugifyArtifactId

src/artifacts/store.ts:84–93  ·  view source on GitHub ↗
(title: string)

Source from the content-addressed store, hash-verified

82
83/** Turn a human title into a stable, filesystem-safe kebab id. */
84export 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). */
96export function nextVersionNumber(manifest: ArtifactManifest): number {

Callers 2

createArtifactFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected