(before: CatalogMap, after: CatalogMap)
| 203 | * Includes added, removed, and version-changed entries. |
| 204 | */ |
| 205 | export 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…