( diff: ApiDiff, annotations: ReadonlyMap<string, MigrationAnnotation>, importMapSections: string )
| 178 | } |
| 179 | |
| 180 | const migrationEntries = ( |
| 181 | diff: ApiDiff, |
| 182 | annotations: ReadonlyMap<string, MigrationAnnotation>, |
| 183 | importMapSections: string |
| 184 | ): ReadonlyArray<MigrationEntry> => { |
| 185 | const grouped = new Map<string, Array<ApiChange>>() |
| 186 | for (const change of diff.changes) { |
| 187 | if (change.baseApiId === undefined) { |
| 188 | continue |
| 189 | } |
| 190 | const id = stableApiId(change.baseApiId) |
| 191 | const changes = grouped.get(id) |
| 192 | if (changes === undefined) { |
| 193 | grouped.set(id, [change]) |
| 194 | } else { |
| 195 | changes.push(change) |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | const entries: Array<MigrationEntry> = [] |
| 200 | const removedModuleSet = new Set(removedModules(diff)) |
| 201 | const replacements = importMapReplacements(importMapSections) |
| 202 | const addedSignatures = addedApiSignatures(diff) |
| 203 | for (const [id, changes] of grouped) { |
| 204 | const rename = changes.find((change) => change.classification === "api-renamed") |
| 205 | const breaking = changes.some(isBreakingChange) |
| 206 | const removed = changes.some((change) => change.classification === "api-removed") |
| 207 | const importMove = changes.some((change) => change.classification === "api-moved") |
| 208 | if ( |
| 209 | isUnchangedModuleMove(id, changes, removedModuleSet, replacements, addedSignatures) || |
| 210 | (removed && isRemovalCoveredByModule(id, removedModuleSet, annotations)) || |
| 211 | (!breaking && rename === undefined && !removed) || |
| 212 | (importMove && rename === undefined && !breaking && !annotations.has(id)) |
| 213 | ) { |
| 214 | continue |
| 215 | } |
| 216 | entries.push({ |
| 217 | id, |
| 218 | module: id.split("#")[0]!, |
| 219 | rename |
| 220 | }) |
| 221 | } |
| 222 | return entries.sort((left, right) => compareStrings(left.module, right.module) || compareStrings(left.id, right.id)) |
| 223 | } |
| 224 | |
| 225 | const renderDetailedEntry = ( |
| 226 | entry: MigrationEntry, |
no test coverage detected