MCPcopy Create free account
hub / github.com/WebFreak001/code-debug / pathMatch

Method pathMatch

src/source_file_map.ts:60–74  ·  view source on GitHub ↗
(key: keyof Mapping, caseSensitive: boolean, path: string)

Source from the content-addressed store, hash-verified

58 }
59
60 private pathMatch(key: keyof Mapping, caseSensitive: boolean, path: string): Mapping | undefined {
61 for (const mapping of this.sortedMappings[key]) {
62 let matched: boolean;
63
64 if (caseSensitive)
65 matched = path.startsWith(mapping[key]);
66 else
67 matched = path.toLowerCase().startsWith(mapping[key].toLowerCase());
68
69 if (matched)
70 return mapping;
71 }
72
73 return undefined;
74 }
75
76 public toLocalPath(remotePath: string): string {
77 // Try to detect remote path.

Callers 2

toLocalPathMethod · 0.95
toRemotePathMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected