(document: string)
| 273 | } |
| 274 | |
| 275 | export const extractImportMapSections = (document: string): string => { |
| 276 | const start = document.indexOf("## Import Map") |
| 277 | if (start === -1) { |
| 278 | return "## Import Map\n\nNo import map is available.\n" |
| 279 | } |
| 280 | const apiRenames = document.indexOf("\n## API Renames", start) |
| 281 | const removedModules = document.indexOf("\n## Removed Modules", start) |
| 282 | const apiReference = document.indexOf("\n## API Reference", start) |
| 283 | const ends = [apiRenames, removedModules, apiReference].filter((index) => index !== -1) |
| 284 | const end = ends.length === 0 ? document.length : Math.min(...ends) |
| 285 | return `${document.slice(start, end).trim()}\n` |
| 286 | } |
| 287 | |
| 288 | export const renderMigrationDocument = ( |
| 289 | diff: ApiDiff, |
no test coverage detected