Apply a bump to a package, upgrading if already planned. Returns true if anything changed.
( planned: Map<string, PlannedBump>, name: string, type: BumpType, isDependencyBump: boolean, isCascadeBump: boolean, sourcePackageName: string, )
| 374 | |
| 375 | /** Apply a bump to a package, upgrading if already planned. Returns true if anything changed. */ |
| 376 | function applyBump( |
| 377 | planned: Map<string, PlannedBump>, |
| 378 | name: string, |
| 379 | type: BumpType, |
| 380 | isDependencyBump: boolean, |
| 381 | isCascadeBump: boolean, |
| 382 | sourcePackageName: string, |
| 383 | ): boolean { |
| 384 | const existing = planned.get(name); |
| 385 | if (existing) { |
| 386 | const newType = maxBump(existing.type, type); |
| 387 | if (newType === existing.type) return false; |
| 388 | existing.type = newType; |
| 389 | if (isDependencyBump) existing.isDependencyBump = true; |
| 390 | if (isCascadeBump) existing.isCascadeBump = true; |
| 391 | existing.bumpSources.set(sourcePackageName, type); |
| 392 | return true; |
| 393 | } |
| 394 | planned.set(name, { |
| 395 | type, |
| 396 | isDependencyBump, |
| 397 | isCascadeBump, |
| 398 | isGroupBump: false, |
| 399 | bumpFiles: new Set(), |
| 400 | bumpSources: new Map([[sourcePackageName, type]]), |
| 401 | }); |
| 402 | return true; |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * Apply normalized cascade rules (used for both cascadeTo and cascadeFrom). |
no test coverage detected
searching dependent graphs…