(document: string)
| 257 | } |
| 258 | |
| 259 | export const extractImportMapSections = (document: string): string => { |
| 260 | const start = document.indexOf("## Import Map") |
| 261 | if (start === -1) { |
| 262 | return "## Import Map\n\nNo import map is available.\n" |
| 263 | } |
| 264 | const apiRenames = document.indexOf("\n## API Renames", start) |
| 265 | const removedModules = document.indexOf("\n## Removed Modules", start) |
| 266 | const apiReference = document.indexOf("\n## API Reference", start) |
| 267 | const ends = [apiRenames, removedModules, apiReference].filter((index) => index !== -1) |
| 268 | const end = ends.length === 0 ? document.length : Math.min(...ends) |
| 269 | return `${document.slice(start, end).trim()}\n` |
| 270 | } |
| 271 | |
| 272 | export const renderMigrationDocument = ( |
| 273 | diff: ApiDiff, |
no test coverage detected