MCPcopy
hub / github.com/Dimillian/CodexMonitor / appendPathIfMissing

Function appendPathIfMissing

src/features/app/hooks/useWorkspaceDialogs.ts:31–41  ·  view source on GitHub ↗
(value: string, path: string)

Source from the content-addressed store, hash-verified

29}
30
31function appendPathIfMissing(value: string, path: string) {
32 const trimmedPath = path.trim();
33 if (!trimmedPath) {
34 return value;
35 }
36 const entries = parseWorkspacePathInput(value);
37 if (entries.includes(trimmedPath)) {
38 return value;
39 }
40 return [...entries, trimmedPath].join("\n");
41}
42
43function loadRecentRemoteWorkspacePaths(): string[] {
44 if (typeof window === "undefined") {

Callers 1

useWorkspaceDialogsFunction · 0.85

Calls 1

parseWorkspacePathInputFunction · 0.85

Tested by

no test coverage detected