| 44 | type Format = (typeof Input.Type)["format"] |
| 45 | |
| 46 | const acceptHeader = (format: Format) => { |
| 47 | switch (format) { |
| 48 | case "markdown": |
| 49 | return "text/markdown;q=1.0, text/x-markdown;q=0.9, text/plain;q=0.8, text/html;q=0.7, */*;q=0.1" |
| 50 | case "text": |
| 51 | return "text/plain;q=1.0, text/markdown;q=0.9, text/html;q=0.8, */*;q=0.1" |
| 52 | case "html": |
| 53 | return "text/html;q=1.0, application/xhtml+xml;q=0.9, text/plain;q=0.8, text/markdown;q=0.7, */*;q=0.1" |
| 54 | } |
| 55 | return "*/*" |
| 56 | } |
| 57 | |
| 58 | const headers = (format: Format, userAgent: string) => ({ |
| 59 | "User-Agent": userAgent, |