MCPcopy Create free account
hub / github.com/better-auth/better-hub / encodeFilePath

Function encodeFilePath

apps/web/src/lib/github-utils.ts:591–602  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

589
590/** Encode file path segments that Next.js Link would interpret as dynamic routes */
591export function encodeFilePath(path: string): string {
592 return path
593 .split("/")
594 .map((s) =>
595 s
596 .replace(/\[/g, "%5B")
597 .replace(/\]/g, "%5D")
598 .replace(/\(/g, "%28")
599 .replace(/\)/g, "%29"),
600 )
601 .join("/");
602}

Callers 4

BreadcrumbNavFunction · 0.90
FileSearchBarFunction · 0.90
FileListFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected