MCPcopy
hub / github.com/continuedev/continue / localPathToUri

Function localPathToUri

core/util/pathToUri.ts:8–16  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

6
7// Converts a local path to a file:/// URI
8export function localPathToUri(path: string) {
9 // This may incidentally solve bugs, but it is primarily here to warn us if we accidentally try to double-convert. It doesn't handle other URI schemes.
10 if (path.startsWith("file://")) {
11 console.warn("localPathToUri: path already starts with file://");
12 return path;
13 }
14 const url = pathToFileURL(path);
15 return URI.normalize(url.toString());
16}
17
18export function localPathOrUriToPath(localPathOrUri: string): string {
19 try {

Callers 8

loadJsonMcpConfigsFunction · 0.90
testDir.tsFile · 0.90
getDotContinueSubDirsFunction · 0.90
getClaudeSkillsDirFunction · 0.90
createNewGlobalRuleFileFunction · 0.90
constructorMethod · 0.85

Calls 2

warnMethod · 0.80
normalizeMethod · 0.80

Tested by

no test coverage detected