MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / samePath

Function samePath

scripts/agent-eval/parse-run.mjs:793–797  ·  view source on GitHub ↗

Same file, with either side repo-relative and the other absolute.

(a, b)

Source from the content-addressed store, hash-verified

791const normPath = (p) => String(p ?? '').replace(/\\/g, '/').replace(/^\.\//, '');
792/** Same file, with either side repo-relative and the other absolute. */
793function samePath(a, b) {
794 const x = normPath(a), y = normPath(b);
795 if (!x || !y) return false;
796 return x === y || x.endsWith('/' + y) || y.endsWith('/' + x);
797}
798
799/**
800 * The files whose SOURCE an explore response returned — its per-file sections,

Callers 2

viaPathFunction · 0.70
readOfFunction · 0.70

Calls 1

normPathFunction · 0.85

Tested by

no test coverage detected