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

Function changedModuleConfigs

src/resolution/index.ts:417–424  ·  view source on GitHub ↗
(was: ModuleConfigSnapshot, now: ModuleConfigSnapshot)

Source from the content-addressed store, hash-verified

415
416/** The files of `now` whose digest differs from `was`'s; a stamp alone moved nothing. */
417export function changedModuleConfigs(was: ModuleConfigSnapshot, now: ModuleConfigSnapshot): string[] {
418 const digest = (entry: string): string => entry.split('@')[0]!;
419 // A snapshot from before manifests and compile databases counted says nothing about them.
420 const buildFilesKnown = 'Cargo.toml' in was;
421 return Object.keys(now).filter((rel) =>
422 (buildFilesKnown || !/(?:^|\/)(?:Cargo\.toml|compile_commands\.json)$/.test(rel)) &&
423 digest(was[rel] ?? 'absent') !== digest(now[rel]!));
424}
425
426/**
427 * The languages whose imports a changed config file governs: the ES-module

Callers 1

syncMethod · 0.85

Calls 1

digestFunction · 0.85

Tested by

no test coverage detected