(slug: string, path = "")
| 9 | * Passing an empty `path` returns the project root: `/<slug>`. |
| 10 | */ |
| 11 | export 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 |
no outgoing calls
no test coverage detected