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

Function shared

src/resolution/ambient-modules.ts:791–796  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

789 const usable = all.filter((m) => m.script && reachesProgram(m.file, m.test, fromFile, fromTest, context));
790 const from = dir.split('/');
791 const shared = (file: string): number => {
792 const parts = file.split('/');
793 let k = 0;
794 while (k < from.length - 1 && k < parts.length - 1 && from[k] === parts[k]) k++;
795 return k;
796 };
797 const ordered = usable.length < 2 ? usable : usable
798 .map((m, index) => ({ m, index, near: shared(m.file) }))
799 .sort((a, b) => Number(a.m.test) - Number(b.m.test) || b.near - a.near || a.index - b.index)

Callers 1

declarationsForFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected