* Composes the document body as "Title\n\n ".
(title: string, content: string)
| 387 | * Composes the document body as "Title\n\n<content>". |
| 388 | */ |
| 389 | function composeBody(title: string, content: string): string { |
| 390 | const trimmedTitle = title.trim() |
| 391 | const trimmedContent = content.trim() |
| 392 | if (!trimmedTitle) return trimmedContent |
| 393 | if (!trimmedContent) return trimmedTitle |
| 394 | return `${trimmedTitle}\n\n${trimmedContent}` |
| 395 | } |
| 396 | |
| 397 | /** |
| 398 | * Builds a wiki page document (full content) from a fetched page. |
no outgoing calls
no test coverage detected