MCPcopy Create free account
hub / github.com/code-forge-io/react-router-devtools / buildDocPathFromSlug

Function buildDocPathFromSlug

docs/app/utils/path-builders.ts:17–26  ·  view source on GitHub ↗
(slug: string)

Source from the content-addressed store, hash-verified

15}
16
17export function buildDocPathFromSlug(slug: string) {
18 const parts = slug.split("/").filter(Boolean)
19
20 if (parts.length === 1) {
21 return `/${parts[0]}`
22 }
23
24 const { section, subsection, filename } = splitSlug(slug)
25 return `/${[section, subsection, filename].filter(Boolean).join("/")}`
26}
27
28function getFilenameFromSlug(slug: string) {
29 return slug.split("/").filter(Boolean).at(-1) ?? slug

Callers 3

buildBreadcrumbsFunction · 0.90
walkFunction · 0.90
metaFunction · 0.90

Calls 1

splitSlugFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…