(page: {
data: { getText?: (type: 'processed' | 'raw') => Promise<string> };
})
| 17 | } |
| 18 | |
| 19 | async function getProcessedText(page: { |
| 20 | data: { getText?: (type: 'processed' | 'raw') => Promise<string> }; |
| 21 | }): Promise<string | null> { |
| 22 | try { |
| 23 | const getText = page.data.getText; |
| 24 | if (typeof getText === 'function') { |
| 25 | return await getText('processed'); |
| 26 | } |
| 27 | } catch { |
| 28 | // ignore |
| 29 | } |
| 30 | return null; |
| 31 | } |
| 32 | |
| 33 | export async function GET(request: Request) { |
| 34 | const url = new URL(request.url); |