MCPcopy
hub / github.com/nowork-studio/NotFair / projectHref

Function projectHref

notfair-cmo/src/lib/project-href.ts:11–20  ·  view source on GitHub ↗
(slug: string, path = "")

Source from the content-addressed store, hash-verified

9 * Passing an empty `path` returns the project root: `/<slug>`.
10 */
11export function projectHref(slug: string, path = ""): string {
12 if (!slug) {
13 throw new Error("projectHref: slug is required");
14 }
15 if (!path || path === "/" || path === "") {
16 return `/${slug}`;
17 }
18 const trimmed = path.startsWith("/") ? path.slice(1) : path;
19 return `/${slug}/${trimmed}`;
20}
21
22/**
23 * Strip the leading `/<currentSlug>` segment from a pathname and return the

Callers 15

AppSidebarFunction · 0.90
pickFunction · 0.90
goFunction · 0.90
newThreadFunction · 0.90
saveFunction · 0.90
TaskCardFunction · 0.90
ListViewFunction · 0.90
ConnectStepFunction · 0.90
pollFunction · 0.90
AccountStepFunction · 0.90
LiveTranscriptFunction · 0.90
AgentNavFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected