* Fetches file content, converting HTML to plain text when applicable.
( accessToken: string, fileId: string, fileName: string )
| 93 | * Fetches file content, converting HTML to plain text when applicable. |
| 94 | */ |
| 95 | async function fetchFileContent( |
| 96 | accessToken: string, |
| 97 | fileId: string, |
| 98 | fileName: string |
| 99 | ): Promise<string> { |
| 100 | const ext = fileName.slice(fileName.lastIndexOf('.')).toLowerCase() |
| 101 | const raw = await downloadFileContent(accessToken, fileId) |
| 102 | |
| 103 | if (ext === '.html' || ext === '.htm') { |
| 104 | return htmlToPlainText(raw) |
| 105 | } |
| 106 | |
| 107 | return raw |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Converts a OneDrive item to a lightweight metadata stub (no content). |
no test coverage detected