MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / diffCatalogMaps

Function diffCatalogMaps

packages/bumpy/src/utils/package-manager.ts:205–225  ·  view source on GitHub ↗
(before: CatalogMap, after: CatalogMap)

Source from the content-addressed store, hash-verified

203 * Includes added, removed, and version-changed entries.
204 */
205export function diffCatalogMaps(before: CatalogMap, after: CatalogMap): Map<string, Set<string>> {
206 const changes = new Map<string, Set<string>>();
207 const catalogNames = new Set([...before.keys(), ...after.keys()]);
208
209 for (const catalogName of catalogNames) {
210 const beforeDeps = before.get(catalogName) ?? {};
211 const afterDeps = after.get(catalogName) ?? {};
212 const depNames = new Set([...Object.keys(beforeDeps), ...Object.keys(afterDeps)]);
213 const changedDeps = new Set<string>();
214 for (const depName of depNames) {
215 if (beforeDeps[depName] !== afterDeps[depName]) {
216 changedDeps.add(depName);
217 }
218 }
219 if (changedDeps.size > 0) {
220 changes.set(catalogName, changedDeps);
221 }
222 }
223
224 return changes;
225}
226
227/**
228 * Given a set of catalog entries that have changed, return the set of catalog

Callers 2

getChangedCatalogEntriesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…