MCPcopy Create free account
hub / github.com/Effect-TS/effect / extractImportMapSections

Function extractImportMapSections

packages/tools/api-diff/src/MigrationDoc.ts:259–270  ·  view source on GitHub ↗
(document: string)

Source from the content-addressed store, hash-verified

257}
258
259export 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
272export const renderMigrationDocument = (
273 diff: ApiDiff,

Callers 2

ApiDiffClass · 0.90

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected