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

Function tree

__tests__/package-deps.test.ts:25–36  ·  view source on GitHub ↗

A context over an indexed file list and the manifests on disk, recording every probe.

(files: string[], manifests: Record<string, Record<string, Record<string, string>>>)

Source from the content-addressed store, hash-verified

23
24/** A context over an indexed file list and the manifests on disk, recording every probe. */
25function tree(files: string[], manifests: Record<string, Record<string, Record<string, string>>>) {
26 const probes: string[] = [];
27 const context = {
28 getAllFiles: () => files,
29 fileExists: (p: string) => {
30 probes.push(p);
31 return p in manifests;
32 },
33 readFile: (p: string) => (p in manifests ? JSON.stringify(manifests[p]) : null),
34 } as unknown as ResolutionContext;
35 return { context, probes };
36}
37
38describe('declaredDependencies: manifests below the first two levels', () => {
39 it.each([

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected