MCPcopy Create free account
hub / github.com/pingdotgg/t3code / formatWorktreePathForDisplay

Function formatWorktreePathForDisplay

apps/web/src/worktreeCleanup.ts:35–45  ·  view source on GitHub ↗
(worktreePath: string)

Source from the content-addressed store, hash-verified

33}
34
35export function formatWorktreePathForDisplay(worktreePath: string): string {
36 const trimmed = worktreePath.trim();
37 if (!trimmed) {
38 return worktreePath;
39 }
40
41 const normalized = trimmed.replace(/\\/g, "/").replace(/\/+$/, "");
42 const parts = normalized.split("/");
43 const lastPart = parts[parts.length - 1]?.trim() ?? "";
44 return lastPart.length > 0 ? lastPart : trimmed;
45}

Callers 3

ThreadWorktreeIndicatorFunction · 0.90
useThreadActionsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected