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

Function cleanSlug

docs/content-collections.ts:43–48  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

41 * Removes leading number prefixes like "01-", "02-" from each path segment.
42 */
43const cleanSlug = (p: string) =>
44 toPosix(p)
45 .split("/")
46 .filter(Boolean)
47 .map((seg) => seg.replace(/^\d{2,}-/, ""))
48 .join("/")
49
50const toPosix = (s: string) => {
51 return posix.normalize(s.replace(/\\/g, "/"))

Callers 1

Calls 1

toPosixFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…