( claudeMdContent: string, indexContent: string )
| 319 | } |
| 320 | |
| 321 | export function injectIntoClaudeMd( |
| 322 | claudeMdContent: string, |
| 323 | indexContent: string |
| 324 | ): string { |
| 325 | const wrappedContent = wrapWithMarkers(indexContent) |
| 326 | |
| 327 | if (hasExistingIndex(claudeMdContent)) { |
| 328 | const startIdx = claudeMdContent.indexOf(START_MARKER) |
| 329 | const endIdx = claudeMdContent.indexOf(END_MARKER) + END_MARKER.length |
| 330 | |
| 331 | return ( |
| 332 | claudeMdContent.slice(0, startIdx) + |
| 333 | wrappedContent + |
| 334 | claudeMdContent.slice(endIdx) |
| 335 | ) |
| 336 | } |
| 337 | |
| 338 | const separator = claudeMdContent.endsWith('\n') ? '\n' : '\n\n' |
| 339 | return claudeMdContent + separator + wrappedContent + '\n' |
| 340 | } |
| 341 | |
| 342 | interface GitignoreStatus { |
| 343 | path: string |
no test coverage detected