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

Function moduleConfigSnapshot

src/resolution/index.ts:279–288  ·  view source on GitHub ↗

Each of `files` (absolute) as the project sees it now, keyed by its project-relative path.

(projectRoot: string, files: Iterable<string>, previous: ModuleConfigSnapshot)

Source from the content-addressed store, hash-verified

277
278/** Each of `files` (absolute) as the project sees it now, keyed by its project-relative path. */
279function moduleConfigSnapshot(projectRoot: string, files: Iterable<string>, previous: ModuleConfigSnapshot): ModuleConfigSnapshot {
280 const snapshot: ModuleConfigSnapshot = {};
281 for (const abs of files) {
282 const rel = path.relative(projectRoot, abs).replace(/\\/g, '/');
283 // A config outside the project (an `extends` into node_modules or a parent
284 // folder) is read where it is; the key stays relative so the index moves.
285 snapshot[rel] = moduleConfigEntry(abs, previous[rel], projectRoot);
286 }
287 return snapshot;
288}
289
290/**
291 * One file's snapshot entry. Every sync looks at these files, so one whose

Callers 1

Calls 1

moduleConfigEntryFunction · 0.85

Tested by

no test coverage detected