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

Function uniqueId

src/artifacts/store.ts:159–166  ·  view source on GitHub ↗

Resolve a unique id when the slug already exists (append -2, -3, …).

(cwd: string, base: string)

Source from the content-addressed store, hash-verified

157
158/** Resolve a unique id when the slug already exists (append -2, -3, …). */
159async function uniqueId(cwd: string, base: string): Promise<string> {
160 let id = base;
161 let n = 2;
162 while (await readManifest(cwd, id)) {
163 id = `${base}-${n++}`;
164 }
165 return id;
166}
167
168export interface CreateInput { title: string; type: ArtifactType; content: string; note?: string; }
169

Callers 1

createArtifactFunction · 0.85

Calls 1

readManifestFunction · 0.70

Tested by

no test coverage detected