MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / normalizePath

Function normalizePath

src/lib/prettierFormatter.js:464–472  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

462}
463
464function normalizePath(path) {
465 let result = String(path || "").replace(/\\/g, "/");
466 while (result.length > 1 && result.endsWith("/")) {
467 const prefix = result.slice(0, -1);
468 if (/^[a-z]+:\/{0,2}$/i.test(prefix)) break;
469 result = prefix;
470 }
471 return result;
472}
473
474function pathsAreSame(a, b) {
475 if (!a || !b) return false;

Callers 3

findProjectRootFunction · 0.85
pathsAreSameFunction · 0.85

Calls 1

StringInterface · 0.85

Tested by

no test coverage detected