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

Function moduleConfigSnapshot

src/resolution/index.ts:326–335  ·  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

324
325/** Each of `files` (absolute) as the project sees it now, keyed by its project-relative path. */
326function moduleConfigSnapshot(projectRoot: string, files: Iterable<string>, previous: ModuleConfigSnapshot): ModuleConfigSnapshot {
327 const snapshot: ModuleConfigSnapshot = {};
328 for (const abs of files) {
329 const rel = path.relative(projectRoot, abs).replace(/\\/g, '/');
330 // A config outside the project (an `extends` into node_modules or a parent
331 // folder) is read where it is; the key stays relative so the index moves.
332 snapshot[rel] = moduleConfigEntry(abs, previous[rel], projectRoot);
333 }
334 return snapshot;
335}
336
337/**
338 * 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